summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authortmator <tmator@gmail.com>2008-08-12 23:17:29 +0000
committertmator <tmator@gmail.com>2008-08-12 23:17:29 +0000
commitac6d34cd10ca8d184abdfa4dabde9117b7fa2d55 (patch)
tree1988c9817bb3e5edd6dd18d31a52c256d6a8af45 /Source
parentf893f3f17bd6a9de5c8cc9edb1c213912c5428eb (diff)
Added mth patchs / icon and a fist SDL support on OGL plugin, not work ...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@182 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinWX/src/SConscript20
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp54
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/Render.cpp6
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/SConscript4
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/main.cpp10
5 files changed, 83 insertions, 11 deletions
diff --git a/Source/Core/DolphinWX/src/SConscript b/Source/Core/DolphinWX/src/SConscript
index 63f008c621..028023fd40 100644
--- a/Source/Core/DolphinWX/src/SConscript
+++ b/Source/Core/DolphinWX/src/SConscript
@@ -19,7 +19,25 @@ files = ["BootManager.cpp",
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs`")
-if sys.platform == 'darwin':
+if sys.platform == 'darwin':
+ icon = 'Dolphin'
+ version = "svn"
wxenv.Program("../../../../Binary/mac/Dolphin.app/Contents/MacOS/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common" , "z"])
+ wxenv.Command("../../../../Binary/mac/Dolphin.app/Contents/Resources/" + icon + ".icns", "../resources/" + icon + ".icns", Copy("$TARGET", "$SOURCE"))
+ wxenv.Plist("../../../../Binary/mac/Dolphin.app/Contents/Info.plist", Value(dict(
+ CFAppleHelpAnchor = 'index',
+ CFBundleExecutable = 'Dolphin',
+ CFBundleGetInfoHTML = 'Dolphin ' + version,
+ CFBundleIconFile = icon,
+ CFBundleIdentifier = 'com.dolphin-emu.dolphin',
+ CFBundleName = 'Dolphin',
+ CFBundlePackageType = 'APPL',
+ CFBundleShortVersionString = version,
+ CFBundleSignature = 'dlfn',
+ CFBundleVersion = version,
+ LSRequiresCarbon = True,
+ NSPrefPaneIconFile = icon,
+ NSPrefPaneIconLabel = 'Dolphin',
+ )))
else:
wxenv.Program("../../../../Binary/linux/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common"])
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp
index 820b69ac7d..b086c7cdec 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp
@@ -23,6 +23,10 @@
#endif
#include "GLInit.h"
+#ifdef MACOSX
+#include "SDL/SDL.h"
+#endif
+
// Handles OpenGL and the window
@@ -45,8 +49,10 @@ void OpenGL_SwapBuffers()
{
#ifdef _WIN32
SwapBuffers(hDC);
-#else
+#elifdef __linux__
glXSwapBuffers(GLWin.dpy, GLWin.win);
+#else //others
+ SDL_GL_SwapBuffers();
#endif
}
@@ -54,12 +60,14 @@ void OpenGL_SetWindowText(const char *text)
{
#ifdef _WIN32
SetWindowText(EmuWindow::GetWnd(), text);
-#else
+#elifdef __linux__
/**
* Tell X to ask the window manager to set the window title. (X
* itself doesn't provide window title functionality.)
*/
XStoreName(GLWin.dpy, GLWin.win, text);
+#else
+ SDL_WM_SetCaption(text, NULL);
#endif
}
@@ -76,12 +84,14 @@ BOOL Callback_PeekMessages()
DispatchMessage(&msg);
}
return TRUE;
-#else
+#elifdef __linux__
XEvent event;
while (XPending(GLWin.dpy) > 0) {
XNextEvent(GLWin.dpy, &event);
}
return TRUE;
+#else
+ //TODO
#endif
}
@@ -253,7 +263,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
return false;
}
-#else
+#elifdef __linux__
XVisualInfo *vi;
Colormap cmap;
int dpyWidth, dpyHeight;
@@ -380,6 +390,32 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
"GPU", None, NULL, 0, NULL);
XMapRaised(GLWin.dpy, GLWin.win);
}
+#else
+ //SDL fo other OS (osx, bsd, ...)
+ int videoFlags;
+ SDL_Surface *screen;
+ const SDL_VideoInfo *videoInfo;
+
+ //init sdl video
+ SDL_Init(SDL_INIT_VIDEO);
+ //fetch video info
+ videoInfo = SDL_GetVideoInfo();
+
+ //hw o sw ogl ?
+ if (videoInfo->hw_available)
+ videoFlags |= SDL_HWSURFACE;
+ else
+ videoFlags |= SDL_SWSURFACE;
+
+
+ //fullscreen or not
+ if(g_Config.bFullscreen)
+ videoFlags |= SDL_FULLSCREEN;
+
+ //setup ogl to use double buffering
+ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+
+ screen = SDL_SetVideoMode(_twidth, _theight, 24, SDL_OPENGL|SDL_RESIZABLE);
#endif
return true;
}
@@ -391,7 +427,7 @@ bool OpenGL_MakeCurrent()
MessageBox(NULL,"(5) Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return false;
}
-#else
+#elifdef __linux__
Window winDummy;
unsigned int borderDummy;
// connect the glx-context to the window
@@ -408,6 +444,10 @@ bool OpenGL_MakeCurrent()
XSelectInput(GLWin.dpy, GLWin.win, ExposureMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
FocusChangeMask );
+#else
+
+ //TODO
+
#endif
return true;
}
@@ -466,7 +506,7 @@ void OpenGL_Shutdown()
MessageBox(NULL,"Release Device Context Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
hDC = NULL; // Set DC To NULL
}
-#else // linux
+#elifdef __linux__
if (GLWin.ctx)
{
if (!glXMakeCurrent(GLWin.dpy, None, NULL))
@@ -483,5 +523,7 @@ void OpenGL_Shutdown()
XF86VidModeSetViewPort(GLWin.dpy, GLWin.screen, 0, 0);
}
}
+#else
+ SDL_Quit();
#endif
}
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
index 7c08dfab7e..30f41e0763 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
@@ -115,11 +115,15 @@ bool Renderer::Create2()
wglSwapIntervalEXT(0);
else
ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\n");
-#else
+#elifdef __linux__
if (glXSwapIntervalSGI)
glXSwapIntervalSGI(0);
else
ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\n");
+#else
+
+ //TODO
+
#endif
// check the max texture width and height
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript
index 2f40e10cf5..d4f717a229 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript
+++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript
@@ -25,8 +25,8 @@ files = ["BPStructs.cpp",
"GUI/ConfigDlg.cpp",
]
if sys.platform == 'darwin':
- gfxenv=env.Copy(CXXFLAGS = " -DMACOSX=1 `wx-config --cppflags` ", LINKFLAGS = " -framework OpenGL -framework Cg `wx-config --libs` ")
- gfxenv.SharedLibrary("../../../../Binary/mac/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GLEW"])
+ gfxenv=env.Copy(CXXFLAGS = " -DMACOSX=1 `wx-config --cppflags` ", LINKFLAGS = " -framework SDL -framework OpenGL -framework Cg `wx-config --libs` ")
+ gfxenv.SharedLibrary("../../../../Binary/mac/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "GLEW"])
else:
gfxenv=env.Copy(CXXFLAGS = " `wx-config --cppflags` `pkg-config --cflags xxf86vm` ", LINKFLAGS = "`wx-config --libs` `pkg-config --libs xxf86vm` ")
gfxenv.SharedLibrary("../../../../Binary/linux/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GL", "GLU", "GLEW", "CgGL", "Cg", "X11"])
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
index 1c63f90a33..83018e6a13 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
@@ -21,6 +21,10 @@
#include "OS\Win32.h"
#endif
+#ifdef MACOSX
+#include "SDL/SDL.h"
+#endif
+
#include "GUI/ConfigDlg.h"
#include "Render.h"
@@ -90,7 +94,7 @@ void DllConfig(HWND _hParent)
frame.ShowModal();
win.SetHWND(0);
-#else
+#elifdef __linux__
ConfigDialog frame(NULL);
g_Config.Load();
XVisualInfo *vi;
@@ -126,6 +130,10 @@ void DllConfig(HWND _hParent)
}
}
frame.ShowModal();
+#else
+
+ //TODO
+
#endif
}