Scroll to navigation

GLwDrawingArea(3X) GLwDrawingArea(3X)

̾??

GLwDrawingArea, GLwMDrawingArea — OpenGL ?Ѥ????襦???????å?

????

#include <X11/GLw/GLwDrawA.h>
ld ... -lGLw -lGL -l<Ǥ?դΥ????????åȥ饤?֥???> -lXext -lXt -lX11 -lm

#include <X11/GLw/GLwMDrawA.h>
ld ... -lGLw -lGL -lXm -lXext -lXt -lX11 -lm

????

GLwDrawingArea ?????? GLwMDrawingArea ?? OpenGL ???????˻? ???륦???????åȤǤ??롣???????Υ????????åȤϡ????ꤵ?줿?ѥ??᡼???? ???Ť??ơ?OpenGL ??ɬ?פȤʤ?Ŭ?ڤʥӥ??奢???ȥ??顼?ޥåפ????? ???????ɥ???Ϳ???롣 ?ޤ???GLwDrawingArea ?? GLwMDrawingArea ?Ϻ????衦?ꥵ?????????ϡ? ???????Τ????Υ??????Хå???Ϳ???롣

GLwDrawingArea ?Ϥ????ʤ륦???????åȥ??åȤΰ????Ǥ??ʤ?????Xt ?????? ?ϰ?¸???롣 GLwDrawingArea ?Ϥɤ??ʥ????????åȥ??åȤ??Ȥ߹??碌?Ƥ??Ȥ??롣 GLwMDrawingArea ?? GLwDrawingArea ?Ȥۤ?Ʊ???Ǥ??뤬??Motif ?Υ????????åȥ??饹?Ǥ??? XmPrimitive ?Υ??֥??饹?Ǥ??ꡢ?ǥե????? ???֤? Motif ??Ŭ?????褦?ˤʤäƤ??롣?㤨?С?GLwMDrawingArea ?? Motif ?Υǥե????Ȥ????ʿ????طʿ????꥽?????˻??????????ܡ??ɤΰ?ư?? ???ꤦ?ޤ??????롣 GLwDrawingArea ?? Motif ?Υץ????????ǻȤ??뤬??GLwMDrawingArea ???Ȥ? ?????侩?????롣

GLwDrawingArea ?? GLwMDrawingArea ?ϤۤȤ???Ʊ??ư???ʤΤǡ????? ?????饤???ޥ˥奢???λĤ?????ʬ?Ǥϡ?ư??ۤʤ???ʬ???????? GLwDrawingArea ?????????????롣????Ū?˽Ҥ٤ʤ??¤ꡢGLwDrawingArea ?? ?ؤ??????Ƥ??????? GLwMDrawingArea ?ˤ????ƤϤޤ롣

GLwDrawingArea ??????????????Ϳ?????????????Ǥ⡢?ä˽??פʤΤ? ?ӥ??奢?????????뤿????ɬ?פʾ????Ǥ??롣 ??????Ϳ??????ˡ?? 3 ?Ĥ??ꡢ???Τ????????꥽??????ͳ?ǹԤ????롣 ?????? visualInfo ??¤?Τ??Ϥ????Ȥ??Ǥ??롣 (???? visualInfo ?ϴ????̤ΤȤ????Ǽ??????Ƥ??ʤ????Фʤ??ʤ??? ???ץꥱ???????󤬹Ԥ? OpenGL ???????Ȥ??? visualInfo ?θߴ??????ݾڤ? ???Τϥ??ץꥱ?????????߷׼Ԥ???Ǥ?Ǥ???)?? ?̤???ˡ?Ȥ??ơ?°???ꥹ?Ȥ?Ϳ???뤳?Ȥ??Ǥ??롣????°???ꥹ?Ȥϡ? ľ?? OpenGL ?ץ??????ߥ󥰤??Ԥ??????˻Ȥ????????Τ?????Ʊ???񼰤Ǥ??롣 ?Ǹ??ˡ????줾????°???????̤Υ꥽?????Ȥ??ƻ??ꤹ?뤳?Ȥ??Ǥ??롣 ?Ǹ?????ˡ???Ǥ?ñ???Ǥ??ꡢ?꥽?????ե????뤫???????Ǥ???ͣ??????ˡ?Ǥ? ?롣

?ӥ??奢???γ??????ưʳ??ˤ⡢GLwDrawingArea ?? ???ץꥱ?????????˳??????Ƥ????ʤ????Х??顼?ޥåפγ??????Ƥ??Ԥ? (???顼?ޥåפ????????Ƥ????????硢???顼?ޥåפȥӥ??奢???θߴ????? ?ݾڤ????Τϥ??ץꥱ?????????߷׼Ԥ???Ǥ?Ǥ??롣) ???ץꥱ??????????Ʊ???ӥ??奢?뤫??ʣ???Ĥ? GLwDrawingAreas ???????? ?????硢Ʊ?????顼?ޥåפ??Ȥ?????(???????ۤʤ륢?ץꥱ?????????֤Ǥ? ???顼?ޥåפ϶?ͭ?????ʤ?)??

?????????åȤ????????Ƥ⡢?????????åȤ??ꥢ?饤?????????ޤǤϥ??????ɥ? ???????????ʤ??????????äƥ??ץꥱ?????????ϥ??????ɥ????Ф??? OpenGL ???????򥦥??????åȤ?????ľ???˹ԤäƤϤʤ??ʤ??? ???ץꥱ?????????ϥ??????ɥ????ꥢ?饤?????????Τ??Ԥ??ʤ????Фʤ??ʤ??? ?????Ǥ?????????????ˡ?Ȥ??ơ????????ɥ??????????줿???Ȥ򼨤? ginit ???????Хå? ???ȤäƤ??褤?????Υ??????Хå????????????С????ץꥱ?????????? ???Υ??????ɥ????Ф??????Ƥ? OpenGL ?????????????Ԥ??????줫?餽??¾?? ???????Ԥ????Ȥ??Ǥ??롣???????ˤĤ??Ƥϸ??Ǿܤ??????????롣

???ץꥱ?????????? glXMakeCurrent ?ޤ??ϴʰ״ؿ? GLwDrawingAreaMakeCurrent ???Ȥäơ????????????? GLwDrawingArea ?????򤹤롣 GLwDrawingAreaMakeCurrent ?ϥǥ????ץ쥤?ȥ??????ɥ??????????? ?????????åȤ????????˼??롣 ???????δؿ??ϡ?GLwDrawingArea ?????Ĥ????ʤ????а??٤????Ƥ٤Ф褤???? ʣ???? GLwDrawingArea ???????????ϡ????줾???Υ??????Хå?????Ƭ?ǸƤ? ?ʤ????Фʤ??ʤ??? ?????Ǹ??????????Хå??ˤϡ??????????åȼ??Ȥ?Ϳ???륳?????Хå??????? ?ʤ???GL ??ư???˱ƶ???Ϳ???????ƤΥ??????Хå?(?????ॢ???Ȥ????ȼ?³????) ???ޤޤ??롣

???ץꥱ???????󤬥??֥??Хåե????󥰤??ȤäƤ????????ϡ? glXSwapBuffers ?ǤϤʤ? GLwDrawingAreaSwapBuffers ???Ƥ֤Ȥ褤?? ???δؿ????Ȥ??ȥǥ????ץ쥤?ȥ??????ɥ??????????˥????????åȤ????ꤹ ?뤳?Ȥ??Ǥ??롣

GLwDrawingArea ???饹

GLwDrawingArea ?? Core ???饹????ư???ȥ꥽???????Ѿ????롣
???饹?ݥ??󥿤? glwDrawingAreaWidgetClass ?Ǥ??롣
???饹̾?? GLwDrawingArea ?Ǥ??롣

GLwMDrawingArea ???饹

GLwMDrawingArea ?? XmPrimitive ???饹?? Core ???饹???? ư???ȥ꥽???????Ѿ????롣
???饹?ݥ??󥿤? glwMDrawingAreaWidgetClass ?Ǥ??롣
???饹̾?? GLwMDrawingArea ?Ǥ??롣

???????꥽????

?ʲ???ɽ?ϥץ??????ޤ??ǡ????????ꤹ?뤿???˻Ȥ??????????åȥ꥽?????? ???????롣?ץ??????ޤϷѾ????줿???饹???Ф??ƥ꥽?????ͤ????ꤷ?ơ? ???Υ????????åȤ?°???????ꤷ?Ƥ??褤??.Xdefaults ?ե????????? ?꥽??????̾???ޤ??ϥ??饹?ǻ??Ȥ????ˤϡ??ץ??ե??å??? GLwN ?? ???? GLwC ?????ꡢ?Ĥä?ʸ???????Ȥ????ȡ? ?ʲ??Ǥ? 2 ?Ĥ?ɽ?򼨤????ǽ???ɽ?ˤ? glXChooseVisual ??ľ?ܻȤ? °?????б??????꥽?????????????Ƥ??롣 glXChooseVisual ?ξ?????Ʊ?͡????Ƥ? Boolean ???Υ꥽?????? ?ǥե??????ͤ? FALSE ?Ǥ??ꡢ???Ƥ????????꥽?????Υǥե??????ͤ? 0 ?? ???롣?????? redSize, greenSize, blueSize ???㳰?ǡ????????Υǥե????? ?ͤ? 1 ?Ǥ??롣???????Υ꥽?????????????ˤΤ????ꤵ?졢?ӥ??奢???? ???????????˻Ȥ????롣 GLwNattribList ?꥽?????ޤ??? GLwNvisualInfo ?꥽?????? ???ꤵ???Ƥ????????ϡ????????Υ꥽??????̵?뤵???롣 ???????Υ꥽?????θ?ͭ?ΰ?̣?? glXChooseVisual ?? ?????饤???ޥ˥奢?????????????Ƥ????Τǡ??????Ǥ????????ʤ???

̾?? ???饹 ?? OpenGL °??
GLwNbufferSize GLwCBufferSize int GLX_BUFFER_SIZE
GLwNlevel GLwCLevel int GLX_LEVEL
GLwNrgba GLwCRgba Boolean GLX_RGBA
GLwNdoublebuffer GLwCDoublebuffer Boolean GLX_DOUBLEBUFFER
GLwNstereo GLwCStereo Boolean GLX_STEREO
GLwNauxBuffers GLwCAuxBuffers Boolean GLX_AUX_BUFFERS
GLwNredSize GLwCColorSize int GLX_RED_SIZE
GLwNgreenSize GLwCColorSize int GLX_GREEN_SIZE
GLwNblueSize GLwCColorSize int GLX_BLUE_SIZE
GLwNalphaSize GLwCAlphaSize int GLX_ALPHA_SIZE
GLwNdepthSize GLwCDepthSize int GLX_DEPTH_SIZE
GLwNstencilSize GLwCStencilSize int GLX_STENCIL_SIZE
GLwNaccumRedSize GLwCAccumColorSize int GLX_ACCUM_RED_SIZE
GLwNaccumGreenSize GLwCAccumColorSize int GLX_ACCUM_GREEN_SIZE
GLwNaccumBlueSize GLwCAccumColorSize int GLX_ACCUM_BLUE_SIZE
GLwNaccumAlphaSize GLwCAccumAlphaSize int GLX_ACCUM_ALPHA_SIZE

?ʲ???ɽ?? GLwDrawingArea ?????????åȤΤ???¾?Υ꥽?????????󤷤????? ?Ǥ??롣???줾???ˤĤ??Ƥξܤ????????ϸ??ǽҤ٤롣 ?֥????????ץ??????Υ????ɤΰ?̣?ϰʲ????̤??Ǥ???: ???ꤵ?줿?꥽?????????????????ꤵ????(C)?? XtSetValues ???Ȥä????ꤵ????(S)?? XtGetValues ???ȤäƼ?????????(G)?? Ŭ?Ѥ????ʤ?(N/A)??

̾?? ???饹 ?? ?????? ????????
GLwNallocateBackground GLwCAllocateColors Boolean F CG
GLwNallocateOtherColors GLwCAllocateColors Boolean F CG
GLwNattribList GLwCAttribList int * NULL CG
GLwNexposeCallback GLwCCallback XtCallbackList NULL C
GLwNginitCallback GLwCCallback XtCallbackList NULL C
GLwNinputCallback GLwCCallback XtCallbackList NULL C
GLwNinstallBackground GLwCInstallBackground Boolean T CG
GLwNinstallColormap GLwCInstallColormap Boolean T CG
GLwNresizeCallback GLwCCallback XtCallbackList NULL C
GLwNvisualInfo GLwCVisualInfo XVisualInfo* NULL CG

TRUE ?ξ??硢(???????뤳?Ȥ?Ŭ?ڤǤ?????)???????׻????줿???顼?ޥå? ?ȥӥ??奢?????Ѥ????طʥԥ??????ȥԥå????ޥåפ????????Ƥ????롣 FALSE ?ξ??硢?ƤΥ??顼?ޥåפȥӥ??奢?????ȤäƷ׻????줿?ͤ????Τ? ???ݻ??????롣 X ???طʤ򥯥ꥢ???????????ץꥱ?????????Ǥϡ????̤Ϥ????ͤ? TRUE ?ˤ??롣 ?طʤ???ʬ?ǥ??ꥢ???륢?ץꥱ?????????ǤϤ????ͤ? FALSE ?ˤ??뤳?Ȥ? ¿????????ʬ?ǻȤ????????طʿ????䤤???碌???????ˤϤ????ͤ? TRUE ?? ???Ƥ??褤?? ?ޤ??????顼?ޥåפ????Ĥ??????ݡ??Ȥ??Ƥ??ʤ??ϡ??ɥ??????Ǥϡ? OpenGL ?Υ??顼?ޥåפȥǥե????Ȥ? X ?Υ??顼?ޥåפιԤ????Dz??̤? ???????????Τ??򤱤뤿???ˡ????ץꥱ?????????Ͽ????褯???դ??Ƴ??????Ƥ?ɬ ?פ????뤫?⤷???ʤ??? (????: Xt ??ư???λ????Τ??ᡢ?طʿ??Ϻǽ??ϥǥե????ȤΥ??顼?ޥå? ???ȤäƷ׻??????롣???Υ꥽?????????ꤵ???Ƥ????ȡ??طʿ????????? ?Ʒ׻??Ǥ??롣???顼?ޥåפ?ưŪ?˷׻????????ΤǤϤʤ???????Ū?? ?????????åȤ?Ϳ?????줿???硢???????Υ꥽?????Ͼ??ˤ??Υ??顼?ޥåפ? ?ȤäƷ׻??????롣)
?????? GLwNallocateBackground ?˻??Ƥ??뤬?? ?̾??ϥ????????åȤˤ??äƳ??????Ƥ????롢????¾?ο??????????Ƥ롣 GLwDrawingArea ?????????åȤ????? GLwMDrawingArea ?????????åȤϤ????? ?ο????Ȥ??ʤ????????ץꥱ???????????䤤???碌?뤳?Ȥ??????Ǥ??褤?? ?? Motif ?? GLwDrawingArea ?????????åȤξ????ϡ????????Ƥ????뿧??¾?? ?ʤ??Τǡ????Υ꥽?????ϲ??⤷?ʤ???Motif ?? GLwMDrawingArea ?ξ????ϡ? XmPrimitive resources XmNforeground, XmNhighlightColor, XmNhighlightPixmap ???׻??????롣
glXChooseVisual ???Ƥ֤Τ?ɬ?פ?°???Υꥹ?Ȥ????ġ? ???Υ꥽?????? NULL ?ξ??硢??????°????Ϣ?꥽?????˴??Ť??Ʒ׻??????롣 NULL ?Ǥʤ??????ϡ?°????Ϣ?꥽??????̵?뤵???롣
?????????åȤ?Ϫ?Х??٥??Ȥ????????ä????˸ƤӽФ????륳?????Хå??? ?ꥹ?Ȥ????ꤹ?롣 ???????Хå?????ͳ?? GLwCR_EXPOSE ?Ȥʤ롣 ???????Хå???¤?Τ?Ϫ?Х??٥??Ȥ????äƤ??롣 ???ץꥱ?????????ϰ???Ū?ˤϲ??̤κ????????Ԥ??Ȥ褤??
?????????åȤ??ǽ??˥ꥢ?饤?????줿???˸ƤФ??륳?????Хå??????ꤹ?롣 ?????????åȤ??ꥢ?饤?????????ޤǤϤɤΤ褦?? OpenGL ?????????¹ԤǤ? ?ʤ??Τǡ????Υ??????Хå??? OpenGL ??Ŭ?ڤʽ????????Ԥ??????˻Ȥ??? (?????ƥ????Ȥ??????ʤ?)??
?????????åȤ??????ܡ??ɥ??٥??Ȥޤ??ϥޥ??????٥??Ȥ????????ä????? ?ƤӽФ????륳?????Хå??????ꤹ?롣?ǥե????ȤǤϡ????ϥ??????Хå??? ?????β???????Υ?????ꤷ???Ȥ????ޥ????Υܥ????򲡤?????Υ?????ꤷ???? ?????ܥ????򲡤??ʤ????ޥ?????ư???????????????ƤӽФ????롣 ????????????ư???ϥȥ??󥹥졼???????ơ??֥????Ѥ??뤳?Ȥˤ????ѹ??Ǥ??롣 ???Υ??????Хå???¤?Τ????ϥ??٥??Ȥ????ġ? ???Υ??????Хå?????ͳ?? GLwCR_INPUT ?Ȥʤ롣
???ϥ??????Хå??ϥץ??????ߥ󥰤??ڤˤ??뤿????Ϳ???????Ƥ??롣 ?Ȥ????Τ⡢?????????Ƥ????ϥ??٥??Ȥ???ñ????ª??????ˡ??Ϳ???뤫???? ???롣?????????⥸?塼?벽???ʤ????ץ????????ϡ????ƤΥ??????Хå??? ?ġ?????ª?????ΤǤϤʤ??????ѤΥ??????????ȥȥ??󥹥졼???????? ???ץꥱ??????????Ϳ???뤳?Ȥˤ????¸??Ǥ??뤳?Ȥ?¿???? ????Ū?˥ȥ??󥹥졼???????????ꤹ?뤳?Ȥˤ??ꡢ?????˥??????ޥ??????? ???Ȥ??Ǥ??롣
TRUE ?????ꤵ???Ƥ??????硢?طʿ??????????ɥ??˥??󥹥ȡ??뤵???롣 FALSE ?????ꤵ???Ƥ??????硢???????ɥ????طʿ????????ʤ??? ???Υ꥽?????? GLwNallocateBackground ?? TRUE ?Ǥʤ????и??̤??ʤ???
TRUE ?????ꤵ???Ƥ??????硢???Υ??????ɥ??Υ????뤬?ե??????????????? ?ˡ??????????åȤ? XSetWMColormapWindows ???ƤӽФ??? ???????ɥ??ޥ͡??????˥??顼?ޥåפ򥤥󥹥ȡ??뤹???褦?˻ؼ????롣 ʣ???? GLwDrawingAreas ?ǰ??ĤΥ??顼?ޥåפ???ͭ???Ƥ??륢?ץꥱ???????? ?ξ??硢?ơ??Υ??顼?ޥåפ??Ф??Ƥ??????Ĥ????? GLwDrawingArea ?? ???Υ꥽?????? TRUE ?????ꤹ???Τ??Ǥ???ΨŪ?Ǥ??롣 ???ץꥱ???????󤬥??顼?ޥåפν????ˤĤ??Ƥ???????????ɬ?פȤ??????? ?ϡ????Υ꥽?????ˤ? FALSE ?????ꤷ?????ץꥱ??????????????Ū?? XSetWMColormapWindows ???ƤӽФ??Ȥ褤??
GLwDrawingArea ???ꥢ?饤?????줿???˸ƤӽФ????륳?????Хå??Υꥹ?? ?????ꤹ?롣 ???????Хå?????ͳ?? GLwCR_RESIZE ?Ȥʤ롣
???????ɥ??Υӥ??奢????????¤?ΤؤΥݥ??󥿤????ġ? ?????ͤ? NULL ?ξ??硢visualInfo ??¤?Τϥ????????åȤ????????? GLwNattributeList ?꥽????(???Υ꥽???????ȤϤ??ޤ??ޤʥ꥽???? ?????׻???????)?˴??Ť??Ʒ׻??????롣 GLwNvisualInfo ?? NULL ?Ǥʤ????С?GLwNattributList ?? °????Ϣ?꥽??????̵?뤵???롣

?Ѿ????????꥽????

GLwDrawingArea ?? GLwMDrawingArea ?Τ??????⡢?????Υ????ѡ????饹???? ư???ȥ꥽???????Ѿ????롣 ???˽Ҥ٤????顼?ޥåפ??طʿ??꥽??????ư?????????????ƤΥǥե??????? ?ϥ????Τ??Τ?Ʊ???Ǥ??롣

?????˲ä??ơ?Motif ?Ǥ? GLwMDrawingArea ?? XmPrimitive ???Ѿ????Ƥ??롣 ???꥽??????ư???ˤĤ??Ƥϴ????????????? ???Υ????????åȤǤ? TraversalOn ?꥽??????̵???ˤ????Ƥ??뤬?? ?????ܡ??????Ϥ?ɬ?פʤ?ͭ???ˤ??٤??Ǥ???(?ޤ??????ץꥱ?????????? ?????????å????ǥޥ????Υܥ??? 1 ???????????٤? XmProcessTraversal(widget, XmTRAVERSE_CURRENT) ???Ƥ֤٤??Ǥ??롣?????? Motif ???????ΰ???ɬ?פʤ??Ȥ?Ʊ?ͤǤ???)?? Motif ?ϰ??ĤΥȥåץ??٥륷???뤬ʣ???ĤΥӥ??奢???????ĤȺ??𤹤??? ?ǡ?XmNhighlightOnEnter ??̵???ˤ????Ƥ??ꡢ XmNhighlightThickness ?ˤ? 0 ?????ꤵ???Ƥ??롣

???????Хå?????

?ʲ??ι?¤?Τ??ؤ??ݥ??󥿤??ơ??Υ??????Хå????Ϥ?????:

typedef struct
{
	int	 reason;
	XEvent	*event;
	Dimension	 width, height;
} GLwDrawingAreaCallbackStruct;

???????Хå????ƤӽФ??줿??ͳ?򼨤??? ???????????ͤϡ????ҤΥ꥽???????????ǽҤ٤????Ƥ??롣 Motif ?ץ??????ޤξ??? GLwCR_EXPOSE, GLwCR_RESIZE, GLwCR_INPUT ?Ͻ??? XmCR_EXPOSE, XmCR_RESIZE, XmCR_INPUT ??Ʊ???Ǥ??롣GLwCR_GINIT ?????????????Τ? Motif ?ˤ?¸?ߤ??ʤ???
???????Хå??򵯤????? XEvent ???ؤ??ݥ??󥿤Ǥ??롣 GLwNginitCallback ?? GLwNresizeCallback ?ξ????? NULL ?Ȥʤ롣
???????ɥ??????ȹ⤵?????ꤵ???롣

?ȥ??󥹥졼??????

GLwDrawingArea ?ϰʲ??Υȥ??󥹥졼????????????:

<KeyDown>:	glwInput()
<KeyUp>:	glwInput()
<BtnDown>:	glwInput()
<BtnUp>:	glwInput()
<BtnMotion>:	glwInput()

GLwMDrawingArea ?Ϥ????˰ʲ??Υȥ??󥹥졼????????????:

<Key>osfHelp:	PrimitiveHelp()

???ץꥱ?????????ǥǥե??????Ͱʳ??Υ??٥??Ȥ????????ꤿ?????С? ?̤Υȥ??󥹥졼???????ơ??֥??򥤥󥹥ȡ??뤹?뤳?ȤǼ¸??Ǥ??롣

???????????롼????

GLwDrawingArea ?ϰʲ??Υ??????????롼??????????:

???ҤΥȥ??󥹥졼???????Τ????줫?????Ϥ??????????Ȥ򼨤????????˸Ƥ? ?Ф????롣 ???Υ??????????롼??????ͣ??????Ū?????ϥ??????Хå??θƤӽФ??Ǥ??롣

??????

?????????åȤ??ǽ??????????줿??(?㤨?? XtCreateWidget(3X) ??????)?? ?????????åȤ??б????륦?????ɥ??ϼ?ưŪ?ˤ??????????ʤ??? ?ºݤˤϥ??????ɥ????????ϥ????????åȤ??ꥢ?饤???????ޤ??Ԥ??????롣 ????????glXchooseVisual ?Ϥ????˸ƤФ????Τǡ????η??̤򸵤ˤ??? ?????????ѤǤ??롣

?????????å??????ȥꥢ?饤???δ֤ϰʲ??Τ褦?ˤʤ?:

???????ɥ????Ф??? OpenGL ???????ϤǤ??ʤ???
resize ???????Хå????????????ʤ???
?̾??Υ??????ɥ??????ѤǤ??ʤ?(XtWindow ?? NULL ???֤?)??
GLwDrawingAreaMakeCurrent (?????? glXMakeCurrent) ???Ƥ??? ?Ϥʤ??ʤ???

?????????åȤ??ꥢ?饤???????ȡ??ʲ???ư???????:

???????ɥ????????????롣
ginit ???????Хå????ƤФ??롣 ?桼???Ϥ??Υ??????Хå????Ȥäơ?ɬ?פ? OpenGL ?ν??????򥦥????ɥ??? ?Ф??ƹԤ??Ȥ褤??

????

???ϥ??????Хå????Ȥäƥ????ܡ??????Ϥ????????????硢???٥??????? ?????????ɤ? KeySym ???Ѵ????ʤ????Фʤ??ʤ??? ?Ѵ??ˤ? XLookupKeysym(3X) ?ޤ??? XLookupString(3X) ???Ȥ? ???ȡ? ?????ܡ??????Ϥϥȥ??󥹥졼???????Ǥⰷ???롣???????ξ????ˤ??Ѵ??? ???פǤ??롣

Motif ?ץ??????ޤϡ?OSF ???????β??۳??????Ƥ??ȤäƤ??ơ??????Ĥ??? ???????????Ƥ??֤??????Ƥ??뤳?Ȥ??ռ????Ƥ????٤??Ǥ??롣 ????Ū?????Ȥ??Ƥϡ?(GL ?ץ????????Ǥ褯?????褦??)ESC ???????Ȥä? ?ץ???????????λ???????????ˤϡ??ȥ??󥹥졼???????ˤ? <key>Escape ?? ?ʤ? <key>osfCancel ?????ꤹ?٤??Ǥ??롣

Motif ?ץ??????ޤϡ?Motif ?????????? GLwCreateMDrawingArea ???Ȥ? ?? GLwMDrawingArea ?????????Ƥ??褤??

??????

GLwDrawingArea ?????????åȤ?????????Ŭ?ڤʥ??????Хå??????????Ƥ? ?????ɤ?????ȴ?褷?Ƽ?????



#include <stdlib.h>
#include <X11/GLw/GLwDrawA.h>
static GLXContext glx_context;
. . .
main()
{
Arg args[10];
int n;
Widget parent;
Widget glw;
. . .

n = 0;
XtSetArg(args[n], GLwNrgba, True); n++;
glw = XtCreateManagedWidget("glw", glwDrawingAreaWidgetClass,
parent, args, n);
XtAddCallback(glw, GLwNexposeCallback, exposeCB, NULL);
XtAddCallback(glw, GLwNresizeCallback, resizeCB, NULL);
XtAddCallback(glw, GLwNginitCallback, ginitCB, NULL);

. . .
}
static void
exposeCB(Widget w, XtPointer client_data,
GLwDrawingAreaCallbackStruct *call_data)
{
GLwDrawingAreaMakeCurrent(w, glx_context);

}
static void
resizeCB(Widget w, XtPointer client_data,
GLwDrawingAreaCallbackStruct *call_data)
{
GLwDrawingAreaMakeCurrent(w, glx_context);

}
static void
ginitCB(Widget w, XtPointer client_data,
GLwDrawingAreaCallbackStruct *call_data)
{
Arg args[1];
XVisualInfo *vi;
XtSetArg(args[0], GLwNvisualInfo, &vi);
XtGetValues(w, args, 1);

glx_context = glXCreateContext(XtDisplay(w), vi,
NULL, GL_FALSE);
GLwDrawingAreaMakeCurrent(w, glx_context);

}

Motif ?ץ?????????ɬ?פȤʤ????????ϡ? GLwDrawingArea.h ?ǤϤʤ? GLwMDrawingArea.h ???Ȥ??? GLwDrawingAreaWidgetClass ???Ǥʤ? GLwMDrawingAreaWidgetClass ???? ?????????åȤ????????뤳?Ȥ????Ǥ??롣 ?????????Ԥ????????ˡ?Motif ?ץ????????Ǥ? GLwCreateMDraw(3X) ?? ?ȤäƤ??褤??

?ٹ?

GLwDrawingArea ?????˥ꥢ?饤???????Ƥ??륦???????åȤλҤȤ????????? ?줿???硢GLwDrawingArea ??¨?¤????????졢?桼???ˤ? ginit ?? ?ɲä??뵡????Ϳ???????ʤ??????Τ褦?ʾ????ˤϡ????????ˤϥ??????Хå? ???Ȥ鷺???????????å???????ľ???˹Ԥ??٤??Ǥ??롣

?? Motif ?? GLwDrawingArea ?????????åȤ? Motif ?ץ????????ǻȤ??????? ?˥????ܡ??ɤ????ܤ??Ԥ??????ˤϡ??桼???? GLwDrawingArea ?????ܤ????? ????ư????̤?????Ǥ??롣

??Ϣ????

glXChooseVisual(3G), GLwDrawingAreaMakeCurrent(3X), glXMakeCurrent(3G), GLwDrawingAreaSwapBuffers(3X) GLwCreateMDraw(3X), Core(3X), XmPrimitive(3X), VirtualBindings(3X), XSetWMColormapWindows(3X11) ?????? OpenGL ?λ??͡?