diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-25 15:10:40 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-25 15:10:40 (GMT) |
| commit | dacb774ae01102f756e92449ef395fb938a2acf0 (patch) | |
| tree | 5072718aaa46cc5e3d6e454c38c953684cb3e076 /src/OpenGLGraphics.cpp | |
| parent | ab8f382acc863d8d71ddb75b3161629cf5dd8d64 (diff) | |
| download | powder-dacb774ae01102f756e92449ef395fb938a2acf0.zip powder-dacb774ae01102f756e92449ef395fb938a2acf0.tar.gz | |
Resizable window when using OpenGL interface
Diffstat (limited to 'src/OpenGLGraphics.cpp')
| -rw-r--r-- | src/OpenGLGraphics.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/OpenGLGraphics.cpp b/src/OpenGLGraphics.cpp index eb242ce..d688639 100644 --- a/src/OpenGLGraphics.cpp +++ b/src/OpenGLGraphics.cpp @@ -6,19 +6,7 @@ Graphics::Graphics(): sdl_scale(1) { - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - //glOrtho(0, (XRES+BARSIZE)*sdl_scale, 0, (YRES+MENUSIZE)*sdl_scale, -1, 1); - glOrtho(0, (XRES+BARSIZE)*sdl_scale, (YRES+MENUSIZE)*sdl_scale, 0, -1, 1); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - - //glRasterPos2i(0, (YRES+MENUSIZE)); - glRasterPos2i(0, 0); - glPixelZoom(1, 1); + Reset(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -51,6 +39,22 @@ Graphics::~Graphics() { } +void Graphics::Reset() +{ + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + //glOrtho(0, (XRES+BARSIZE)*sdl_scale, 0, (YRES+MENUSIZE)*sdl_scale, -1, 1); + glOrtho(0, (XRES+BARSIZE)*sdl_scale, (YRES+MENUSIZE)*sdl_scale, 0, -1, 1); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + //glRasterPos2i(0, (YRES+MENUSIZE)); + glRasterPos2i(0, 0); + glPixelZoom(1, 1); +} + void Graphics::Clear() { glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
