GLWindow.h
Go to the documentation of this file.
00001 
00009 #ifndef _GL_WINDOW_
00010 #define _GL_WINDOW_
00011 
00012 
00013 #include <blort/GLWindow/GLEvent.h>
00014 
00015 #ifdef WIN32
00016 #include <windows.h>
00017 #include <gl/glew.h>
00018 #include <gl/gl.h>
00019 #endif
00020 
00021 #ifdef LINUX
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include <unistd.h>
00025 #include <X11/Xlib.h>
00026 #include <X11/Xutil.h>
00027 #include <GL/gl.h>
00028 #include <GL/glx.h>
00029 #endif
00030 
00032 namespace blortGLWindow{
00033 
00034 #ifdef WIN32
00035 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00036 #endif
00037 
00039 class GLWindow{
00040 
00041 public:
00047   GLWindow();
00048   GLWindow(unsigned int width, unsigned int height);
00049   GLWindow(unsigned int width, unsigned int height, const char* name, bool visible = true);
00050   ~GLWindow();
00051 
00053   void Activate();
00054 
00056   void Update();
00057 
00061   bool GetEvent(Event &event);
00062 
00063 #ifdef WIN32
00064   HWND gethWnd() const {return hWnd;}
00065 #endif
00066 
00067 protected:
00068 #ifdef WIN32
00069         WNDCLASS                wc;
00070         HWND                    hWnd;
00071         HDC                     hDC;
00072         HGLRC                   hRC;
00073         MSG                     msg;
00074 #endif
00075 
00076 #ifdef LINUX
00077   Display                 *dpy;
00078   Window                  root;
00079   XVisualInfo                           *vi;
00080   Colormap                                      cmap;
00081   XSetWindowAttributes          swa;
00082   Window                                        glWin;
00083   Window                                        btWin;
00084   Atom                                          wmDelete;
00085   GLXContext                            glc;
00086   XWindowAttributes             gwa;
00087 #endif
00088 
00089   void init(unsigned int width, unsigned int height, const char* name, bool visible = true);
00090   void quit();
00091   
00092 };
00093 
00094 } /* namespace */
00095 
00096 #endif /* _GL_WINDOW_ */


blort
Author(s): Michael Zillich, Thomas Mörwald, Johann Prankl, Andreas Richtsfeld, Bence Magyar (ROS version)
autogenerated on Thu Jan 2 2014 11:38:25