home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / gfx / x11 / Mesa_Amiwin.lha / Mesa-Amiwin / widgets / man / GLwDrawingArea.pod < prev    next >
Text File  |  1995-06-08  |  25KB  |  560 lines

  1. =head1 NAME
  2.  
  3. GLwDrawingArea, GLwMDrawingArea - Open GL drawing widgets.
  4.  
  5.  
  6. =head1 SYNOPSIS
  7.  
  8.   #include <GL/GLwDrawA.h>
  9.   widget = XtCreateWidget(widget, glwDrawingAreaWidgetClass, ...);
  10.   ld ... -lGLw -l<anywidgetlibrary> -lXt -lGL -lX11 ...
  11.  
  12.   #include <GL/GLwMDrawA.h>
  13.   widget = XtCreateWidget(widget, glwMDrawingAreaWidgetClass, ...);
  14.   ld ... -lGLw -lXm -lXt -lGL -lX11 ...
  15.  
  16. =head1 DESCRIPTION
  17.  
  18. I<GLwDrawingArea> and I<GLwMDrawingArea> are widgets suitable for Open GL
  19. drawing.  They provide a window with the appropriate visual and
  20. colormaps needed for open GL, based on supplied parameters.
  21. I<GLwDrawingArea> and I<GLwMDrawingArea> also provide callbacks for redraw,
  22. resize, input, and initialization.
  23.  
  24. I<GLwDrawingArea> is not a part of any widget set, but depends only on
  25. Xt.  I<GLwDrawingArea> can be used with any widget set.  I<GLwMDrawingArea>
  26. is identical to I<GLwDrawingArea> except that it is a subclass of the
  27. Motif widget class I<XmPrimitive> and has resources and defaults suitable
  28. for use with Motif.  For example, I<GLwMDrawingArea> provides the default
  29. Motif background and foreground colors for resources, and deals better
  30. with keyboard traversal.  Although the I<GLwDrawingArea> widget can be
  31. used in a Motif program, it is recommended that I<GLwMDrawingArea> be
  32. used instead.
  33.  
  34. Since both I<GLwDrawingArea> and I<GLwMDrawingArea> widgets behave almost
  35. identically, the remainder of this manual page will refer only to
  36. I<GLwDrawingArea>, except when the behaviors differ.  Unless explicitly
  37. stated, all statements about I<GLwDrawingArea> also apply to
  38. I<GLwMDrawingArea>.
  39.  
  40. Among the information provided when creating a I<GLwDrawingArea> is
  41. information necessary to determine the visual.  This may be provided
  42. in three ways, all of them through resources.  A specific visualInfo
  43. structure may be passed in.  (This visualInfo must have been obtained
  44. elsewhere; it is the application designer's responsibility to make
  45. sure that it is compatible with the open GL rendering done by the
  46. application).  Alternatively, an attribute list may be provided.  This
  47. attribute list is formatted identically to that used for direct open
  48. GL programming. Finally, each attribute can be specified as an
  49. individual resource. The latter method is the simplest, and is the
  50. only method that works from resource files.
  51.  
  52. In addition to allocating the visual, the I<GLwDrawingArea> will also
  53. allocate the colormap unless one is provided by the application.  (If
  54. one is provided it is the application writer's responsibility to
  55. guarantee compatibility between the colormap and the visual).  If an
  56. application creates multiple I<GLwDrawingAreas> are created in the same
  57. visual, the same colormap will be used.  (However the colormap will
  58. not be shared among separate applications).
  59.  
  60. Creating the widget does not actually create the window until it is
  61. realized, and consequently, the application should not perform any
  62. open GL operations to the window immediately after creation.  Instead
  63. the application must wait until after it has realized the
  64. window. Alternatively, the ginit callback may be used to indicate when
  65. the window has been created.  Upon receiving this callback, the
  66. application can perform all open GL initialization for the window, and
  67. can subsequently perform other operations on it.  The initialization
  68. is discussed in more detail below.
  69.  
  70. Applications select which I<GLwDrawingArea> they are accessing using
  71. either I<glXMakeCurrent> or the convenience function
  72. I<GLwDrawingAreaMakeCurrent> which uses a widget instead of a display and
  73. window.  If there is only one I<GLwDrawingArea> this need only be called
  74. once, however if there is more than one I<GLwDrawingArea> it should be
  75. called at the start of each callback.  Callbacks in this case include
  76. not only callbacks provided by the widget itself, but any other
  77. callback that leads to GL activity such as a timeout or a workproc.
  78.  
  79. If an application is using double buffering, it may call
  80. I<GLwDrawingAreaSwapBuffers> instead of I<glXSwapBuffers>. This allows the
  81. use of the widget instead of the display and window.
  82.  
  83. =head2 GLwDrawingArea Classes
  84.  
  85. I<GLwDrawingArea> inherits behavior and resources from the Core class.
  86. The class pointer is I<GLwDrawingAreaClass>.  The class name is
  87. I<GLwDrawingArea>.
  88.  
  89. =head2 GLwMDrawingArea  Classes
  90.  
  91. I<GLwMDrawingArea> inherits behavior and resources from the I<XmPrimitive>
  92. and Core classes.  The class pointer is I<GLwMDrawingAreaClass>.  The
  93. class name is I<GLwMDrawingArea>.
  94.  
  95.  
  96. =head2 New Resources
  97.  
  98. The following tables define a set of widget resources used by the
  99. programmer to specify data.  The programmer can also set the resource
  100. values for the inherited classes to set attributes for this widget.
  101. To reference a resource by name or by class in a .Xdefaults file,
  102. remove the I<GLwN> or I<GLwC> prefix and use the remaining letters.  There
  103. are two tables included.  The first table includes resources that
  104. correspond directly to the attributes used by I<glXChooseVisual>.  As
  105. with I<glXChooseVisual>, all Boolean resources default to FALSE and all
  106. integer resources default to 0.  These resources can all be set only
  107. at creation time, and are used to determine the visual.  If either the
  108. I<GLwNattribList> or I<GLwNvisualInfo> resource is set, these resources are
  109. ignored.  The specific meaning of these resources is discussed in the
  110. I<glXChooseVisual> manual page and will not be discussed here.
  111.  
  112.   ___________________________________________________________________________
  113.   |                    |                    |         |                      |
  114.   | Name               | Class              | Type    | OpenGL attribute     |
  115.   |____________________|____________________|_________|______________________|
  116.   |                    |                    |         |                      |
  117.   | GLwNbufferSize     | GLwCBufferSize     | int     | GLX_BUFFER_SIZE      |
  118.   |____________________|____________________|_________|______________________|
  119.   |                    |                    |         |                      |
  120.   | GLwNlevel          | GLwCLevel          | int     | GLX_LEVEL            |
  121.   |____________________|____________________|_________|______________________|
  122.   |                    |                    |         |                      |
  123.   | GLwNrgba           | GLwCRgba           | Boolean | GLX_RGBA             |
  124.   |____________________|____________________|_________|______________________|
  125.   |                    |                    |         |                      |
  126.   | GLwdoublebuffer    | GLwCDoublebuffer   | Boolean | GLX_DOUBLEBUFFER     |
  127.   |____________________|____________________|_________|______________________|
  128.   |                    |                    |         |                      |
  129.   | GLwNstereo         | GLwCStereo         | Boolean | GLX_STEREO           |
  130.   |____________________|____________________|_________|______________________|
  131.   |                    |                    |         |                      |
  132.   | GLwNauxBuffers     | GLwCAuxBuffers     | Boolean | GLX_AUX_BUFFERS      |
  133.   |____________________|____________________|_________|______________________|
  134.   |                    |                    |         |                      |
  135.   | GLwNredSize        | GLwCColorSize      | int     | GLX_RED_SIZE         |
  136.   |____________________|____________________|_________|______________________|
  137.   |                    |                    |         |                      |
  138.   | GLwNgreenSize      | GLwCColorSize      | int     | GLX_GREEN_SIZE       |
  139.   |____________________|____________________|_________|______________________|
  140.   |                    |                    |         |                      |
  141.   | GLwNblueSize       | GLwCColorSize      | int     | GLX_BLUE_SIZE        |
  142.   |____________________|____________________|_________|______________________|
  143.   |                    |                    |         |                      |
  144.   | GLwNalphaSize      | GLwCAlphaSize      | int     | GLX_ALPHA_SIZE       |
  145.   |____________________|____________________|_________|______________________|
  146.   |                    |                    |         |                      |
  147.   | GLwNDepthSize      | GLwCDepthSize      | int     | GLX_DEPTH_SIZE       |
  148.   |____________________|____________________|_________|______________________|
  149.   |                    |                    |         |                      |
  150.   | GLwNStencilSize    | GLwCStencilSize    | int     | GLX_STENCIL_SIZE     |
  151.   |____________________|____________________|_________|______________________|
  152.   |                    |                    |         |                      |
  153.   | GLwNaccumRedSize   | GLwCAccumColorSize | int     | GLX_ACCUM_RED_SIZE   |
  154.   |____________________|____________________|_________|______________________|
  155.   |                    |                    |         |                      |
  156.   | GLwNaccumGreenSize | GLwCAccumColorSize | int     | GLX_ACCUM_GREEN_SIZE |
  157.   |____________________|____________________|_________|______________________|
  158.   |                    |                    |         |                      |
  159.   | GLwNaccumBlueSize  | GLwCAccumColorSize | int     | GLX_ACCUM_BLUE_SIZE  |
  160.   |____________________|____________________|_________|______________________|
  161.   |                    |                    |         |                      |
  162.   | GLwNaccumAlphaSize | GLwCAccumAlphaSize | int     | GLX_ACCUM_ALPHA_SIZE |
  163.   |____________________|____________________|_________|______________________|
  164.  
  165.  
  166. The following table lists other resources of the I<GLwDrawingArea>
  167. widget.  each of these will be described subsequently The codes in the
  168. access column indicate if the given resource can be set at creation
  169. time (C), set by using I<XtSetValues> (S), retrieved by using I<XtGetValues>
  170. (G), or is not applicable (N/A).
  171.  
  172.   ______________________________________________________________________________________
  173.   |                         |                       |                |         |        |
  174.   | Name                    | Class                 | Type           | Default | Access |
  175.   |_________________________|_______________________|________________|_________|________|
  176.   |                         |                       |                |         |        |
  177.   | GLwNallocateBackground  | GLwCAllocateColors    | Boolean        | FALSE   | CG     |
  178.   |_________________________|_______________________|________________|_________|________|
  179.   |                         |                       |                |         |        |
  180.   | GLwNallocateOtherColors | GLwCAllocateColors    | Boolean        | FALSE   | CG     |
  181.   |_________________________|_______________________|________________|_________|________|
  182.   |                         |                       |                |         |        |
  183.   | GLwNattribList          | GLwCAttribList        | int *          | NULL    | CG     |
  184.   |_________________________|_______________________|________________|_________|________|
  185.   |                         |                       |                |         |        |
  186.   | GLwNexposeCallback      | GLwCCallback          | XtCallbackList | NULL    | C      |
  187.   |_________________________|_______________________|________________|_________|________|
  188.   |                         |                       |                |         |        |
  189.   | GLwNginitCallback       | GLwCCallback          | XtCallbackList | NULL    | C      |
  190.   |_________________________|_______________________|________________|_________|________|
  191.   |                         |                       |                |         |        |
  192.   | GLwNinputCallback       | GLwCCallback          | XtCallbackList | NULL    | C      |
  193.   |_________________________|_______________________|________________|_________|________|
  194.   |                         |                       |                |         |        |
  195.   | GLwNinstallBackground   | GLwCInstallBackground | Boolean        | TRUE    | CG     |
  196.   |_________________________|_______________________|________________|_________|________|
  197.   |                         |                       |                |         |        |
  198.   | GLwNinstallColormap     | GLwCInstallColormap   | Boolean        | TRUE    | CG     |
  199.   |_________________________|_______________________|________________|_________|________|
  200.   |                         |                       |                |         |        |
  201.   | GLwNresizeCallback      | GLwCCallback          | XtCallbackList | NULL    | C      |
  202.   |_________________________|_______________________|________________|_________|________|
  203.   |                         |                       |                |         |        |
  204.   | GLwNvisualInfo          | GLwCVisualInfo        | XVisualInfo*   | NULL    | CG     |
  205.   |_________________________|_______________________|________________|_________|________|
  206.  
  207.  
  208. =over 4
  209.  
  210. =item GLwNallocateBackground
  211.  
  212. B<[Caveat: This resource is not honored yet.]>
  213.  
  214. If TRUE, the background pixel and pixmap will be allocated if
  215. appropriate using the newly calculated colormap and visual.  If FALSE,
  216. they will retain values calculated using the parent's colormap and
  217. visual.  Applications which wish to have X clear their background for
  218. them will usually set this to TRUE.  Applications clearing their own
  219. background will often set this to FALSE, although they may set this to
  220. TRUE if they query the background for their own use. One reason to
  221. leave this resource FALSE is that if color index mode is in use this
  222. avoid using up a pixel from the newly allocated colormap.  Also, on
  223. hardware that supports only one colormap, the application may need to
  224. do more careful color allocation to avoid flashing between the openGL
  225. colormap and the default X colormap.  (Note that because of the way Xt
  226. works, the background colors are originally calculated using the
  227. default colormap; if this resource is set they can be recalculated
  228. correctly. If a colormap was explicitly supplied to the widget rather
  229. than being dynamically calculated, these resources are always
  230. calculated using that colormap.)
  231.  
  232. =item GLwNallocateOtherColors
  233.  
  234. B<[Caveat: This resource is not honored yet.]>
  235.  
  236. This is similar to I<GLwNallocateBackground>, but allocates other colors
  237. normally allocated by widgets.  Although the I<GLwDrawingArea> and
  238. I<GLwMDrawingArea> widget do not make use of these colors the application
  239. may choose to query them.  For the non-Motif I<GLwDrawingArea> widget
  240. there are no other colors allocated, so this resource is a no-op.  For
  241. the Motif I<GLwMDrawingArea> are widget, the I<XmPrimitive> resources
  242. I<XmNforeground>, I<XmNhighlightColor>, and I<XmNhighlightPixmap> are
  243. calculated.
  244.  
  245. =item GLwNattribList
  246.  
  247. Contains the list of attributes suitable for a call to
  248. I<glXChooseVisual>.  If this resource is NULL, it is calculated based on
  249. the attribute resources.  If it is not NULL, the attribute resources
  250. are ignored.
  251.  
  252. =item GLwNexposeCallback
  253.  
  254. Specifies the list of callbacks that is called when the widget
  255. receives an exposure event.  The callback reason is I<GLwCR_EXPOSE>.  The
  256. callback structure also includes the exposure event.  The application
  257. will generally want to redraw the scene.
  258.  
  259. =item GLwNginitCallback
  260.  
  261. Specifies the list of callbacks that is called when the widget is
  262. first realized.  Since no open GL operations can be done before the
  263. widget is realized, this callback can be used to perform any
  264. appropriate open GL initialization such as creating a context.  The
  265. callback reason is I<GLwCR_GINIT>.
  266.  
  267. =item GLwNinputCallback
  268.  
  269. Specifies the list of callbacks that is called when the widget
  270. receives a keyboard or mouse event.  By default, the input callback is
  271. called on each key press and key release, on each mouse button press
  272. and release, and whenever the mouse is moved while a button is
  273. pressed.  However this can be changed by providing a different
  274. translation table. The callback structure also includes the input
  275. event.  The callback reason is I<GLwCR_INPUT>.
  276.  
  277. The input callback is provided as a programming convenience, as it
  278. provides a convenient way to catch all input events.  However, a more
  279. modular program can often be obtained by providing specific actions
  280. and translations in the application rather than using a single catch
  281. all callback.  Use of explicit translations can also provide for more
  282. customizability.
  283.  
  284. =item GLwNinstallBackground
  285.  
  286. B<[Caveat: This resource is not honored yet.]>
  287.  
  288. If set to TRUE, the background is installed on the window. If set to
  289. FALSE, the window has no background.  This resource has no effect
  290. unless I<GLwNallocateBackground> is also TRUE.
  291.  
  292. =item GLwNinstallColormap
  293.  
  294. If set to TRUE, the widget will call I<XSetWMColormapWindows> to tell the
  295. window manager to install the colormap when the window's shell has
  296. focus.  If set to FALSE, this will not be called.  For applications
  297. with multiple I<GLwDrawingAreas> sharing a single colormap, it is most
  298. efficient to set this resource to TRUE for exactly one I<GLwDrawingArea>
  299. with each colormap.  If an application needs additional control over
  300. the order of colormaps, this resource can be set to FALSE, with the
  301. application calling I<XSetWMColormapWindows> explicitly.
  302.  
  303. =item GLwNresizeCallback
  304.  
  305. Specifies the list of callbacks that is called when the I<GLwDrawingArea>
  306. is resized.  The callback reason is I<GLwCR_RESIZE>.
  307.  
  308. =item GLwNvisualInfo
  309.  
  310. Contains a pointer to the window's visual info structure.  If NULL,
  311. the visualInfo is calculated at widget creation time based on the
  312. I<GLwNattributeList> resource (which is itself calculated from the
  313. various resources).  If I<GLwNvisualInfo> is not NULL the
  314. I<GLwNattributList> and the attribute resources are ignored.
  315.  
  316. =back
  317.  
  318. =head2 Inherited Resources
  319.  
  320. B<[Caveat: The colormap and background resources do not receive special
  321. treatment yet.]>
  322.  
  323. Both I<GLwDrawingArea> and I<GLwMDrawingArea> inherit behavior and resources
  324. from the core superclass. Other than the behavior of the colormap and
  325. background resources described previously, all defaults are the same
  326. as for core.
  327.  
  328. In addition, the Motif version I<GLwMDrawingArea> also inherits from
  329. I<XmPrimitive>.  The behavior of the color resources has been described
  330. previously.  The TraversalOn resource is disabled for this widget, but
  331. if keyboard input is required it should be enabled.  (Also, the
  332. application should call C<XmProcessTraversal(widget, XmTRAVERSE_CURRENT)>
  333. whenever mouse button 1 is clicked in the widget.  This is similar to
  334. the requirements of the Motif Drawing area.) Because Motif gets
  335. confused by having multiple visuals in one top level shell,
  336. I<XmNhighlightOnEnter> has been disabled, and I<XmNhighlightThickness> has
  337. been set to 0.
  338.  
  339. =head2 Callback Information
  340.  
  341. A pointer to the following structure is passed to each callback:
  342.  
  343.   typedef struct
  344.   {
  345.     int      reason;
  346.     XEvent   * event;
  347.     Dimensionwidth, height;
  348.   } GLwDrawingAreaCallbackStruct;
  349.  
  350. =over 4
  351.  
  352. =item reason
  353.  
  354. Indicates why the callback was invoked.  Appropriate values are stated
  355. in the above resource descriptions.  For Motif programmers, the values
  356. I<GLwCR_EXPOSE>, I<GLwCR_RESIZE>, and I<GLwCR_INPUT> are equal to I<XmCR_EXPOSE>,
  357. I<XmCR_RESIZE>, and I<XmCR_INPUT> respectively.  I<GLwCR_GINIT> does not have a
  358. Motif equivalent.
  359.  
  360. =item event
  361.  
  362. Points to the XEvent that triggered the callback.
  363. This is NULL for I<GLwNginitCallback> and
  364. I<GLwNresizeCallback>.
  365.  
  366. =item width
  367.  
  368. =item height
  369.  
  370. Are set to the width and height of the window.
  371.  
  372. =back
  373.  
  374. =head2 Translations
  375.  
  376. I<GLwDrawingArea> has the translations listed below.
  377.  
  378.   <KeyDown>:     glwInput()
  379.   <KeyUp>:       glwInput()
  380.   <BtnDown>:     glwInput()
  381.   <BtnUp>:       glwInput()
  382.   <BtnMotion>:   glwInput()
  383.  
  384. I<GLwMDrawingArea> has the following additional translation:
  385.  
  386.   <Key>osfHelp:  PrimitiveHelp()
  387.  
  388. An application wishing to catch other events than these defaults can
  389. do so by installing a different translation table.
  390.  
  391. =head2 Action Routines
  392.  
  393. The I<GLwDrawingArea> has the following action routine:
  394.  
  395. =over 4
  396.  
  397. =item glwInput()
  398.  
  399. Called whenever one of the above translations specifies that input has
  400. occurred.  Its sole purpose is to call the input callback.
  401.  
  402. =back
  403.  
  404. =head1 INITIALIZATION
  405.  
  406. When the widget is initially created (e.g. through I<XtCreateWidget>(3X))
  407. the associated window is not actually created.  Instead, window
  408. creation is delayed until the widget is realized.  However,
  409. I<glXchooseVisual> is called immediately, so information based on its
  410. results is available.
  411.  
  412. Between the time the widget is created and it is realized, the
  413. following apply:
  414.  
  415. =over 4
  416.  
  417. =item
  418.  
  419. No open GL operations can be done to the window
  420.  
  421. =item
  422.  
  423. No resize callbacks are generated.
  424.  
  425. =item
  426.  
  427. The normal window is available (I<XtWindow> returns NULL).
  428.  
  429. =item
  430.  
  431. I<GLwDrawingAreaMakeCurrent> (and I<glXMakeCurrent>) should not be called.
  432.  
  433. =back
  434.  
  435. When the widget is realized, the following actions take place:
  436.  
  437. =over 4
  438.  
  439. =item
  440.  
  441. The window is created.
  442.  
  443. =item
  444.  
  445. The ginit callback is called.  The user may use this callback to
  446. perform any needed open GL initialization to the window.
  447.  
  448. =back
  449.  
  450. =head1 NOTES
  451.  
  452. When using the input callback to receive keyboard input, the keycode
  453. in the event must be converted to a KeySym.  Use I<XLookupKeysym>(3X) or
  454. I<XLookupString>(3X) to do the conversion.  Keyboard input can also be
  455. dealt using translations, in which case no such conversion is
  456. required.
  457.  
  458. Motif programmers should keep in mind that OSF uses virtual bindings
  459. and replaces some of the key bindings.  As a common example, if the
  460. ESC key is to be used to exit the program (as it often is in GL
  461. programs), the translation should specify <key>osfCancel instead of
  462. <key>Escape.
  463.  
  464. Motif programmers may also create a I<GLwMDrawingArea> widget with the
  465. Motif style I<GLwCreateMDrawingArea>.
  466.  
  467. =head1 EXAMPLE
  468.  
  469. Here are some   code fragments that create a I<GLwDrawingArea>
  470. widget, and manage the appropriate callbacks.
  471.  
  472.  
  473.    #include <X11/GLW/GLwDrawingArea.h>
  474.    static GLXContext glx_context;  /* assume only one context */
  475.    . . .
  476.  
  477.    main()
  478.    {
  479.        Arg args[10];
  480.        int n;
  481.        Widget parent;/* The parent of the gl widget */
  482.        Widget glw;/* The GLwDrawingArea widget          */
  483.        . . .
  484.  
  485.        /* Create the widget using RGB mode.  This can also be set
  486.         * in an X Defaults file
  487.         */
  488.        n = 0;
  489.        XtSetArg(args[n], GLwNrgba, TRUE); n++;
  490.        glw = XtCreateManagedWidget("glw", GLwDrawingAreaWidgetClass,
  491.                   parent, args, n);
  492.        XtAddCallback(glw, GLwNexposeCallback, exposeCB, 0);
  493.        XtAddCallback(glw, GLwNresizeCallback, resizeCB, 0);
  494.        XtAddCallback(glw, GLwNginitCallback, ginitCB, 0);
  495.        /* Also add input callback if needed */
  496.        . . .
  497.    }
  498.  
  499.    static void
  500.    exposeCB(Widget w, XtPointer client_data,
  501.              GLwDrawingAreaCallbackStruct call_data)
  502.    {
  503.        GLwDrawingAreaMakeCurrent (w, glx_context);
  504.        /* redraw the display */
  505.    }
  506.  
  507.    static void
  508.    resizeCB(Widget w, XtPointer client_data,
  509.              GLwDrawingAreaCallbackStruct call_data)
  510.    {
  511.        GLwDrawingAreaMakeCurrent (w, glx_context);
  512.        /* perform any resize actions */
  513.    }
  514.  
  515.    static void
  516.    ginitCB(Widget w, XtPointer client_data,
  517.              GLwDrawingAreaCallbackStruct call_data)
  518.    {
  519.        Arg args[1];
  520.        XVisualInfo *vi;
  521.  
  522.        XtSetArg(args[0], GLwNvisualInfo, &vi);
  523.        XtGetValues(w, args, 1);
  524.  
  525.        /* create a visual context */
  526.        glx_context = glXCreateContext(XtDisplay(w), vi, 0, GL_FALSE);
  527.        GLwDrawingAreaMakeCurrent (w, glx_context);
  528.        /* Perform any necessary graphics initialization.*/
  529.    }
  530.  
  531.  
  532. The Motif program need only differ by including GLwMDrawingArea.h
  533. instead of GLwDrawingArea.h and by creating a widget of type
  534. I<GLwMDrawingAreaWidgetClass> instead of I<GLwDrawingAreaWidgetClass>.  As
  535. an alternative, the Motif program could use I<GLwCreateMDraw>(3X)
  536. instead.
  537.  
  538. =head1 WARNINGS
  539.  
  540. If a I<GLwDrawingArea> widget is created as a child of an already
  541. realized widget, the I<GLwDrawingArea> widget will be created
  542. immediately, without giving the user an opportunity to add the ginit
  543. callback.  In such a case, initialization should be done immediately
  544. after creating the widget rather than by using the callback.
  545.  
  546. If the non-Motif I<GLwDrawingArea> widget is used in a Motif program and
  547. keyboard traversal is attempted, the behavior is undefined if the user
  548. traverses into the I<GLwDrawingArea> widget.
  549.  
  550. =head1 RELATED INFORMATION
  551.  
  552. L<glXChooseVisual>, L<GLwDrawingAreaMakeCurrent>, L<glXMakeCurrent>,
  553. L<GLwDrawingAreaSwapBuffers>, L<GLwCreateMDraw>, L<Core>,
  554. L<XmPrimitive>, L<VirtualBindings>, L<Gflush>),
  555. L<XSetWMColormapWindows> and the Open GL spec.
  556.  
  557. =head1 DATE
  558.  
  559. $Id: GLwDrawingArea.pod,v 1.3 1995/04/11 23:42:06 ohl Exp $
  560.