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
This commit is contained in:
tmator 2008-08-12 23:17:29 +00:00
parent f893f3f17b
commit ac6d34cd10
6 changed files with 100 additions and 12 deletions

View File

@ -1,6 +1,10 @@
import os import os
import sys import sys
# TODO: What is the current Dolphin version?
dolphin_version = '1.04'
Export('dolphin_version')
warnings = ' -Wall -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wpacked -Wno-conversion' warnings = ' -Wall -Wwrite-strings -Wfloat-equal -Wshadow -Wpointer-arith -Wpacked -Wno-conversion'
nonactive_warnings = '-Wunreachable-code' nonactive_warnings = '-Wunreachable-code'
@ -25,7 +29,17 @@ include_paths = ["../../../Core/Common/Src",
# "../../../Plugins/Plugin_VideoOGL/Src/Windows", # "../../../Plugins/Plugin_VideoOGL/Src/Windows",
] ]
builders = {}
if sys.platform == 'darwin': if sys.platform == 'darwin':
from plistlib import writePlist
def create_plist(target, source, env):
properties = {}
for src_node in source:
properties.update(src_node.value)
for dst_node in target:
writePlist(properties, str(dst_node))
builders['Plist'] = Builder(action = create_plist)
dirs = ["Source/Core/Common/Src", dirs = ["Source/Core/Common/Src",
"Externals/Bochs_disasm", "Externals/Bochs_disasm",
"Source/Core/Core/Src", "Source/Core/Core/Src",
@ -64,7 +78,9 @@ env = Environment(CC="gcc",
CPPPATH=include_paths, CPPPATH=include_paths,
LIBPATH=lib_paths, LIBPATH=lib_paths,
ENV={'PATH' : os.environ['PATH'], ENV={'PATH' : os.environ['PATH'],
'HOME' : os.environ['HOME']}) 'HOME' : os.environ['HOME']},
BUILDERS = builders,
)
Export('env') Export('env')

View File

@ -19,7 +19,25 @@ files = ["BootManager.cpp",
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP", wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs`") 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.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: else:
wxenv.Program("../../../../Binary/linux/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common"]) wxenv.Program("../../../../Binary/linux/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common"])

View File

@ -23,6 +23,10 @@
#endif #endif
#include "GLInit.h" #include "GLInit.h"
#ifdef MACOSX
#include "SDL/SDL.h"
#endif
// Handles OpenGL and the window // Handles OpenGL and the window
@ -45,8 +49,10 @@ void OpenGL_SwapBuffers()
{ {
#ifdef _WIN32 #ifdef _WIN32
SwapBuffers(hDC); SwapBuffers(hDC);
#else #elifdef __linux__
glXSwapBuffers(GLWin.dpy, GLWin.win); glXSwapBuffers(GLWin.dpy, GLWin.win);
#else //others
SDL_GL_SwapBuffers();
#endif #endif
} }
@ -54,12 +60,14 @@ void OpenGL_SetWindowText(const char *text)
{ {
#ifdef _WIN32 #ifdef _WIN32
SetWindowText(EmuWindow::GetWnd(), text); SetWindowText(EmuWindow::GetWnd(), text);
#else #elifdef __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.)
*/ */
XStoreName(GLWin.dpy, GLWin.win, text); XStoreName(GLWin.dpy, GLWin.win, text);
#else
SDL_WM_SetCaption(text, NULL);
#endif #endif
} }
@ -76,12 +84,14 @@ BOOL Callback_PeekMessages()
DispatchMessage(&msg); DispatchMessage(&msg);
} }
return TRUE; return TRUE;
#else #elifdef __linux__
XEvent event; XEvent event;
while (XPending(GLWin.dpy) > 0) { while (XPending(GLWin.dpy) > 0) {
XNextEvent(GLWin.dpy, &event); XNextEvent(GLWin.dpy, &event);
} }
return TRUE; return TRUE;
#else
//TODO
#endif #endif
} }
@ -253,7 +263,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
return false; return false;
} }
#else #elifdef __linux__
XVisualInfo *vi; XVisualInfo *vi;
Colormap cmap; Colormap cmap;
int dpyWidth, dpyHeight; int dpyWidth, dpyHeight;
@ -380,6 +390,32 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
"GPU", None, NULL, 0, NULL); "GPU", None, NULL, 0, NULL);
XMapRaised(GLWin.dpy, GLWin.win); 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 #endif
return true; return true;
} }
@ -391,7 +427,7 @@ bool OpenGL_MakeCurrent()
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;
} }
#else #elifdef __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
@ -408,6 +444,10 @@ bool OpenGL_MakeCurrent()
XSelectInput(GLWin.dpy, GLWin.win, ExposureMask | KeyPressMask | KeyReleaseMask | XSelectInput(GLWin.dpy, GLWin.win, ExposureMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | ButtonPressMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
FocusChangeMask ); FocusChangeMask );
#else
//TODO
#endif #endif
return true; return true;
} }
@ -466,7 +506,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
} }
#else // linux #elifdef __linux__
if (GLWin.ctx) if (GLWin.ctx)
{ {
if (!glXMakeCurrent(GLWin.dpy, None, NULL)) if (!glXMakeCurrent(GLWin.dpy, None, NULL))
@ -483,5 +523,7 @@ void OpenGL_Shutdown()
XF86VidModeSetViewPort(GLWin.dpy, GLWin.screen, 0, 0); XF86VidModeSetViewPort(GLWin.dpy, GLWin.screen, 0, 0);
} }
} }
#else
SDL_Quit();
#endif #endif
} }

View File

@ -115,11 +115,15 @@ 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");
#else #elifdef __linux__
if (glXSwapIntervalSGI) if (glXSwapIntervalSGI)
glXSwapIntervalSGI(0); glXSwapIntervalSGI(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");
#else
//TODO
#endif #endif
// check the max texture width and height // check the max texture width and height

View File

@ -25,8 +25,8 @@ files = ["BPStructs.cpp",
"GUI/ConfigDlg.cpp", "GUI/ConfigDlg.cpp",
] ]
if sys.platform == 'darwin': if sys.platform == 'darwin':
gfxenv=env.Copy(CXXFLAGS = " -DMACOSX=1 `wx-config --cppflags` ", LINKFLAGS = " -framework OpenGL -framework Cg `wx-config --libs` ") 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", "cairo", "GLEW"]) gfxenv.SharedLibrary("../../../../Binary/mac/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "GLEW"])
else: else:
gfxenv=env.Copy(CXXFLAGS = " `wx-config --cppflags` `pkg-config --cflags xxf86vm` ", LINKFLAGS = "`wx-config --libs` `pkg-config --libs xxf86vm` ") 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"]) gfxenv.SharedLibrary("../../../../Binary/linux/Plugins/zeroogl.so", files, LIBS=["videocommon", "common", "cairo", "GL", "GLU", "GLEW", "CgGL", "Cg", "X11"])

View File

@ -21,6 +21,10 @@
#include "OS\Win32.h" #include "OS\Win32.h"
#endif #endif
#ifdef MACOSX
#include "SDL/SDL.h"
#endif
#include "GUI/ConfigDlg.h" #include "GUI/ConfigDlg.h"
#include "Render.h" #include "Render.h"
@ -90,7 +94,7 @@ void DllConfig(HWND _hParent)
frame.ShowModal(); frame.ShowModal();
win.SetHWND(0); win.SetHWND(0);
#else #elifdef __linux__
ConfigDialog frame(NULL); ConfigDialog frame(NULL);
g_Config.Load(); g_Config.Load();
XVisualInfo *vi; XVisualInfo *vi;
@ -126,6 +130,10 @@ void DllConfig(HWND _hParent)
} }
} }
frame.ShowModal(); frame.ShowModal();
#else
//TODO
#endif #endif
} }