gsdx-ogl: keep gl_ActiveTexture & gl_BlendColor (fix MS compilation)

It seems openGL ABI isn't exactly the same between Windows and my PC.
This commit is contained in:
Gregory Hainaut 2015-10-18 11:16:54 +02:00
parent 42a4c7d368
commit f99882c61c
4 changed files with 14 additions and 2 deletions

View File

@ -22,6 +22,9 @@
#include "GLLoader.h"
#include "GSdx.h"
PFNGLACTIVETEXTUREPROC gl_ActiveTexture = NULL;
PFNGLBLENDCOLORPROC gl_BlendColor = NULL;
PFNGLATTACHSHADERPROC glAttachShader = NULL;
PFNGLBINDBUFFERPROC glBindBuffer = NULL;
PFNGLBINDBUFFERBASEPROC glBindBufferBase = NULL;
@ -150,7 +153,7 @@ PFNGLBLENDCOLORPROC glBlendColor = NUL
namespace Emulate_DSA {
// Texture entry point
void APIENTRY BindTextureUnit(GLuint unit, GLuint texture) {
glActiveTexture(GL_TEXTURE0 + unit);
gl_ActiveTexture(GL_TEXTURE0 + unit);
glBindTexture(GL_TEXTURE_2D, texture);
}

View File

@ -183,6 +183,12 @@ typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
#endif /* GL_VERSION_4_5 */
// 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 PFNGLACTIVETEXTUREPROC gl_ActiveTexture;
extern PFNGLBLENDCOLORPROC gl_BlendColor;
extern PFNGLATTACHSHADERPROC glAttachShader;
extern PFNGLBINDBUFFERPROC glBindBuffer;
extern PFNGLBINDBUFFERBASEPROC glBindBufferBase;

View File

@ -1356,7 +1356,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;
glBlendColor(bf, bf, bf, bf);
gl_BlendColor(bf, bf, bf, bf);
}
const OGLBlend& b = m_blendMapOGL[blend_index];

View File

@ -25,6 +25,9 @@
void GSWndGL::PopulateGlFunction()
{
*(void**)&(gl_ActiveTexture) = GetProcAddress("glActiveTexture");
*(void**)&(gl_BlendColor) = GetProcAddress("glBlendColor");
*(void**)&(glBlendEquationSeparate) = GetProcAddress("glBlendEquationSeparate");
*(void**)&(glBlendFuncSeparate) = GetProcAddress("glBlendFuncSeparate");
*(void**)&(glAttachShader) = GetProcAddress("glAttachShader");