From 34cfcc5169cafa8ae9e0d6469e20dc11c122c077 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Fri, 18 Feb 2011 08:58:58 +0000 Subject: -(SysBeep)Added Mac OS X port of P.E.Op.S OpenGL plugin. (Patch #8361) -Fixed help message for Windows. (Issue #8028). git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@63522 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/peopsxgl/draw.c | 52 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 6 deletions(-) (limited to 'plugins/peopsxgl/draw.c') diff --git a/plugins/peopsxgl/draw.c b/plugins/peopsxgl/draw.c index 32dcc83b..748824a1 100644 --- a/plugins/peopsxgl/draw.c +++ b/plugins/peopsxgl/draw.c @@ -27,6 +27,11 @@ #include "texture.h" #include "menu.h" +#if defined(_MACGL) +// if you use it, you must include it +#include +#include +#endif //////////////////////////////////////////////////////////////////////////////////// // defines @@ -125,9 +130,13 @@ BOOL bGLExt; BOOL bGLFastMovie=FALSE; BOOL bGLSoft; BOOL bGLBlend; +#if defined (_MACGL) // always supported on OSX > 10.4.3 +#define glBlendEquationEXTEx glBlendEquationEXT +#define glColorTableEXTEx glColorTableEXT +#else PFNGLBLENDEQU glBlendEquationEXTEx=NULL; PFNGLCOLORTABLEEXT glColorTableEXTEx=NULL; - +#endif // gfx card buffer infos int iDepthFunc=0; @@ -215,7 +224,9 @@ void GetExtInfos(void) iClampType=GL_TO_EDGE_CLAMP; else iClampType=GL_CLAMP; +#if !defined (_MACGL) // OSX > 10.4.3 defines this glColorTableEXTEx=(PFNGLCOLORTABLEEXT)NULL; // init ogl palette func pointer +#endif #ifndef __sun if(iGPUHeight!=1024 && // no pal textures in ZN mode (height=1024)! @@ -226,11 +237,14 @@ void GetExtInfos(void) #ifdef _WINDOWS glColorTableEXTEx=(PFNGLCOLORTABLEEXT)wglGetProcAddress("glColorTableEXT"); +#elif defined (_MACGL) + // no prob, done already in OSX > 10.4.3 #else glColorTableEXTEx=(PFNGLCOLORTABLEEXT)glXGetProcAddress("glColorTableEXT"); #endif if(glColorTableEXTEx==NULL) iUsePalTextures=0; // -> ha, cheater... no func, no support + } else iUsePalTextures=0; #else @@ -261,13 +275,17 @@ void SetExtGLFuncs(void) if(wglSwapIntervalEXT) wglSwapIntervalEXT(iForceVSync); } #endif - +#ifdef _MACGL + SetVSync(iForceVSync); +#endif if(iUseExts && !(dwActFixes&1024) && // extensions wanted? and not turned off by game fix? strstr((char *)glGetString(GL_EXTENSIONS), // and blend_subtract available? "GL_EXT_blend_subtract")) { // -> get ogl blend function pointer #ifdef _WINDOWS glBlendEquationEXTEx=(PFNGLBLENDEQU)wglGetProcAddress("glBlendEquationEXT"); +#elif defined(_MACGL) + // no prob, OSX > 10.4.3 has this #else glBlendEquationEXTEx=(PFNGLBLENDEQU)glXGetProcAddress("glBlendEquationEXT"); #endif @@ -276,7 +294,9 @@ void SetExtGLFuncs(void) { if(glBlendEquationEXTEx) // -> change to additive blending (if subract was active) glBlendEquationEXTEx(FUNC_ADD_EXT); +#if !defined(_MACGL) // BTW, why set to null? strange... glBlendEquationEXTEx=(PFNGLBLENDEQU)NULL; // -> no more blend function pointer +#endif } //----------------------------------------------------// @@ -501,8 +521,24 @@ void CreateScanLines(void) { uiScanLine=glGenLists(1); glNewList(uiScanLine,GL_COMPILE); - - for(y=0;y