//-----------------------------------------------------------------------------------------------
// OpenGLExtensions.hpp
//
// Handles dynamic loading of any functions not automatically available to us at compile-time.
//-----------------------------------------------------------------------------------------------
#pragma once
#ifndef included_OpenGLExtensions
#define included_OpenGLExtensions
#include "Engine/Core/PlatformDefines.hpp"


//-----------------------------------------------------------------------------------------------
// OpenGL includes
//
#if defined( PLATFORM_WINDOWS )
#include "Engine/Core/PlatformSpecificHeaders.hpp"
#endif

#include <gl/gl.h>
#include <gl/glu.h>
#include "ThirdParty/OpenGL/glext.h"

#if defined( PLATFORM_WINDOWS )
#include "ThirdParty/OpenGL/wglext.h"
#endif


//-----------------------------------------------------------------------------------------------
// Utility functions
//
void BindAdvancedOpenGLFunctionPointers();


//-----------------------------------------------------------------------------------------------
// Global OpenGL function pointers
//
extern PFNGLACTIVETEXTUREPROC				glActiveTexture;
extern PFNGLATTACHSHADERPROC				glAttachShader;
extern PFNGLBINDATTRIBLOCATIONPROC			glBindAttribLocation;
extern PFNGLBINDBUFFERPROC					glBindBuffer;
extern PFNGLBINDFRAMEBUFFERPROC				glBindFramebuffer;
extern PFNGLBUFFERDATAPROC					glBufferData;
extern PFNGLCOMPILESHADERPROC				glCompileShader;
extern PFNGLCREATEPROGRAMPROC				glCreateProgram;
extern PFNGLCREATESHADERPROC				glCreateShader;
extern PFNGLDELETEBUFFERSPROC				glDeleteBuffers;
extern PFNGLDISABLEVERTEXATTRIBARRAYPROC	glDisableVertexAttribArray;
extern PFNGLENABLEVERTEXATTRIBARRAYPROC		glEnableVertexAttribArray;
extern PFNGLFRAMEBUFFERTEXTURE2DPROC		glFramebufferTexture2D;
extern PFNGLGENBUFFERSPROC					glGenBuffers;
extern PFNGLGENFRAMEBUFFERSPROC				glGenFramebuffers;
extern PFNGLGETATTRIBLOCATIONPROC			glGetAttribLocation;
extern PFNGLGETPROGRAMINFOLOGPROC			glGetProgramInfoLog;
extern PFNGLGETPROGRAMIVPROC				glGetProgramiv;
extern PFNGLGETSHADERINFOLOGPROC			glGetShaderInfoLog;
extern PFNGLGETSHADERIVPROC					glGetShaderiv;
extern PFNGLGETUNIFORMLOCATIONPROC			glGetUniformLocation;
extern PFNGLLINKPROGRAMPROC					glLinkProgram;
extern PFNGLSHADERSOURCEPROC				glShaderSource;
extern PFNGLUNIFORM1FPROC					glUniform1f;
extern PFNGLUNIFORM2FPROC					glUniform2f;
extern PFNGLUNIFORM3FPROC					glUniform3f;
extern PFNGLUNIFORM4FPROC					glUniform4f;
extern PFNGLUNIFORM1IPROC					glUniform1i;
extern PFNGLUNIFORM2IPROC					glUniform2i;
extern PFNGLUNIFORM3IPROC					glUniform3i;
extern PFNGLUNIFORM4IPROC					glUniform4i;
extern PFNGLUNIFORM1UIPROC					glUniform1ui;
extern PFNGLUNIFORM2UIPROC					glUniform2ui;
extern PFNGLUNIFORM3UIPROC					glUniform3ui;
extern PFNGLUNIFORM4UIPROC					glUniform4ui;
extern PFNGLUNIFORM1FVPROC					glUniform1fv;
extern PFNGLUNIFORM2FVPROC					glUniform2fv;
extern PFNGLUNIFORM3FVPROC					glUniform3fv;
extern PFNGLUNIFORM4FVPROC					glUniform4fv;
extern PFNGLUNIFORMMATRIX4FVPROC			glUniformMatrix4fv;
extern PFNGLUSEPROGRAMPROC					glUseProgram;
extern PFNGLVERTEXATTRIB1FPROC				glVertexAttrib1f;
extern PFNGLVERTEXATTRIB1FVPROC				glVertexAttrib1fv;
extern PFNGLVERTEXATTRIB2FPROC				glVertexAttrib2f;
extern PFNGLVERTEXATTRIB2FVPROC				glVertexAttrib2fv;
extern PFNGLVERTEXATTRIB3FPROC				glVertexAttrib3f;
extern PFNGLVERTEXATTRIB3FVPROC				glVertexAttrib3fv;
extern PFNGLVERTEXATTRIB4FPROC				glVertexAttrib4f;
extern PFNGLVERTEXATTRIB4FVPROC				glVertexAttrib4fv;
extern PFNGLVERTEXATTRIB4NUBVPROC			glVertexAttrib4Nubv;
extern PFNGLVERTEXATTRIB4UBVPROC			glVertexAttrib4ubv;
extern PFNGLVERTEXATTRIBPOINTERPROC			glVertexAttribPointer;

#endif // included_OpenGLExtensions
