9 #include "msdevstudio/MSconfig.h"
21 ,XVisualInfo* aVisualInfo
22 ,GLXContext aGLXContext
24 :m_display( aDisplay )
25 ,m_colormap(aColormap)
35 std::string title =
"OpenGLWindow";
39 unsigned int width = 600;
40 unsigned int height = 600;
42 XSetWindowAttributes swa;
47 swa.border_pixel = 0L;
48 swa.event_mask = StructureNotifyMask | ExposureMask | ButtonPressMask;
56 CWBorderPixel|CWColormap|CWEventMask,
59 std::cout <<
"Can't create an X window." << std::endl;
65 char* sl = (
char*)title.c_str();
66 XStringListToTextProperty (&sl, 1, &tp);
68 sh.flags = USPosition | USSize;
97 std::cout <<
"glXMakeCurrent failed." << std::endl;
99 glViewport (0,0,aWidth,aHeight);
100 glScissor (0,0,aWidth,aHeight);
109 glEnable (GL_LINE_STIPPLE);
110 glEnable (GL_DEPTH_TEST);
111 glEnable (GL_SCISSOR_TEST);
112 glShadeModel (GL_FLAT);
115 glClearColor (1,1,1,1);
116 glClear (GL_COLOR_BUFFER_BIT);
117 glClear (GL_DEPTH_BUFFER_BIT);
119 glMatrixMode (GL_PROJECTION);
122 glMatrixMode (GL_MODELVIEW);