Revert "remove wx from agl"

This reverts commit e63a5d8529.
window_handle is also used at many other places, so just move it here isn't allowed
This commit is contained in:
degasus 2013-03-15 02:40:08 +01:00
parent d6c7e7d652
commit 84119a966b
2 changed files with 6 additions and 2 deletions

View File

@ -107,7 +107,7 @@ public:
void* GetRenderHandle() void* GetRenderHandle()
{ {
#if defined(_WIN32) || defined(__APPLE__) #ifdef _WIN32
return (void *)m_RenderParent->GetHandle(); return (void *)m_RenderParent->GetHandle();
#elif defined(HAVE_X11) && HAVE_X11 #elif defined(HAVE_X11) && HAVE_X11
return (void *)X11Utils::XWindowFromHandle(m_RenderParent->GetHandle()); return (void *)X11Utils::XWindowFromHandle(m_RenderParent->GetHandle());

View File

@ -20,6 +20,8 @@
#include "RenderBase.h" #include "RenderBase.h"
#include "ConfigManager.h" #include "ConfigManager.h"
#include <wx/panel.h>
#include "VertexShaderManager.h" #include "VertexShaderManager.h"
#include "../GLInterface.h" #include "../GLInterface.h"
#include "AGL.h" #include "AGL.h"
@ -72,7 +74,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
style |= NSResizableWindowMask | NSTitledWindowMask; style |= NSResizableWindowMask | NSTitledWindowMask;
} }
GLWin.cocoaWin = (NSView*)window_handle; GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());;
if (GLWin.cocoaWin == nil) { if (GLWin.cocoaWin == nil) {
ERROR_LOG(VIDEO, "failed to create window"); ERROR_LOG(VIDEO, "failed to create window");
return NULL; return NULL;
@ -95,6 +97,8 @@ bool cInterfaceAGL::MakeCurrent()
width = [GLWin.cocoaWin frame].size.width; width = [GLWin.cocoaWin frame].size.width;
height = [GLWin.cocoaWin frame].size.height; height = [GLWin.cocoaWin frame].size.height;
//if (width == s_backbuffer_width && height == s_backbuffer_height)
// return true;
[GLWin.cocoaCtx setView: GLWin.cocoaWin]; [GLWin.cocoaCtx setView: GLWin.cocoaWin];
[GLWin.cocoaCtx update]; [GLWin.cocoaCtx update];