\r
#define _IN_DRAW\r
\r
-#ifdef _WINDOWS\r
-#include "stdafx.h"\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <math.h>\r
-#include "externals.h"\r
-#include "gpu.h"\r
-#include "draw.h"\r
-#include "prim.h"\r
-#include "texture.h"\r
-#else\r
+\r
#include "gpuExternals.h"\r
#include "gpuPlugin.h"\r
#include "gpuDraw.h"\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <math.h>\r
-#endif\r
//#include "menu.h"\r
\r
////////////////////////////////////////////////////////////////////////////////////\r
////////////////////////////////////////////////////////////////////////////////////\r
// draw globals\r
\r
-#ifdef _WINDOWS\r
-HDC dcGlobal=NULL;\r
-HWND hWWindow;\r
-#else\r
void glBlendEquationEXT(GLenum mode);\r
void glColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format,GLenum type, const GLvoid *data);\r
-#endif\r
\r
// draw globals; most will be initialized again later (by config or checks) \r
\r
// Set OGL pixel format\r
////////////////////////////////////////////////////////////////////////\r
\r
-#ifdef _WINDOWS\r
-BOOL bSetupPixelFormat(HDC hDC)\r
-{\r
- int pixelformat;\r
- static PIXELFORMATDESCRIPTOR pfd = \r
- {\r
- sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd\r
- 1, // version number\r
- PFD_DRAW_TO_WINDOW | // support window\r
- PFD_SUPPORT_OPENGL | // support OpenGL\r
- PFD_DOUBLEBUFFER, // double buffered\r
- PFD_TYPE_RGBA, // RGBA type\r
- 16, // 16-bit color depth (adjusted later)\r
- 0, 0, 0, 0, 0, 0, // color bits ignored\r
- 0, // no alpha buffer\r
- 0, // shift bit ignored\r
- 0, // no accumulation buffer\r
- 0, 0, 0, 0, // accum bits ignored\r
- 0, // z-buffer \r
- 0,\r
- 0, // no auxiliary buffer\r
- PFD_MAIN_PLANE, // main layer\r
- 0, // reserved\r
- 0, 0, 0 // layer masks ignored\r
- };\r
- \r
- pfd.cColorBits=iColDepth; // set user color depth\r
- pfd.cDepthBits=iZBufferDepth; // set user zbuffer (by psx mask)\r
-\r
- if((pixelformat=ChoosePixelFormat(hDC,&pfd))==0) \r
- {\r
- MessageBox(NULL,"ChoosePixelFormat failed","Error",MB_OK);\r
- return FALSE;\r
- }\r
-\r
- if(SetPixelFormat(hDC,pixelformat, &pfd)==FALSE)\r
- {\r
- MessageBox(NULL,"SetPixelFormat failed","Error",MB_OK);\r
- return FALSE;\r
- }\r
-\r
- return TRUE;\r
-}\r
-#endif\r
\r
////////////////////////////////////////////////////////////////////////\r
// Get extension infos (f.e. pal textures / packed pixels)\r
bPacked=TRUE; // -> ok\r
\r
\r
- #ifdef _WINDOWS\r
- iClampType=GL_CLAMP;\r
-#else\r
iClampType=GL_CLAMP_TO_EDGE;\r
-#endif\r
}\r
\r
////////////////////////////////////////////////////////////////////////\r
// Initialize OGL\r
////////////////////////////////////////////////////////////////////////\r
\r
-#ifdef _WINDOWS \r
-HGLRC GLCONTEXT=NULL;\r
-#endif\r
-\r
#define MODE_RAW 0\r
#define MODE_X11 1\r
#define MODE_SDL 2\r
\r
int GLinitialize() \r
{\r
- //----------------------------------------------------// \r
-#ifdef _WINDOWS\r
- HGLRC objectRC;\r
- // init\r
- dcGlobal = GetDC(hWWindow); // FIRST: dc/rc stuff\r
- objectRC = wglCreateContext(dcGlobal); \r
- GLCONTEXT=objectRC;\r
- wglMakeCurrent(dcGlobal, objectRC);\r
- // CheckWGLExtensions(dcGlobal);\r
- if(bWindowMode) ReleaseDC(hWWindow,dcGlobal); // win mode: release dc again\r
-#endif\r
initEGL();\r
\r
//----------------------------------------------------// \r
{ \r
CleanupTextureStore(); // bye textures\r
\r
-#ifdef _WINDOWS \r
- wglMakeCurrent(NULL, NULL); // bye context\r
- if(GLCONTEXT) wglDeleteContext(GLCONTEXT);\r
- if(!bWindowMode && dcGlobal) \r
- ReleaseDC(hWWindow,dcGlobal);\r
-#endif\r
-\r
eglMakeCurrent( display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );\r
eglDestroySurface( display, surface );\r
eglDestroyContext( display, context );\r
// render pos / buffers\r
////////////////////////////////////////////////////////////////////////\r
\r
-#ifndef _WINDOWS\r
#define EqualRect(pr1,pr2) ((pr1)->left==(pr2)->left && (pr1)->top==(pr2)->top && (pr1)->right==(pr2)->right && (pr1)->bottom==(pr2)->bottom)\r
-#endif\r
\r
////////////////////////////////////////////////////////////////////////\r
// SetDisplaySettings: "simply" calcs the new drawing area and updates\r