home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / GLX / DBglxwidgetOpenGL / GlxDrawP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.7 KB  |  137 lines

  1. /*
  2.  *    These files are for informational purposes and can demonstrate how
  3.  *   to write your own mixed-mode GL-based widgets.  However SGI does not
  4.  *   guarantee that this source code absolutely matches the GLxDraw
  5.  *   widget that is shipped as part of the system.
  6.  */
  7.  
  8. /***********************************************************
  9.  
  10. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  11. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  12.  
  13.                         All Rights Reserved
  14.  
  15. Permission to use, copy, modify, and distribute this software and its 
  16. documentation for any purpose and without fee is hereby granted, 
  17. provided that the above copyright notice appear in all copies and that
  18. both that copyright notice and this permission notice appear in 
  19. supporting documentation, and that the names of Digital or MIT not be
  20. used in advertising or publicity pertaining to distribution of the
  21. software without specific, written prior permission.  
  22.  
  23. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  24. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  25. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  26. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  27. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  28. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  29. SOFTWARE.
  30.  
  31. ******************************************************************/
  32.  
  33. #ifndef _GlxDrawP_h
  34. #define _GlxDrawP_h
  35.  
  36. #ifdef __GLX_MOTIF
  37. #include "GlxMDraw.h"
  38. #else
  39. #include "GlxDraw.h"
  40. #endif
  41.  
  42. typedef struct _GlxDrawClassPart
  43. {
  44.     caddr_t extension;
  45. } GlxDrawClassPart;
  46.  
  47. #ifdef __GLX_MOTIF
  48. typedef struct _GlxMDrawClassRec {
  49.     CoreClassPart        core_class;
  50.     XmPrimitiveClassPart    primitive_class;
  51.     GlxDrawClassPart        glxDraw_class;
  52. } GlxMDrawClassRec;
  53.  
  54. extern GlxMDrawClassRec glxMDrawClassRec;
  55.  
  56. #else /* not __GLX_MOTIF */
  57.  
  58. typedef struct _GlxDrawClassRec {
  59.     CoreClassPart    core_class;
  60.     GlxDrawClassPart    glxDraw_class;
  61. } GlxDrawClassRec;
  62.  
  63. extern GlxDrawClassRec glxDrawClassRec;
  64. #endif /* __GLX_MOTIF */
  65.  
  66. typedef struct {
  67.     Boolean        exists;
  68.     Window        window;
  69.     Colormap        colormap;
  70.     int            depth;
  71.     XVisualInfo *    visualInfo;
  72.     XtCallbackList    expose_callback;
  73. #ifndef USE_GL
  74.     GLXContext        context;
  75.     int                 *config;
  76. #endif
  77. } GlxDrawWindowInfo;
  78.  
  79. typedef struct {
  80.         GlxDrawWindowInfo    info;
  81. #ifdef USE_GL
  82.         GLXconfig        *config;
  83. #else
  84.         int                     *config;
  85. #endif /* USE_GL */
  86.         GlxDrawWindowInfo    overlay_info;
  87.         GlxDrawWindowInfo    underlay_info;
  88.         GlxDrawWindowInfo    popup_info;
  89. }GlxDrawBuffer;
  90.  
  91. typedef struct {
  92.     /* resources */
  93. #ifdef USE_GL
  94.     GLXconfig        *config;
  95. #else
  96.     int            *config;
  97.     GLXContext        context;
  98. #endif /* USE_GL */
  99.     XVisualInfo        *visualInfo;
  100.     Boolean        override_colormap;
  101.     Colormap        alt_colormap;
  102.     XtCallbackList    ginit_callback;
  103.     XtCallbackList    resize_callback;
  104.     XtCallbackList    expose_callback;
  105.     XtCallbackList    input_callback;
  106.     GlxDrawWindowInfo    overlay_info;
  107.     GlxDrawWindowInfo    underlay_info;
  108.     GlxDrawWindowInfo    popup_info;
  109.  
  110.     Boolean        provide_Sbuffer;
  111.     Boolean        provide_StereoBuffer;
  112.     Boolean        single_buffer;
  113.     Boolean        single_buffer_default;
  114.     Boolean        stereo_buffer;
  115.     Boolean        stereo_buffer_default;
  116.     Boolean        isRGB;
  117.     GlxDrawBuffer    dbl_buf; 
  118.     GlxDrawBuffer    sgl_buf;
  119.     GlxDrawWindowInfo    *cur_info;
  120.     Window        mainWindow;
  121. } GlxDrawPart;
  122.  
  123. #ifdef __GLX_MOTIF
  124. typedef struct _GlxMDrawRec {
  125.     CorePart        core;
  126.     XmPrimitivePart    primitive;
  127.     GlxDrawPart        glxDraw;
  128. } GlxMDrawRec;
  129. #else /* not __GLX_MOTIF */
  130. typedef struct _GlxDrawRec {
  131.     CorePart    core;
  132.     GlxDrawPart    glxDraw;
  133. } GlxDrawRec;
  134. #endif /* __GLX_MOTIF */
  135.  
  136. #endif /* _GlxDrawP_h */
  137.