From c2fd281a4954b099f5c36819367fa5bb929f7c38 Mon Sep 17 00:00:00 2001 From: nakeee Date: Thu, 11 Dec 2008 11:37:26 +0000 Subject: [PATCH] a bit more work still seg faults.. wonder why.. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1499 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp | 25 ++++++++++++++----- Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h | 5 ++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index ecacb8ee7a..ab63633f7b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -69,7 +69,7 @@ void OpenGL_SwapBuffers() #elif defined(_WIN32) SwapBuffers(hDC); #elif defined(USE_WX) && USE_WX - GLWin.Wxcs->SwapBuffers(); + GLWin.glCanvas->SwapBuffers(); #elif defined(HAVE_X11) && HAVE_X11 glXSwapBuffers(GLWin.dpy, GLWin.win); #endif @@ -83,6 +83,8 @@ void OpenGL_SetWindowText(const char *text) cocoaGLSetTitle(); #elif defined(_WIN32) SetWindowText(EmuWindow::GetWnd(), text); +#elif defined(USE_WX) && USE_WX + GLWin.frame->SetTitle(wxString::FromAscii(text)); #elif defined(HAVE_X11) && HAVE_X11 // GLX /** * Tell X to ask the window manager to set the window title. (X @@ -207,15 +209,20 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight GLWin.cocoaCtx = cocoaGLInit(g_Config.iMultisampleMode); #elif defined(USE_WX) && USE_WX int attrib[2]; - attrib[0] = WX_GL_DEPTH_SIZE; + attrib[0] = 16; //WX_GL_DEPTH_SIZE; attrib[1] = 32; - wxFrame *frame = new wxFrame((wxFrame *)NULL, -1, _("Test frame"), wxPoint(50,50), wxSize(400,400) ); - GLWin.Wxcs = new wxGLCanvas(frame, -1, wxPoint(0,0), wxSize(400,400), wxSUNKEN_BORDER, _("some text")); - frame->Show(TRUE); + wxSize size(_iwidth, _iheight); + GLWin.frame = new wxFrame((wxFrame *)NULL, -1,_ ("Dolphin"), + wxPoint(50,50), size); + GLWin.glCanvas = new wxGLCanvas(GLWin.frame, wxID_ANY, attrib, + wxPoint(0,0), size, wxSUNKEN_BORDER); - GLWin.Wxcs->SetCurrent(); + GLWin.frame->Show(TRUE); + GLWin.glCtxt = new wxGLContext(GLWin.glCanvas); + // GLWin.glCanvas->SetCurrent(*GLWin.glCtxt); + GLWin.glCtxt->SetCurrent(*GLWin.glCanvas); #elif defined(_WIN32) // create the window if (!g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL) @@ -541,6 +548,9 @@ void OpenGL_Update() #elif defined(USE_WX) && USE_WX RECT rcWindow; + rcWindow.right = GLWin.width; + rcWindow.bottom = GLWin.height; + // TODO fill in #elif defined(_WIN32) RECT rcWindow; @@ -688,6 +698,9 @@ void OpenGL_Shutdown() SDL_Quit(); #elif defined(HAVE_COCOA) && HAVE_COCOA cocoaGLDelete(GLWin.cocoaCtx); +#elif defined(USE_WX) && USE_WX + delete GLWin.glCanvas; + delete GLWin.frame; #elif defined(_WIN32) if (hRC) // Do We Have A Rendering Context? { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h index b822965b73..7a340d901d 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h @@ -117,8 +117,9 @@ typedef struct { #endif // XXF86VM #endif // X11 #if defined(USE_WX) && USE_WX - wxGLCanvas *Wxcs; - + wxGLCanvas *glCanvas; + wxFrame *frame; + wxGLContext *glCtxt; #endif int x, y; unsigned int width, height;