source: branches/port5/GL/glAW/GLwDrawA.h

Last change on this file was 5868, checked in by westram, 16 years ago
  • separated openGL parts from WINDOW library (it's nonsense to link openGL into all applications when only one application actually uses openGL)
    • created GL/glWINDOW library (extending normal WINDOW library) and moved relevant code there
    • created an interface header for applications needing access to Motif/X11 internals (aw_window_Xm_interface.hxx)
    • RNA3D uses that interface header (instead of hardcoded links into ../WINDOW)
    • AW_variable_update_struct went local (AW_button.cxx)
    • some functions exported (aw_create_help_entry, aw_create_shell, aw_realize_widget). Needed by libglWINDOW
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.6 KB
Line 
1/*
2 * (c) Copyright 1993, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 * Permission to use, copy, modify, and distribute this software for
5 * any purpose and without fee is hereby granted, provided that the above
6 * copyright notice appear in all copies and that both the copyright notice
7 * and this permission notice appear in supporting documentation, and that
8 * the name of Silicon Graphics, Inc. not be used in advertising
9 * or publicity pertaining to distribution of the software without specific,
10 * written prior permission.
11 *
12 * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
13 * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
14 * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
15 * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
16 * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
17 * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
18 * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
19 * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
20 * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
21 * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
23 * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
24 *
25 *
26 * US Government Users Restricted Rights
27 * Use, duplication, or disclosure by the Government is subject to
28 * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
29 * (c)(1)(ii) of the Rights in Technical Data and Computer Software
30 * clause at DFARS 252.227-7013 and/or in similar or successor
31 * clauses in the FAR or the DOD or NASA FAR Supplement.
32 * Unpublished-- rights reserved under the copyright laws of the
33 * United States.  Contractor/manufacturer is Silicon Graphics,
34 * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
35 *
36 * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
37 */
38#ifndef _GLwDrawA_h
39#define _GLwDrawA_h
40
41// #include <GL/glxew.h>
42#include <GL/glx.h>
43#include <GL/gl.h>
44
45/****************************************************************
46 *
47 * GLwDrawingArea widgets
48 *
49 ****************************************************************/
50
51/* Resources:
52
53Name                Class              RepType         Default Value
54----                -----              -------         -------------
55attribList          AttribList         int *           NULL
56visualInfo          VisualInfo         VisualInfo      NULL
57installColormap     InstallColormap    Boolean         TRUE
58allocateBackground  AllocateColors     Boolean         FALSE
59allocateOtherColors AllocateColors     Boolean         FALSE
60installBackground   InstallBackground  Boolean         TRUE
61exposeCallback      Callback           Pointer         NULL
62ginitCallback       Callback           Pointer         NULL
63inputCallback       Callback           Pointer         NULL
64resizeCallback      Callback           Pointer         NULL
65
66*** The following resources all correspond to the GLX configuration
67*** attributes and are used to create the attribList if it is NULL
68bufferSize          BufferSize         int             0
69level               Level              int             0
70rgba                Rgba               Boolean         FALSE
71doublebuffer        Doublebuffer       Boolean         FALSE
72stereo              Stereo             Boolean         FALSE
73auxBuffers          AuxBuffers         int             0
74redSize             ColorSize          int             1
75greenSize           ColorSize          int             1
76blueSize            ColorSize          int             1
77alphaSize           AlphaSize          int             0
78depthSize           DepthSize          int             0
79stencilSize         StencilSize        int             0
80accumRedSize        AccumColorSize     int             0
81accumGreenSize      AccumColorSize     int             0
82accumBlueSize       AccumColorSize     int             0
83accumAlphaSize      AccumAlphaSize     int             0
84*/
85
86#define GLwNattribList          "attribList"
87#define GLwCAttribList          "AttribList"
88#define GLwNvisualInfo          "visualInfo"
89#define GLwCVisualInfo          "VisualInfo"
90#define GLwRVisualInfo          "VisualInfo"
91
92#define GLwNinstallColormap     "installColormap"
93#define GLwCInstallColormap     "InstallColormap"
94#define GLwNallocateBackground  "allocateBackground"
95#define GLwNallocateOtherColors "allocateOtherColors"
96#define GLwCAllocateColors      "AllocateColors"
97#define GLwNinstallBackground   "installBackground"
98#define GLwCInstallBackground   "InstallBackground"
99
100#define GLwCCallback            "Callback"
101#define GLwNexposeCallback      "exposeCallback"
102#define GLwNginitCallback       "ginitCallback"
103#define GLwNresizeCallback      "resizeCallback"
104#define GLwNinputCallback       "inputCallback"
105
106#define GLwNbufferSize          "bufferSize"
107#define GLwCBufferSize          "BufferSize"
108#define GLwNlevel               "level"
109#define GLwCLevel               "Level"
110#define GLwNrgba                "rgba"
111#define GLwCRgba                "Rgba"
112#define GLwNdoublebuffer        "doublebuffer"
113#define GLwCDoublebuffer        "Doublebuffer"
114#define GLwNstereo              "stereo"
115#define GLwCStereo              "Stereo"
116#define GLwNauxBuffers          "auxBuffers"
117#define GLwCAuxBuffers          "AuxBuffers"
118#define GLwNredSize             "redSize"
119#define GLwNgreenSize           "greenSize"
120#define GLwNblueSize            "blueSize"
121#define GLwCColorSize           "ColorSize"
122#define GLwNalphaSize           "alphaSize"
123#define GLwCAlphaSize           "AlphaSize"
124#define GLwNdepthSize           "depthSize"
125#define GLwCDepthSize           "DepthSize"
126#define GLwNstencilSize         "stencilSize"
127#define GLwCStencilSize         "StencilSize"
128#define GLwNaccumRedSize        "accumRedSize"
129#define GLwNaccumGreenSize      "accumGreenSize"
130#define GLwNaccumBlueSize       "accumBlueSize"
131#define GLwCAccumColorSize      "AccumColorSize"
132#define GLwNaccumAlphaSize      "accumAlphaSize"
133#define GLwCAccumAlphaSize      "AccumAlphaSize"
134
135#ifdef __GLX_MOTIF
136
137typedef struct _GLwMDrawingAreaClassRec *GLwMDrawingAreaWidgetClass;
138typedef struct _GLwMDrawingAreaRec      *GLwMDrawingAreaWidget;
139
140/** BUG. Extended by Daniel Koitzsch and Christian Becker */
141// #define glwMDrawingAreaWidgetClass glwM1DrawingAreaWidgetClass
142// defining glwMDrawingAreaWidgetClass twice doesn't work
143#define glwMDrawingAreaWidgetClass glwM2DrawingAreaWidgetClass
144/** END OF EXT */
145
146extern WidgetClass glwMDrawingAreaWidgetClass;
147
148
149#else
150
151typedef struct _GLwDrawingAreaClassRec  *GLwDrawingAreaWidgetClass;
152typedef struct _GLwDrawingAreaRec       *GLwDrawingAreaWidget;
153
154extern WidgetClass glwDrawingAreaWidgetClass;
155
156
157#endif
158
159
160/* Callback reasons */
161#ifdef __GLX_MOTIF
162#define GLwCR_EXPOSE    XmCR_EXPOSE
163#define GLwCR_RESIZE    XmCR_RESIZE
164#define GLwCR_INPUT     XmCR_INPUT
165#else
166/* The same values as Motif, but don't use Motif constants */
167#define GLwCR_EXPOSE    38
168#define GLwCR_RESIZE    39
169#define GLwCR_INPUT     40
170#endif
171
172#define GLwCR_GINIT     32135   /* Arbitrary number that should neverr clash */
173
174typedef struct
175{
176    int       reason;
177    XEvent   *event;
178    Dimension width,height;
179} GLwDrawingAreaCallbackStruct;
180
181#if defined(__cplusplus) || defined(c_plusplus)
182extern "C" {
183#endif
184
185    /* front ends to glXMakeCurrent and glXSwapBuffers */
186    extern void GLwDrawingAreaMakeCurrent(Widget w,GLXContext ctx);
187    extern void GLwDrawingAreaSwapBuffers(Widget w);
188
189#ifdef __GLX_MOTIF
190#ifdef _NO_PROTO
191    extern Widget GLwCreateMDrawingArea();
192#else
193    extern Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount);
194#endif
195#endif
196
197#if defined(__cplusplus) || defined(c_plusplus)
198}
199#endif
200
201#endif
Note: See TracBrowser for help on using the repository browser.