Revert parts of r5576 and r5598 for Sonicadvance1's sake.

This reenables the option for building without wx on OS X,
but still leaves wxgl as the default.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5599 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-06-04 04:59:07 +00:00
parent 84c55c3e4e
commit 3ab27a7d87
15 changed files with 676 additions and 26 deletions

View File

@ -55,6 +55,8 @@ void OpenGL_SwapBuffers()
{
#if defined(USE_WX) && USE_WX
GLWin.glCanvas->SwapBuffers();
#elif defined(__APPLE__)
cocoaGLSwap(GLWin.cocoaCtx,GLWin.cocoaWin);
#elif defined(_WIN32)
SwapBuffers(hDC);
#elif defined(HAVE_X11) && HAVE_X11
@ -76,6 +78,8 @@ void OpenGL_SetWindowText(const char *text)
{
#if defined(USE_WX) && USE_WX
// GLWin.frame->SetTitle(wxString::FromAscii(text));
#elif defined(__APPLE__)
cocoaGLSetTitle(GLWin.cocoaWin, text);
#elif defined(_WIN32)
// TODO convert text to unicode and change SetWindowTextA to SetWindowText
SetWindowTextA(EmuWindow::GetWnd(), text);
@ -264,6 +268,12 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
GLWin.glCanvas->SetCurrent(*GLWin.glCtxt);
#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);
#elif defined(_WIN32)
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Please wait..."));
if (g_VideoInitialize.pWindowHandle == NULL)
@ -405,6 +415,8 @@ bool OpenGL_MakeCurrent()
// connect the glx-context to the window
#if defined(USE_WX) && USE_WX
GLWin.glCanvas->SetCurrent(*GLWin.glCtxt);
#elif defined(__APPLE__)
cocoaGLMakeCurrent(GLWin.cocoaCtx,GLWin.cocoaWin);
#elif defined(_WIN32)
return wglMakeCurrent(hDC,hRC);
#elif defined(HAVE_X11) && HAVE_X11
@ -425,6 +437,11 @@ void OpenGL_Update()
// TODO fill in
#elif defined(__APPLE__)
RECT rcWindow = {0};
rcWindow.right = GLWin.width;
rcWindow.bottom = GLWin.height;
#elif defined(_WIN32)
RECT rcWindow;
if (!EmuWindow::GetParentWnd())
@ -464,6 +481,10 @@ void OpenGL_Shutdown()
{
#if defined(USE_WX) && USE_WX
delete GLWin.glCanvas;
#elif defined(__APPLE__)
cocoaGLDeleteWindow(GLWin.cocoaWin);
cocoaGLDelete(GLWin.cocoaCtx);
#elif defined(_WIN32)
if (hRC) // Do We Have A Rendering Context?
{