win32 build fix - no #elifdef on MSVC

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@186 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-08-13 00:00:39 +00:00
parent e4e1fda2e4
commit 7b357c84df
3 changed files with 22 additions and 21 deletions

View File

@ -17,7 +17,7 @@
#include "Globals.h" #include "Globals.h"
#include "IniFile.h" #include "IniFile.h"
#ifdef _WIN32 #if defined(_WIN32)
#include "svnrev.h" #include "svnrev.h"
#include "OS\Win32.h" #include "OS\Win32.h"
#endif #endif
@ -39,7 +39,7 @@ u32 g_AAx = 0, g_AAy = 0;
GLWindow GLWin; GLWindow GLWin;
#endif #endif
#ifdef _WIN32 #if defined(_WIN32)
static HDC hDC = NULL; // Private GDI Device Context static HDC hDC = NULL; // Private GDI Device Context
static HGLRC hRC = NULL; // Permanent Rendering Context static HGLRC hRC = NULL; // Permanent Rendering Context
extern HINSTANCE g_hInstance; extern HINSTANCE g_hInstance;
@ -47,9 +47,9 @@ extern HINSTANCE g_hInstance;
void OpenGL_SwapBuffers() void OpenGL_SwapBuffers()
{ {
#ifdef _WIN32 #if defined(_WIN32)
SwapBuffers(hDC); SwapBuffers(hDC);
#elifdef __linux__ #elif defined(__linux__)
glXSwapBuffers(GLWin.dpy, GLWin.win); glXSwapBuffers(GLWin.dpy, GLWin.win);
#else //others #else //others
SDL_GL_SwapBuffers(); SDL_GL_SwapBuffers();
@ -58,9 +58,9 @@ void OpenGL_SwapBuffers()
void OpenGL_SetWindowText(const char *text) void OpenGL_SetWindowText(const char *text)
{ {
#ifdef _WIN32 #if defined(_WIN32)
SetWindowText(EmuWindow::GetWnd(), text); SetWindowText(EmuWindow::GetWnd(), text);
#elifdef __linux__ #elif defined(__linux__)
/** /**
* Tell X to ask the window manager to set the window title. (X * Tell X to ask the window manager to set the window title. (X
* itself doesn't provide window title functionality.) * itself doesn't provide window title functionality.)
@ -73,7 +73,7 @@ void OpenGL_SetWindowText(const char *text)
BOOL Callback_PeekMessages() BOOL Callback_PeekMessages()
{ {
#ifdef _WIN32 #if defined(_WIN32)
//TODO: peekmessage //TODO: peekmessage
MSG msg; MSG msg;
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
@ -84,7 +84,7 @@ BOOL Callback_PeekMessages()
DispatchMessage(&msg); DispatchMessage(&msg);
} }
return TRUE; return TRUE;
#elifdef __linux__ #elif defined(__linux__)
XEvent event; XEvent event;
while (XPending(GLWin.dpy) > 0) { while (XPending(GLWin.dpy) > 0) {
XNextEvent(GLWin.dpy, &event); XNextEvent(GLWin.dpy, &event);
@ -98,7 +98,7 @@ BOOL Callback_PeekMessages()
void UpdateFPSDisplay(const char *text) void UpdateFPSDisplay(const char *text)
{ {
#ifdef _WIN32 #if defined(_WIN32)
char temp[512]; char temp[512];
sprintf(temp, "SVN R%i: %s", SVN_REV, text); sprintf(temp, "SVN R%i: %s", SVN_REV, text);
SetWindowText(EmuWindow::GetWnd(), temp); SetWindowText(EmuWindow::GetWnd(), temp);
@ -139,7 +139,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
_theight = _iheight; _theight = _iheight;
} }
} }
#ifdef _WIN32 #if defined(_WIN32)
EmuWindow::SetSize(_twidth, _theight); EmuWindow::SetSize(_twidth, _theight);
#endif #endif
@ -153,7 +153,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
g_VideoInitialize.pPeekMessages = &Callback_PeekMessages; g_VideoInitialize.pPeekMessages = &Callback_PeekMessages;
g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay; g_VideoInitialize.pUpdateFPSDisplay = &UpdateFPSDisplay;
#ifdef _WIN32 #if defined(_WIN32)
// create the window // create the window
if (!g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL) { if (!g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL) {
// create the window // create the window
@ -263,7 +263,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
return false; return false;
} }
#elifdef __linux__ #elif defined(__linux__)
XVisualInfo *vi; XVisualInfo *vi;
Colormap cmap; Colormap cmap;
int dpyWidth, dpyHeight; int dpyWidth, dpyHeight;
@ -437,12 +437,12 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
bool OpenGL_MakeCurrent() bool OpenGL_MakeCurrent()
{ {
#ifdef _WIN32 #if defined(_WIN32)
if (!wglMakeCurrent(hDC,hRC)) { if (!wglMakeCurrent(hDC,hRC)) {
MessageBox(NULL,"(5) Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); MessageBox(NULL,"(5) Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return false; return false;
} }
#elifdef __linux__ #elif defined(__linux__)
Window winDummy; Window winDummy;
unsigned int borderDummy; unsigned int borderDummy;
// connect the glx-context to the window // connect the glx-context to the window
@ -469,7 +469,7 @@ bool OpenGL_MakeCurrent()
void OpenGL_Update() void OpenGL_Update()
{ {
#ifdef _WIN32 #if defined(_WIN32)
if (EmuWindow::GetParentWnd()) if (EmuWindow::GetParentWnd())
{ {
@ -501,7 +501,7 @@ void OpenGL_Update()
void OpenGL_Shutdown() void OpenGL_Shutdown()
{ {
#ifdef _WIN32 #if defined(_WIN32)
if (hRC) // Do We Have A Rendering Context? if (hRC) // Do We Have A Rendering Context?
{ {
if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts? if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts?
@ -521,7 +521,7 @@ void OpenGL_Shutdown()
MessageBox(NULL,"Release Device Context Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION); MessageBox(NULL,"Release Device Context Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
hDC = NULL; // Set DC To NULL hDC = NULL; // Set DC To NULL
} }
#elifdef __linux__ #elif defined(__linux__)
if (GLWin.ctx) if (GLWin.ctx)
{ {
if (!glXMakeCurrent(GLWin.dpy, None, NULL)) if (!glXMakeCurrent(GLWin.dpy, None, NULL))

View File

@ -115,7 +115,8 @@ bool Renderer::Create2()
wglSwapIntervalEXT(0); wglSwapIntervalEXT(0);
else else
ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\n"); ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\n");
#elifdef __linux__ #else
#ifdef __linux__
if (glXSwapIntervalSGI) if (glXSwapIntervalSGI)
glXSwapIntervalSGI(0); glXSwapIntervalSGI(0);
else else
@ -125,7 +126,7 @@ bool Renderer::Create2()
//TODO //TODO
#endif #endif
#endif
// check the max texture width and height // check the max texture width and height
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&g_MaxTexWidth); glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&g_MaxTexWidth);
g_MaxTexHeight = g_MaxTexWidth; g_MaxTexHeight = g_MaxTexWidth;

View File

@ -67,7 +67,7 @@ void DllAbout(HWND _hParent)
void DllConfig(HWND _hParent) void DllConfig(HWND _hParent)
{ {
#ifdef _WIN32 #if defined(_WIN32)
wxWindow win; wxWindow win;
win.SetHWND(_hParent); win.SetHWND(_hParent);
ConfigDialog frame(&win); ConfigDialog frame(&win);
@ -94,7 +94,7 @@ void DllConfig(HWND _hParent)
frame.ShowModal(); frame.ShowModal();
win.SetHWND(0); win.SetHWND(0);
#elifdef __linux__ #elif defined(__linux__)
ConfigDialog frame(NULL); ConfigDialog frame(NULL);
g_Config.Load(); g_Config.Load();
XVisualInfo *vi; XVisualInfo *vi;