win32: switch to OpenGL Loader Generator files

This commit is contained in:
OV2 2018-05-20 17:25:39 +02:00
parent 94f90fc94b
commit af71ef55cd
10 changed files with 6937 additions and 10142 deletions

View File

@ -264,17 +264,9 @@ bool CGLCG::LoadFBOFunctions()
const char *extensions = (const char *) glGetString(GL_EXTENSIONS);
if(extensions && strstr(extensions, "framebuffer_object")) {
glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)wglGetProcAddress("glGenFramebuffers");
glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)wglGetProcAddress("glDeleteFramebuffers");
glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)wglGetProcAddress("glBindFramebuffer");
glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)wglGetProcAddress("glFramebufferTexture2D");
glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)wglGetProcAddress("glCheckFramebufferStatus");
glClientActiveTexture = (PFNGLACTIVETEXTUREPROC)wglGetProcAddress("glClientActiveTexture");
if(glGenFramebuffers && glDeleteFramebuffers && glBindFramebuffer && glFramebufferTexture2D && glClientActiveTexture) {
fboFunctionsLoaded = true;
}
}
return fboFunctionsLoaded;
}

View File

@ -192,8 +192,7 @@
#define CGGLCG_H
#include <windows.h>
#include <gl/gl.h>
#include "glext.h"
#include "gl_core_3_1.h"
#include "cgFunctions.h"
#include "CCGShader.h"
#include <vector>
@ -276,13 +275,6 @@ private:
static const GLfloat lut_coords[8];
PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
PFNGLACTIVETEXTUREPROC glClientActiveTexture;
public:
CGLCG(CGcontext cgContext);
~CGLCG(void);

View File

@ -281,6 +281,8 @@ bool COpenGL::Initialize(HWND hWnd)
return false;
}
ogl_LoadFunctions();
LoadPBOFunctions();
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress( "wglSwapIntervalEXT" );
@ -641,12 +643,6 @@ bool COpenGL::LoadPBOFunctions()
const char *extensions = (const char *) glGetString(GL_EXTENSIONS);
if(extensions && strstr(extensions, "pixel_buffer_object")) {
glGenBuffers = (PFNGLGENBUFFERSPROC)wglGetProcAddress("glGenBuffers");
glBindBuffer = (PFNGLBINDBUFFERPROC)wglGetProcAddress("glBindBuffer");
glBufferData = (PFNGLBUFFERDATAPROC)wglGetProcAddress("glBufferData");
glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)wglGetProcAddress("glDeleteBuffers");
glMapBuffer = (PFNGLMAPBUFFERPROC)wglGetProcAddress("glMapBuffer");
glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)wglGetProcAddress("glUnmapBuffer");
if(glGenBuffers && glBindBuffer && glBufferData && glDeleteBuffers && glMapBuffer) {
pboFunctionsLoaded = true;
@ -664,18 +660,6 @@ bool COpenGL::LoadShaderFunctions()
const char *extensions = (const char *) glGetString(GL_EXTENSIONS);
if(extensions && strstr(extensions, "fragment_program")) {
glCreateProgram = (PFNGLCREATEPROGRAMPROC) wglGetProcAddress ("glCreateProgram");
glCreateShader = (PFNGLCREATESHADERPROC) wglGetProcAddress ("glCreateShader");
glCompileShader = (PFNGLCOMPILESHADERPROC) wglGetProcAddress ("glCompileShader");
glDeleteShader = (PFNGLDELETESHADERPROC) wglGetProcAddress ("glDeleteShader");
glDeleteProgram = (PFNGLDELETEPROGRAMPROC) wglGetProcAddress ("glDeleteProgram");
glAttachShader = (PFNGLATTACHSHADERPROC) wglGetProcAddress ("glAttachShader");
glDetachShader = (PFNGLDETACHSHADERPROC) wglGetProcAddress ("glDetachShader");
glLinkProgram = (PFNGLLINKPROGRAMPROC) wglGetProcAddress ("glLinkProgram");
glUseProgram = (PFNGLUSEPROGRAMPROC) wglGetProcAddress ("glUseProgram");
glShaderSource = (PFNGLSHADERSOURCEPROC) wglGetProcAddress ("glShaderSource");
glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) wglGetProcAddress ("glGetUniformLocation");
glUniform2fv = (PFNGLUNIFORM2FVPROC) wglGetProcAddress ("glUniform2fv");
if(glCreateProgram &&
glCreateShader &&

View File

@ -195,11 +195,10 @@
#define COPENGL_H
#include <windows.h>
#include <gl\gl.h>
#include "gl_core_3_1.h"
#include "cgFunctions.h"
#include "CGLCG.h"
#include "glext.h"
#include "wglext.h"
#include "IS9xDisplayOutput.h"
@ -240,29 +239,6 @@ private:
GLuint vertexShader;
GLuint fragmentShader;
// PBO Functions
PFNGLGENBUFFERSPROC glGenBuffers;
PFNGLBINDBUFFERPROC glBindBuffer;
PFNGLBUFFERDATAPROC glBufferData;
PFNGLDELETEBUFFERSPROC glDeleteBuffers;
PFNGLMAPBUFFERPROC glMapBuffer;
PFNGLUNMAPBUFFERPROC glUnmapBuffer;
// Shader Functions
PFNGLCREATEPROGRAMPROC glCreateProgram;
PFNGLCREATESHADERPROC glCreateShader;
PFNGLCOMPILESHADERPROC glCompileShader;
PFNGLDELETESHADERPROC glDeleteShader;
PFNGLDELETEPROGRAMPROC glDeleteProgram;
PFNGLATTACHSHADERPROC glAttachShader;
PFNGLDETACHSHADERPROC glDetachShader;
PFNGLLINKPROGRAMPROC glLinkProgram;
PFNGLUSEPROGRAMPROC glUseProgram;
PFNGLSHADERSOURCEPROC glShaderSource;
PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
PFNGLUNIFORM2FVPROC glUniform2fv;
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;
bool SetShaders(const TCHAR *file);

View File

@ -193,7 +193,7 @@
#define CGMINI_H
#include <d3d9.h>
#include <gl/GL.h>
#include "gl_core_3_1.h"
#define CGENTRY __cdecl
#define CGD3D9ENTRY __cdecl

3206
win32/gl_core_3_1.c Normal file

File diff suppressed because it is too large Load Diff

3718
win32/gl_core_3_1.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -428,6 +428,7 @@
<ClInclude Include="CXML.h" />
<ClInclude Include="dxerr.h" />
<ClInclude Include="globals.h" />
<ClInclude Include="gl_core_3_1.h" />
<ClInclude Include="InputCustom.h" />
<ClInclude Include="IS9xDisplayOutput.h" />
<ClInclude Include="IS9xSoundOutput.h" />
@ -557,6 +558,7 @@
<ClCompile Include="CXML.cpp" />
<ClCompile Include="DumpAtEnd.cpp" />
<ClCompile Include="dxerr.cpp" />
<ClCompile Include="gl_core_3_1.c" />
<ClCompile Include="InputCustom.cpp" />
<ClCompile Include="render.cpp" />
<ClCompile Include="snes_ntsc.c" />

View File

@ -255,6 +255,9 @@
<ClInclude Include="..\filter\xbrz_tools.h">
<Filter>Filter</Filter>
</ClInclude>
<ClInclude Include="gl_core_3_1.h">
<Filter>GUI\VideoDriver</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\bsx.cpp">
@ -557,6 +560,9 @@
<ClCompile Include="DumpAtEnd.cpp">
<Filter>GUI</Filter>
</ClCompile>
<ClCompile Include="gl_core_3_1.c">
<Filter>GUI\VideoDriver</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="rsrc\nodrop.cur">