1 /**************************************************************************\
2  *
3  *  This file is part of the Coin 3D visualization library.
4  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU General Public License
8  *  ("GPL") version 2 as published by the Free Software Foundation.
9  *  See the file LICENSE.GPL at the root directory of this source
10  *  distribution for additional information about the GNU GPL.
11  *
12  *  For using Coin with software that can not be combined with the GNU
13  *  GPL, and for taking advantage of the additional benefits of our
14  *  support services, please contact Kongsberg Oil & Gas Technologies
15  *  about acquiring a Coin Professional Edition License.
16  *
17  *  See http://www.coin3d.org/ for more information.
18  *
19  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
20  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
21  *
22 \**************************************************************************/
23 
24 #ifndef SOXTGLWIDGETP_H
25 #define SOXTGLWIDGETP_H
26 
27 #include <Inventor/Xt/SoGuiGLWidgetP.h>
28 
29 // ************************************************************************
30 
31 // This class contains private data and methods used within the
32 // SoXtGLWidget class.
33 
34 class SoXtGLWidgetP : public SoGuiGLWidgetP
35 {
36 public:
37   SoXtGLWidgetP(SoXtGLWidget * publ);
38   ~SoXtGLWidgetP();
39 
40   void initNormalContext(void);
41 
42   SbVec2s glsize; // cached GL widget size
43 
44   // FIXME: none of these are really supported, and the initialization
45   // values are probably wrong. 20011012 mortene.
46   int normalcolormapsize;
47   int overlaycolormapsize;
48   unsigned long transparentpixel;
49 
50   SbBool border;
51   int borderwidth;
52 
53   Widget glxwidget;
54   Widget glxmanager;
55   GLXContext normalcontext;
56   XVisualInfo * normalvisual;
57   GLXContext overlaycontext;
58   XVisualInfo * overlayvisual;
59   SbBool doublebuffer;
60   SbBool firstexpose;
61   SbBool quadbuffer;
62   SbBool alphachannel;
63   SbBool stencilbuffer;
64   SbBool accumbuffer;
65   SbBool needrebuild;
66   Colormap colormap;
67 
68   void createVisual(void);
69   void cleanupVisual(void);
70 
71   void buildGLWidget(void);
72   void cleanupGLWidget(void);
73 
74   static void exposeCB(Widget w, XtPointer closure, XtPointer call_data);
75 
76   int buildGLAttrs(int * attrs, int trynum);
77 
78   void buildContext(void);
79   void cleanupContext(void);
80 
81 protected:
82   virtual SbBool isDirectRendering(void);
83 
84 
85 };
86 
87 // ************************************************************************
88 
89 #endif // !SOXTGLWIDGETP_H
90