AGL: Remove the call to Host_GetRenderWindowSize().

Just uses platform-specific ways to do the same thing.
This commit is contained in:
Lioncash 2014-08-05 03:33:45 -04:00
parent df67a18c42
commit 7692f5a5ce

View File

@ -4,9 +4,6 @@
#include <wx/panel.h> #include <wx/panel.h>
#include "Core/ConfigManager.h"
#include "Core/Host.h"
#include "DolphinWX/GLInterface/GLInterface.h" #include "DolphinWX/GLInterface/GLInterface.h"
#include "VideoCommon/RenderBase.h" #include "VideoCommon/RenderBase.h"
#include "VideoCommon/VertexShaderManager.h" #include "VideoCommon/VertexShaderManager.h"
@ -21,10 +18,9 @@ void cInterfaceAGL::Swap()
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize() // Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
bool cInterfaceAGL::Create(void *&window_handle) bool cInterfaceAGL::Create(void *&window_handle)
{ {
int _tx, _ty, _twidth, _theight; // FIXME: Get rid of the explicit use of wxPanel here. This shouldn't be necessary.
Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight); GLWin.cocoaWin = reinterpret_cast<NSView*>(((wxPanel*)window_handle)->GetHandle());
NSSize size = [GLWin.cocoaWin frame].size;
GLWin.cocoaWin = (NSView*)(((wxPanel*)window_handle)->GetHandle());
// Enable high-resolution display support. // Enable high-resolution display support.
[GLWin.cocoaWin setWantsBestResolutionOpenGLSurface:YES]; [GLWin.cocoaWin setWantsBestResolutionOpenGLSurface:YES];
@ -32,12 +28,12 @@ bool cInterfaceAGL::Create(void *&window_handle)
NSWindow *window = [GLWin.cocoaWin window]; NSWindow *window = [GLWin.cocoaWin window];
float scale = [window backingScaleFactor]; float scale = [window backingScaleFactor];
_twidth *= scale; size.width *= scale;
_theight *= scale; size.height *= scale;
// Control window size and picture scaling // Control window size and picture scaling
s_backbuffer_width = _twidth; s_backbuffer_width = size.width;
s_backbuffer_height = _theight; s_backbuffer_height = size.height;
NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 }; NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 };
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]