mirror of
https://github.com/edubart/otclient.git
synced 2025-10-18 21:43:26 +02:00
make work on win32 again using GLEW
This commit is contained in:
@@ -24,12 +24,13 @@
|
||||
#ifndef GLUTIL_H
|
||||
#define GLUTIL_H
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
|
||||
#ifndef OPENGL_ES2
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
//#include <GL/gl.h>
|
||||
//#include <GL/glext.h>
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
#endif
|
||||
|
@@ -30,6 +30,18 @@ Graphics g_graphics;
|
||||
|
||||
void Graphics::init()
|
||||
{
|
||||
#ifndef OPENGL_ES2
|
||||
// init GL extensions
|
||||
GLenum err = glewInit();
|
||||
if(err != GLEW_OK)
|
||||
logFatal("Unable to init GLEW: ", glewGetErrorString(err));
|
||||
if(!GLEW_ARB_vertex_program || !GLEW_ARB_vertex_shader ||
|
||||
!GLEW_ARB_fragment_program || !GLEW_ARB_fragment_shader ||
|
||||
!GLEW_ARB_framebuffer_object ||
|
||||
!GLEW_ARB_multitexture)
|
||||
logFatal("Your video driver is not supported");
|
||||
#endif
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
|
Reference in New Issue
Block a user