gsdx-ogl: clean partially the GL1 mess

Remaining will require a move to glcorearb.h
This commit is contained in:
Gregory Hainaut 2019-02-01 11:34:59 +01:00
parent 4f09124f19
commit 8a723b3be8
4 changed files with 17 additions and 19 deletions

View File

@ -23,10 +23,9 @@
#include "GSdx.h"
#include "GS.h"
// GL1.x mess
PFNGLBLENDCOLORPROC gl_BlendColor = NULL;
PFNGLACTIVETEXTUREPROC gl_ActiveTexture = NULL;
#ifdef __unix__
PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate = NULL;
#endif
#include "PFN_GLLOADER_CPP.h"
@ -52,7 +51,7 @@ namespace ReplaceGL {
namespace Emulate_DSA {
// Texture entry point
void APIENTRY BindTextureUnit(GLuint unit, GLuint texture) {
gl_ActiveTexture(GL_TEXTURE0 + unit);
glActiveTexture(GL_TEXTURE0 + unit);
glBindTexture(GL_TEXTURE_2D, texture);
}

View File

@ -221,14 +221,17 @@ typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level,
// #define ENABLE_GL_KHR_blend_equation_advanced 1
// #define ENABLE_GL_KHR_parallel_shader_compile 1
// Dark age of openGL. Potentially it should be fixed with a migration
// to the new header glcorearb.h. But we need to check old distribution
// support first
// Dark age of openGL. GL_10 and GL_11 are provided by opengl32.dll on windows.
// Linux is a royal mess
//
// #define ENABLE_GL_VERSION_1_0 1
// #define ENABLE_GL_VERSION_1_1 1
// #define ENABLE_GL_VERSION_1_2 1
// #define ENABLE_GL_VERSION_1_3 1
// #define ENABLE_GL_VERSION_1_4 1
#ifdef _WIN32
#define ENABLE_GL_VERSION_1_2 1
#define ENABLE_GL_VERSION_1_3 1
#define ENABLE_GL_VERSION_1_4 1
#endif
#define ENABLE_GL_VERSION_1_5 1
#define ENABLE_GL_VERSION_2_0 1
#define ENABLE_GL_VERSION_2_1 1
@ -244,12 +247,10 @@ typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level,
#define ENABLE_GL_VERSION_4_5 1
// #define ENABLE_GL_VERSION_4_6 1
// Note: glActiveTexture & glBlendColor aren't included in the win GL ABI.
// (maybe gl.h is outdated, or my setup is wrong)
// Anyway, let's just keep the mangled function pointer for those 2 functions.
extern PFNGLBLENDCOLORPROC gl_BlendColor;
extern PFNGLACTIVETEXTUREPROC gl_ActiveTexture;
// It should be done by ENABLE_GL_VERSION_1_4 but it conflicts with the old gl.h
#ifdef __unix__
extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate;
#endif
#include "PFN_GLLOADER_HPP.h"

View File

@ -1719,7 +1719,7 @@ void GSDeviceOGL::OMSetBlendState(uint8 blend_index, uint8 blend_factor, bool is
if (is_blend_constant && GLState::bf != blend_factor) {
GLState::bf = blend_factor;
float bf = (float)blend_factor / 128.0f;
gl_BlendColor(bf, bf, bf, bf);
glBlendColor(bf, bf, bf, bf);
}
OGLBlend b = m_blendMapOGL[blend_index];

View File

@ -33,10 +33,8 @@ void GSWndGL::PopulateGlFunction()
#include "PFN_WND.h"
// GL1.X mess
*(void**)&(gl_BlendColor) = GetProcAddress("glBlendColor");
#ifdef __unix__
GL_EXT_LOAD(glBlendFuncSeparate);
#ifdef _WIN32
*(void**)&(gl_ActiveTexture) = GetProcAddress("glActiveTexture");
#endif
// Check openGL requirement as soon as possible so we can switch to another