2010-04-25 00:31:27 +00:00
|
|
|
/*
|
2009-02-09 21:15:56 +00:00
|
|
|
* Copyright (C) 2007-2009 Gabest
|
|
|
|
* http://www.gabest.org
|
|
|
|
*
|
|
|
|
* This Program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* This Program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNU Make; see the file COPYING. If not, write to
|
2012-09-09 18:16:11 +00:00
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
|
2009-02-09 21:15:56 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
2013-01-04 15:47:11 +00:00
|
|
|
|
|
|
|
#include "stdafx.h"
|
2013-06-16 08:43:50 +00:00
|
|
|
#include "GSWnd.h"
|
|
|
|
|
|
|
|
void GSWndGL::PopulateGlFunction()
|
|
|
|
{
|
2013-07-13 11:39:45 +00:00
|
|
|
#ifndef ENABLE_GLES
|
2013-06-16 08:43:50 +00:00
|
|
|
*(void**)&(gl_ActiveTexture) = GetProcAddress("glActiveTexture");
|
|
|
|
*(void**)&(gl_BlendColor) = GetProcAddress("glBlendColor");
|
|
|
|
*(void**)&(gl_AttachShader) = GetProcAddress("glAttachShader");
|
|
|
|
*(void**)&(gl_BindBuffer) = GetProcAddress("glBindBuffer");
|
|
|
|
*(void**)&(gl_BindBufferBase) = GetProcAddress("glBindBufferBase");
|
|
|
|
*(void**)&(gl_BindFramebuffer) = GetProcAddress("glBindFramebuffer");
|
|
|
|
*(void**)&(gl_BindSampler) = GetProcAddress("glBindSampler");
|
|
|
|
*(void**)&(gl_BindVertexArray) = GetProcAddress("glBindVertexArray");
|
|
|
|
*(void**)&(gl_BlendEquationSeparate) = GetProcAddress("glBlendEquationSeparate");
|
|
|
|
*(void**)&(gl_BlendFuncSeparate) = GetProcAddress("glBlendFuncSeparate");
|
|
|
|
*(void**)&(gl_BlitFramebuffer) = GetProcAddress("glBlitFramebuffer");
|
|
|
|
*(void**)&(gl_BufferData) = GetProcAddress("glBufferData");
|
|
|
|
*(void**)&(gl_CheckFramebufferStatus) = GetProcAddress("glCheckFramebufferStatus");
|
|
|
|
*(void**)&(gl_ClearBufferfv) = GetProcAddress("glClearBufferfv");
|
|
|
|
*(void**)&(gl_ClearBufferiv) = GetProcAddress("glClearBufferiv");
|
2013-07-28 14:40:43 +00:00
|
|
|
*(void**)&(gl_ClearBufferuiv) = GetProcAddress("glClearBufferuiv");
|
2013-06-16 08:43:50 +00:00
|
|
|
*(void**)&(gl_CompileShader) = GetProcAddress("glCompileShader");
|
|
|
|
*(void**)&(gl_CreateProgram) = GetProcAddress("glCreateProgram");
|
|
|
|
*(void**)&(gl_CreateShader) = GetProcAddress("glCreateShader");
|
|
|
|
*(void**)&(gl_CreateShaderProgramv) = GetProcAddress("glCreateShaderProgramv");
|
|
|
|
*(void**)&(gl_DeleteBuffers) = GetProcAddress("glDeleteBuffers");
|
|
|
|
*(void**)&(gl_DeleteFramebuffers) = GetProcAddress("glDeleteFramebuffers");
|
|
|
|
*(void**)&(gl_DeleteProgram) = GetProcAddress("glDeleteProgram");
|
|
|
|
*(void**)&(gl_DeleteSamplers) = GetProcAddress("glDeleteSamplers");
|
|
|
|
*(void**)&(gl_DeleteShader) = GetProcAddress("glDeleteShader");
|
|
|
|
*(void**)&(gl_DeleteVertexArrays) = GetProcAddress("glDeleteVertexArrays");
|
|
|
|
*(void**)&(gl_DetachShader) = GetProcAddress("glDetachShader");
|
|
|
|
*(void**)&(gl_DrawBuffers) = GetProcAddress("glDrawBuffers");
|
|
|
|
*(void**)&(gl_DrawElementsBaseVertex) = GetProcAddress("glDrawElementsBaseVertex");
|
|
|
|
*(void**)&(gl_EnableVertexAttribArray) = GetProcAddress("glEnableVertexAttribArray");
|
|
|
|
*(void**)&(gl_FramebufferRenderbuffer) = GetProcAddress("glFramebufferRenderbuffer");
|
|
|
|
*(void**)&(gl_FramebufferTexture2D) = GetProcAddress("glFramebufferTexture2D");
|
|
|
|
*(void**)&(gl_GenBuffers) = GetProcAddress("glGenBuffers");
|
|
|
|
*(void**)&(gl_GenFramebuffers) = GetProcAddress("glGenFramebuffers");
|
|
|
|
*(void**)&(gl_GenSamplers) = GetProcAddress("glGenSamplers");
|
|
|
|
*(void**)&(gl_GenVertexArrays) = GetProcAddress("glGenVertexArrays");
|
|
|
|
*(void**)&(gl_GetBufferParameteriv) = GetProcAddress("glGetBufferParameteriv");
|
|
|
|
*(void**)&(gl_GetDebugMessageLogARB) = GetProcAddress("glGetDebugMessageLogARB");
|
|
|
|
*(void**)&(gl_GetProgramInfoLog) = GetProcAddress("glGetProgramInfoLog");
|
|
|
|
*(void**)&(gl_GetProgramiv) = GetProcAddress("glGetProgramiv");
|
|
|
|
*(void**)&(gl_GetShaderiv) = GetProcAddress("glGetShaderiv");
|
|
|
|
*(void**)&(gl_GetStringi) = GetProcAddress("glGetStringi");
|
|
|
|
*(void**)&(gl_IsFramebuffer) = GetProcAddress("glIsFramebuffer");
|
|
|
|
*(void**)&(gl_LinkProgram) = GetProcAddress("glLinkProgram");
|
|
|
|
*(void**)&(gl_MapBuffer) = GetProcAddress("glMapBuffer");
|
|
|
|
*(void**)&(gl_MapBufferRange) = GetProcAddress("glMapBufferRange");
|
|
|
|
*(void**)&(gl_ProgramParameteri) = GetProcAddress("glProgramParameteri");
|
|
|
|
*(void**)&(gl_SamplerParameterf) = GetProcAddress("glSamplerParameterf");
|
|
|
|
*(void**)&(gl_SamplerParameteri) = GetProcAddress("glSamplerParameteri");
|
|
|
|
*(void**)&(gl_ShaderSource) = GetProcAddress("glShaderSource");
|
|
|
|
*(void**)&(gl_Uniform1i) = GetProcAddress("glUniform1i");
|
|
|
|
*(void**)&(gl_UnmapBuffer) = GetProcAddress("glUnmapBuffer");
|
|
|
|
*(void**)&(gl_UseProgramStages) = GetProcAddress("glUseProgramStages");
|
|
|
|
*(void**)&(gl_VertexAttribIPointer) = GetProcAddress("glVertexAttribIPointer");
|
|
|
|
*(void**)&(gl_VertexAttribPointer) = GetProcAddress("glVertexAttribPointer");
|
|
|
|
*(void**)&(gl_BufferSubData) = GetProcAddress("glBufferSubData");
|
2013-07-06 10:08:52 +00:00
|
|
|
// GL4.1
|
|
|
|
*(void**)&(gl_BindProgramPipeline) = GetProcAddress("glBindProgramPipeline");
|
|
|
|
*(void**)&(gl_DeleteProgramPipelines) = GetProcAddress("glDeleteProgramPipelines");
|
|
|
|
*(void**)&(gl_GenProgramPipelines) = GetProcAddress("glGenProgramPipelines");
|
|
|
|
*(void**)&(gl_GetProgramPipelineiv) = GetProcAddress("glGetProgramPipelineiv");
|
|
|
|
*(void**)&(gl_GetProgramPipelineInfoLog) = GetProcAddress("glGetProgramPipelineInfoLog");
|
|
|
|
*(void**)&(gl_ValidateProgramPipeline) = GetProcAddress("glValidateProgramPipeline");
|
2013-06-16 08:43:50 +00:00
|
|
|
// NO GL4.1
|
|
|
|
*(void**)&(gl_UseProgram) = GetProcAddress("glUseProgram");
|
|
|
|
*(void**)&(gl_GetShaderInfoLog) = GetProcAddress("glGetShaderInfoLog");
|
|
|
|
*(void**)&(gl_ProgramUniform1i) = GetProcAddress("glProgramUniform1i");
|
|
|
|
// NO GL4.2
|
|
|
|
*(void**)&(gl_GetUniformBlockIndex) = GetProcAddress("glGetUniformBlockIndex");
|
|
|
|
*(void**)&(gl_UniformBlockBinding) = GetProcAddress("glUniformBlockBinding");
|
|
|
|
*(void**)&(gl_GetUniformLocation) = GetProcAddress("glGetUniformLocation");
|
2013-07-28 14:40:43 +00:00
|
|
|
// GL4.2
|
2013-08-03 08:29:01 +00:00
|
|
|
*(void**)&(gl_BindImageTexture) = GetProcAddress("glBindImageTexture", true);
|
|
|
|
*(void**)&(gl_MemoryBarrier) = GetProcAddress("glMemoryBarrier", true);
|
|
|
|
*(void**)&(gl_TexStorage2D) = GetProcAddress("glTexStorage2D");
|
|
|
|
// GL4.3
|
|
|
|
*(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
|
|
|
// GL4.4
|
|
|
|
*(void**)&(gl_ClearTexImage) = GetProcAddress("glCLearTexImage", true);
|
|
|
|
*(void**)&(gl_BindTextures) = GetProcAddress("glBindTextures", true);
|
|
|
|
*(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true);
|
2013-08-02 16:38:12 +00:00
|
|
|
|
2013-07-13 11:39:45 +00:00
|
|
|
#endif
|
2013-06-16 08:43:50 +00:00
|
|
|
}
|