]> git.sesse.net Git - ccbs/blobdiff - bigscreen/glwindow.h
Add the bigscreen/ directory (a bit overdue?)
[ccbs] / bigscreen / glwindow.h
diff --git a/bigscreen/glwindow.h b/bigscreen/glwindow.h
new file mode 100644 (file)
index 0000000..a2a8e32
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef _GLWINDOW_H
+#define _GLWINDOW_H
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#ifdef __linux__
+#include <GL/glx.h>
+#include <X11/extensions/xf86vmode.h>
+#include <X11/keysym.h>
+#endif
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+class GLWindow {
+public:
+       GLWindow(char *title, int width, int height, int bpp, bool fullscreen, int zbuffer, int visual_id);
+       ~GLWindow();
+       void resize(int x, int y, int w, int h);
+       void flip();
+       bool is_done();
+
+       friend class DemoHandler;
+       friend class DirectSoundAudioDriver;
+       
+protected:
+#ifdef WIN32
+       HDC hDC;
+       HGLRC hRC;
+       HWND hWnd;
+       HINSTANCE hInstance;
+#endif
+#ifdef __linux__
+       Display *dpy;
+       int screen;
+       Window win;
+       GLXContext ctx;
+       XSetWindowAttributes attr;
+       Bool fs;
+       XF86VidModeModeInfo deskMode;
+#endif                                             
+       
+       char *title;
+       bool fullscreen;
+       int x, y;
+       unsigned int width, height;
+       unsigned int bpp;
+       int zbuffer;
+       bool done;
+       void initGL();
+};
+
+#endif