mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Unix fixes.
This commit is contained in:
parent
2a1a2d5c00
commit
c1c09d4d56
|
@ -59,6 +59,12 @@ set(GLideN64_SOURCES
|
|||
DepthBufferRender/ClipPolygon.cpp
|
||||
DepthBufferRender/DepthBufferRender.cpp
|
||||
common/CommonAPIImpl_common.cpp
|
||||
Graphics/Context.cpp
|
||||
Graphics/OpenGLContext/GLFunctions.cpp
|
||||
Graphics/OpenGLContext/opengl_ContextImpl.cpp
|
||||
Graphics/OpenGLContext/opengl_Parameters.cpp
|
||||
Graphics/OpenGLContext/opengl_TextureManipulationObjectFactory.cpp
|
||||
Graphics/OpenGLContext/opengl_Utilis.cpp
|
||||
)
|
||||
|
||||
#check if we're running on Raspberry Pi
|
||||
|
|
|
@ -2,10 +2,16 @@
|
|||
|
||||
#ifdef OS_WINDOWS
|
||||
#define glGetProcAddress wglGetProcAddress
|
||||
#else
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) proc_name = (proc_type) glGetProcAddress(#proc_name)
|
||||
#elif defined(OS_LINUX)
|
||||
#define glGetProcAddress glXGetProcAddress
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) proc_name = (proc_type) glGetProcAddress((const GLubyte*)#proc_name)
|
||||
#endif
|
||||
|
||||
#ifdef OS_WINDOWS
|
||||
PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||
PFNGLBLENDCOLORPROC glBlendColor;
|
||||
#endif
|
||||
// GLSL functions
|
||||
PFNGLCREATESHADERPROC glCreateShader;
|
||||
PFNGLCOMPILESHADERPROC glCompileShader;
|
||||
|
@ -39,10 +45,8 @@ PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f;
|
|||
PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv;
|
||||
|
||||
// multitexture functions
|
||||
PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||
PFNGLDEPTHRANGEFPROC glDepthRangef;
|
||||
PFNGLCLEARDEPTHFPROC glClearDepthf;
|
||||
PFNGLBLENDCOLORPROC glBlendColor;
|
||||
|
||||
PFNGLDRAWBUFFERSPROC glDrawBuffers;
|
||||
PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
|
||||
|
@ -91,10 +95,12 @@ PFNGLTEXTURESTORAGE2DPROC glTextureStorage2D;
|
|||
PFNGLTEXTURESUBIMAGE2DPROC glTextureSubImage2D;
|
||||
PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glTextureStorage2DMultisample;
|
||||
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) proc_name = (proc_type) glGetProcAddress(#proc_name)
|
||||
|
||||
void initGLFunctions()
|
||||
{
|
||||
#ifdef OS_WINDOWS
|
||||
GL_GET_PROC_ADR(PFNGLACTIVETEXTUREPROC, glActiveTexture);
|
||||
GL_GET_PROC_ADR(PFNGLBLENDCOLORPROC, glBlendColor);
|
||||
#endif
|
||||
GL_GET_PROC_ADR(PFNGLCREATESHADERPROC, glCreateShader);
|
||||
GL_GET_PROC_ADR(PFNGLCOMPILESHADERPROC, glCompileShader);
|
||||
GL_GET_PROC_ADR(PFNGLSHADERSOURCEPROC, glShaderSource);
|
||||
|
@ -126,10 +132,8 @@ void initGLFunctions()
|
|||
GL_GET_PROC_ADR(PFNGLVERTEXATTRIB4FPROC, glVertexAttrib4f);
|
||||
GL_GET_PROC_ADR(PFNGLVERTEXATTRIB4FVPROC, glVertexAttrib4fv);
|
||||
|
||||
GL_GET_PROC_ADR(PFNGLACTIVETEXTUREPROC, glActiveTexture);
|
||||
GL_GET_PROC_ADR(PFNGLDEPTHRANGEFPROC, glDepthRangef);
|
||||
GL_GET_PROC_ADR(PFNGLCLEARDEPTHFPROC, glClearDepthf);
|
||||
GL_GET_PROC_ADR(PFNGLBLENDCOLORPROC, glBlendColor);
|
||||
|
||||
GL_GET_PROC_ADR(PFNGLDRAWBUFFERSPROC, glDrawBuffers);
|
||||
GL_GET_PROC_ADR(PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer);
|
||||
|
|
|
@ -3,13 +3,20 @@
|
|||
|
||||
#ifdef OS_WINDOWS
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include >winlnxdefs.h>
|
||||
#elif defined(OS_LINUX)
|
||||
//#define GL_GLEXT_PROTOTYPES
|
||||
#include <winlnxdefs.h>
|
||||
#include <GL/glx.h>
|
||||
#include <GL/glxext.h>
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
#ifdef OS_WINDOWS
|
||||
extern PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||
extern PFNGLBLENDCOLORPROC glBlendColor;
|
||||
#endif
|
||||
extern PFNGLCREATESHADERPROC glCreateShader;
|
||||
extern PFNGLCOMPILESHADERPROC glCompileShader;
|
||||
extern PFNGLSHADERSOURCEPROC glShaderSource;
|
||||
|
@ -42,10 +49,8 @@ extern PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation;
|
|||
extern PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f;
|
||||
extern PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv;
|
||||
|
||||
extern PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||
extern PFNGLDEPTHRANGEFPROC glDepthRangef;
|
||||
extern PFNGLCLEARDEPTHFPROC glClearDepthf;
|
||||
extern PFNGLBLENDCOLORPROC glBlendColor;
|
||||
|
||||
extern PFNGLDRAWBUFFERSPROC glDrawBuffers;
|
||||
extern PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
|
||||
|
|
Loading…
Reference in New Issue
Block a user