Remove OpenGL stuff from Globals.h. Stuff that doesn't use GL shouldn't include it.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@939 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-10-22 21:02:37 +00:00
parent 39df6c5624
commit 85781409e4
13 changed files with 82 additions and 75 deletions

View File

@ -1129,14 +1129,6 @@
> >
</File> </File>
</Filter> </Filter>
<File
RelativePath=".\Src\GLInit.cpp"
>
</File>
<File
RelativePath=".\Src\GLInit.h"
>
</File>
<File <File
RelativePath=".\Src\Globals.cpp" RelativePath=".\Src\Globals.cpp"
> >
@ -1193,6 +1185,14 @@
RelativePath=".\Src\Globals.h" RelativePath=".\Src\Globals.h"
> >
</File> </File>
<File
RelativePath=".\Src\GLUtil.cpp"
>
</File>
<File
RelativePath=".\Src\GLUtil.h"
>
</File>
<File <File
RelativePath=".\Src\main.cpp" RelativePath=".\Src\main.cpp"
> >

View File

@ -31,7 +31,7 @@ struct RECT
}; };
#endif #endif
#include "GLInit.h" #include "GLUtil.h"
#ifndef USE_SDL #ifndef USE_SDL
#define USE_SDL 0 #define USE_SDL 0

View File

@ -18,6 +18,66 @@
#ifndef _GLINIT_H #ifndef _GLINIT_H
#define _GLINIT_H #define _GLINIT_H
#ifdef _WIN32
#define GLEW_STATIC
#include <GLew/glew.h>
#include <GLew/wglew.h>
#include <GLew/gl.h>
#include <GLew/glext.h>
#else // linux basic definitions
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
#define I_NEED_OS2_H // HAXXOR
//#include <GL/glew.h>
#include <GL/glxew.h>
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
//#include <GL/glx.h>
#define __inline inline
#include <sys/timeb.h> // ftime(), struct timeb
inline unsigned long timeGetTime()
{
#ifdef _WIN32
_timeb t;
_ftime(&t);
#else
timeb t;
ftime(&t);
#endif
return (unsigned long)(t.time*1000+t.millitm);
}
#endif // linux basic definitions
#ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils
#define GL_DEPTH_STENCIL_EXT 0x84F9
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
#endif
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#ifdef _DEBUG
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#else
#define GL_REPORT_ERRORD()
#endif
#ifndef _WIN32 #ifndef _WIN32
#undef I_NEED_OS2_H #undef I_NEED_OS2_H

View File

@ -24,58 +24,6 @@
#include "Common.h" #include "Common.h"
#include "x64Emitter.h" #include "x64Emitter.h"
#ifdef _WIN32
#define GLEW_STATIC
#include <GLew/glew.h>
#include <GLew/wglew.h>
#include <GLew/gl.h>
#include <GLew/glext.h>
#else // linux basic definitions
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
#define I_NEED_OS2_H // HAXXOR
//#include <GL/glew.h>
#include <GL/glxew.h>
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
//#include <GL/glx.h>
#define __inline inline
#include <sys/timeb.h> // ftime(), struct timeb
inline unsigned long timeGetTime()
{
#ifdef _WIN32
_timeb t;
_ftime(&t);
#else
timeb t;
ftime(&t);
#endif
return (unsigned long)(t.time*1000+t.millitm);
}
#endif // linux basic definitions
#ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils
#define GL_DEPTH_STENCIL_EXT 0x84F9
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
#endif
#define ERROR_LOG __Log #define ERROR_LOG __Log
#if defined(_DEBUG) || defined(DEBUGFAST) #if defined(_DEBUG) || defined(DEBUGFAST)
@ -88,15 +36,6 @@ inline unsigned long timeGetTime()
#define DEBUG_LOG(...) #define DEBUG_LOG(...)
#endif #endif
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#ifdef _DEBUG
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#else
#define GL_REPORT_ERRORD()
#endif
#define CONF_LOG 1 #define CONF_LOG 1
#define CONF_PRIMLOG 2 #define CONF_PRIMLOG 2
#define CONF_SAVETEXTURES 4 #define CONF_SAVETEXTURES 4

View File

@ -16,12 +16,12 @@
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Globals.h" #include "Globals.h"
#include "GLUtil.h"
#include <stdio.h> #include <stdio.h>
#include <list> #include <list>
#include <vector> #include <vector>
#include "ImageWrite.h" #include "ImageWrite.h"
#if defined(_MSC_VER) #if defined(_MSC_VER)

View File

@ -18,6 +18,8 @@
#include "Globals.h" #include "Globals.h"
#include "Profiler.h" #include "Profiler.h"
#include "GLUtil.h"
#include <Cg/cg.h> #include <Cg/cg.h>
#include <Cg/cgGL.h> #include <Cg/cgGL.h>

View File

@ -19,6 +19,7 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include "GLUtil.h"
#include <Cg/cg.h> #include <Cg/cg.h>
#include <Cg/cgGL.h> #include <Cg/cgGL.h>
@ -27,7 +28,6 @@
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
#include "GLInit.h"
#include "Profiler.h" #include "Profiler.h"
#include "Statistics.h" #include "Statistics.h"
#include "ImageWrite.h" #include "ImageWrite.h"

View File

@ -9,7 +9,7 @@ import utils
files = [ files = [
'BPStructs.cpp', 'BPStructs.cpp',
'Globals.cpp', 'Globals.cpp',
'GLInit.cpp', 'GLUtil.cpp',
'main.cpp', 'main.cpp',
'memcpy_amd.cpp', 'memcpy_amd.cpp',
'OpcodeDecoding.cpp', 'OpcodeDecoding.cpp',

View File

@ -19,6 +19,8 @@
#define _TextureMngr_H #define _TextureMngr_H
#include <map> #include <map>
#include "GLUtil.h"
#include "BPStructs.h" #include "BPStructs.h"
struct TRectangle struct TRectangle

View File

@ -18,6 +18,8 @@
#include "Globals.h" #include "Globals.h"
#include "Profiler.h" #include "Profiler.h"
#include "GLUtil.h"
#include <Cg/cg.h> #include <Cg/cg.h>
#include <Cg/cgGL.h> #include <Cg/cgGL.h>

View File

@ -20,6 +20,8 @@
#include <map> #include <map>
#include "GLUtil.h"
struct VERTEXSHADER struct VERTEXSHADER
{ {
VERTEXSHADER() : glprogid(0) {} VERTEXSHADER() : glprogid(0) {}

View File

@ -19,8 +19,8 @@
// Preliminary non-working code. // Preliminary non-working code.
#include "Globals.h" #include "Globals.h"
#include "GLUtil.h"
#include "MemoryUtil.h" #include "MemoryUtil.h"
#include "GLInit.h"
#include "Render.h" #include "Render.h"
#include "TextureMngr.h" #include "TextureMngr.h"
#include "VertexShaderManager.h" #include "VertexShaderManager.h"

View File

@ -30,7 +30,7 @@
#include "LookUpTables.h" #include "LookUpTables.h"
#include "ImageWrite.h" #include "ImageWrite.h"
#include "Render.h" #include "Render.h"
#include "GLInit.h" #include "GLUtil.h"
#include "Fifo.h" #include "Fifo.h"
#include "OpcodeDecoding.h" #include "OpcodeDecoding.h"
#include "TextureMngr.h" #include "TextureMngr.h"