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
This commit is contained in:
Soren Jorvang 2011-01-10 16:18:41 +00:00
parent f9e4e73e42
commit 601eab79e1
6 changed files with 40 additions and 41 deletions

View File

@ -155,7 +155,7 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
if ((CommandBuffer.InBuffer.size() == 1) && (CommandBuffer.PayloadBuffer.size() == 1))
{
size_t numFile = FileSearch.GetFileNames().size();
INFO_LOG(WII_IPC_FILEIO, "\t%lu Files found", (u32)numFile);
INFO_LOG(WII_IPC_FILEIO, "\t%lu Files found", (unsigned long)numFile);
Memory::Write_U32((u32)numFile, CommandBuffer.PayloadBuffer[0].m_Address);
}

View File

@ -323,22 +323,13 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
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(__APPLE__)
GLWin.width = s_backbuffer_width;
GLWin.height = s_backbuffer_height;
GLWin.cocoaWin = cocoaGLCreateWindow(GLWin.width, GLWin.height);
GLWin.cocoaCtx = cocoaGLInit(g_Config.iMultisampleMode);
@ -500,9 +491,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(__APPLE__)
// Is anything needed here?

View File

@ -29,7 +29,7 @@
#include <GL/glew.h>
#include <GL/wglew.h>
#else // linux and apple basic definitions
#else
#if defined(USE_WX) && USE_WX
#include <GL/glew.h>
@ -47,13 +47,13 @@
#include "cocoaGL.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(__APPLE__)
NSWindow *cocoaWin;
NSOpenGLContext *cocoaCtx;
@ -87,8 +87,8 @@ typedef struct {
XSetWindowAttributes attr;
Common::Thread *xEventThread;
int x, y;
#endif
unsigned int width, height;
#endif
} GLWindow;
extern GLWindow GLWin;

View File

@ -34,7 +34,7 @@
#include <GL/glew.h>
#endif
#if defined(__APPLE__)
#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>

View File

@ -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())

View File

@ -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;