window.h screen.h vector.h src/mygl.h src/main.h src/VideoPlugin.h src/window.cpp OpenArena::Window OpenArena::Window::Resizer OpenArena::Window::Initializer OpenArena #ifndef__window_h__ #define__window_h__ #include"screen.h" #ifdef__linux #include<GL/gl.h> #include<GL/glx.h> #include<X11/extensions/xf86vmode.h> #include<X11/keysym.h> #endif #ifdef__APPLE__ #include<GL/gl.h> #include<GL/glu.h> #include<GL/glx.h> #include<X11/Xlib.h> #include<X11/Xutil.h> //#include<X11/extensions/xf86vmode.h> #include<X11/keysym.h> #endif #ifdefWIN32 #include<windows.h> #include<GL/gl.h> #include<GL/glu.h> #endif #include"vector.h" namespaceOpenArena { classWindow:publicScreen { public: classResizer { public: voidResize(GLsizeiwidth,GLsizeiheight); }; classInitializer { public: intInitialize(); }; public: Window(); ~Window(); voidClose(); boolOpen(); boolOpen(stringtitle,intwidth,intheight,intbits,boolfullscreenflag);//makethatstringaconstchar*afterthisworks voidSetInitializer(Initializer*initializer); voidSetResizer(Resizer*resizer); voidSwapBuffers(); voidResize(GLsizeiwidth,GLsizeiheight); Vec2iGetMousePosition(); voidSetMousePosition(Vec2ipos); #ifdef__linux Display*GetDisplay(); private: CursorCreateWindowedCursor(); CursorCreateFullscreenCursor(); intscreen; ::Windowwindow; GLXContexthRC; XSetWindowAttributesattributes; booldoubleBuffered; XF86VidModeModeInfovidMode; intx,y; Display*display; #endif #ifdef__APPLE__ Display*GetDisplay(); private: CursorCreateWindowedCursor(); CursorCreateFullscreenCursor(); intscreen; ::Windowwindow; GLXContexthRC; XSetWindowAttributesattributes; booldoubleBuffered; //XF86VidModeModeInfovidMode; intx,y; Display*display; #endif private: Resizer*_resizer; Initializer*_initializer; #ifdefWIN32 HGLRCglContext; HWNDwindow; HDCdeviceContext; HINSTANCEinstance; #endif }; }; #ifdefWIN32 LRESULTCALLBACKWndProc(HWND,UINT,WPARAM,LPARAM); #endif #ifdef__linux staticintattrListSgl[]={GLX_RGBA,GLX_RED_SIZE,4,GLX_GREEN_SIZE,4,GLX_BLUE_SIZE,4,GLX_DEPTH_SIZE,16,None}; staticintattrListDbl[]={GLX_RGBA,GLX_DOUBLEBUFFER,GLX_RED_SIZE,4,GLX_GREEN_SIZE,4,GLX_BLUE_SIZE,4,GLX_DEPTH_SIZE,16,None}; #endif #ifdef__APPLE__ staticintattrListSgl[]={GLX_RGBA,GLX_RED_SIZE,4,GLX_GREEN_SIZE,4,GLX_BLUE_SIZE,4,GLX_DEPTH_SIZE,16,None}; staticintattrListDbl[]={GLX_RGBA,GLX_DOUBLEBUFFER,GLX_RED_SIZE,4,GLX_GREEN_SIZE,4,GLX_BLUE_SIZE,4,GLX_DEPTH_SIZE,16,None}; #endif #endif