/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/zzogl-pg/opengl/GLWin.h
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/zzogl-pg/opengl/GLWin.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 314 - (show annotations) (download)
Sun Dec 26 18:56:19 2010 UTC (9 years, 2 months ago) by william
File MIME type: text/plain
File size: 2222 byte(s)
** merged upstream r4049 (re-integration of GregMiscellaneous branch)
** applied patched to GigTranser.cpp in ZZOgl from r4140 to change 'static int count = 0;' to 'static int path1_count = 0;')
1 /* ZZ Open GL graphics plugin
2 * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
3 * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 #ifndef GLWIN_H_INCLUDED
21 #define GLWIN_H_INCLUDED
22
23
24 #ifdef _WIN32
25 #define GL_WIN32_WINDOW
26 #else
27 #define GL_X11_WINDOW
28 #endif
29
30 #undef CreateWindow // Undo Windows.h global namespace pollution
31
32 extern void SetDeviceSize(int nNewWidth, int nNewHeight);
33 extern void OnFKey(int key, int shift);
34
35 class GLWindow
36 {
37 private:
38 #ifdef GL_X11_WINDOW
39 Display *glDisplay;
40 int glScreen;
41 GLXContext context;
42 XVisualInfo *vi;
43
44 Window glWindow;
45 XSetWindowAttributes attr;
46
47 bool CreateVisual();
48 void GetGLXVersion();
49 void GetWindowSize();
50 void UpdateGrabKey();
51 void Force43Ratio();
52 #endif
53 bool fullScreen, doubleBuffered;
54 u32 width, height, depth;
55
56 public:
57 char title[256];
58 Size backbuffer;
59
60 void SwapGLBuffers();
61 bool ReleaseContext();
62
63 #ifdef GL_X11_WINDOW
64 void ToggleFullscreen();
65 #endif
66
67 bool CreateWindow(void *pDisplay);
68 void CloseWindow();
69 bool DisplayWindow(int _width, int _height);
70 void SetTitle(char *strtitle);
71 void ResizeCheck();
72 void ProcessEvents();
73
74 void UpdateWindowSize(int nNewWidth, int nNewHeight)
75 {
76 FUNCLOG
77 backbuffer.w = std::max(nNewWidth, 16);
78 backbuffer.h = std::max(nNewHeight, 16);
79
80 if (!(conf.fullscreen()))
81 {
82 conf.width = nNewWidth;
83 conf.height = nNewHeight;
84 }
85 }
86 };
87
88 extern GLWindow GLWin;
89
90 #endif // GLWIN_H_INCLUDED

  ViewVC Help
Powered by ViewVC 1.1.22