summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoSoftware
diff options
context:
space:
mode:
authorSoren Jorvang <soren.jorvang@gmail.com>2011-01-10 16:18:41 +0000
committerSoren Jorvang <soren.jorvang@gmail.com>2011-01-10 16:18:41 +0000
commit601eab79e177dad76fadd405ae6383ed4c093aef (patch)
treef0d634efe93679f51d36f215a151163f2a702b52 /Source/Plugins/Plugin_VideoSoftware
parentf9e4e73e428ea0ce594fb2017272fc47d447f2fa (diff)
Properly resize the GL canvas on window changes with USE_WX and wx 2.9.
Fixes issue 2524. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6803 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoSoftware')
-rw-r--r--Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp28
-rw-r--r--Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h10
2 files changed, 19 insertions, 19 deletions
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp
index 77f72ff792..1be873863b 100644
--- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp
+++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.cpp
@@ -118,19 +118,11 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _twidth, int _theight
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
#if defined(USE_WX) && USE_WX
-
- int args[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0};
-
- wxSize size(_twidth, _theight);
-
GLWin.panel = (wxPanel *)g_VideoInitialize.pWindowHandle;
-
- GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, args,
- wxPoint(0,0), size, wxSUNKEN_BORDER);
+ GLWin.glCanvas = new wxGLCanvas(GLWin.panel, wxID_ANY, NULL,
+ wxPoint(0, 0), wxSize(_twidth, _theight));
GLWin.glCtxt = new wxGLContext(GLWin.glCanvas);
- GLWin.glCanvas->Show(TRUE);
-
- GLWin.glCanvas->SetCurrent(*GLWin.glCtxt);
+ GLWin.glCanvas->Show(true);
#elif defined(_WIN32)
// Create rendering window in Windows
@@ -318,9 +310,17 @@ bool OpenGL_MakeCurrent()
void OpenGL_Update()
{
#if defined(USE_WX) && USE_WX
- GLWin.glCanvas->GetSize((int *)&GLWin.width, (int *)&GLWin.height);
- s_backbuffer_width = GLWin.width;
- s_backbuffer_height = GLWin.height;
+ int width, height;
+
+ GLWin.panel->GetSize(&width, &height);
+ if (width == s_backbuffer_width && height == s_backbuffer_height)
+ return;
+
+ GLWin.glCanvas->SetSize(0, 0, width, height);
+ GLWin.glCtxt->SetCurrent(*GLWin.glCanvas);
+ s_backbuffer_width = width;
+ s_backbuffer_height = height;
+
#elif defined(_WIN32)
RECT rcWindow;
if (!EmuWindow::GetParentWnd())
diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h
index 1af8b28280..ce0e183fb4 100644
--- a/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h
+++ b/Source/Plugins/Plugin_VideoSoftware/Src/GLUtil.h
@@ -31,7 +31,7 @@
#include <GL/glew.h>
#include <GL/wglew.h>
-#else // linux basic definitions
+#else
#if defined(USE_WX) && USE_WX
#include <GL/glew.h>
@@ -47,13 +47,13 @@
#include <GL/glew.h>
#endif // end USE_WX
-#if defined(__APPLE__)
+#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
-#endif // linux basic definitions
+#endif
#ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils
#define GL_DEPTH_STENCIL_EXT 0x84F9
@@ -69,8 +69,8 @@
typedef struct {
#if defined(USE_WX) && USE_WX
wxGLCanvas *glCanvas;
- wxPanel *panel;
wxGLContext *glCtxt;
+ wxPanel *panel;
#elif defined(HAVE_X11) && HAVE_X11
int screen;
Window win;
@@ -79,8 +79,8 @@ typedef struct {
GLXContext ctx;
XSetWindowAttributes attr;
int x, y;
-#endif
unsigned int width, height;
+#endif
} GLWindow;
extern GLWindow GLWin;