Remove last vestiges of GLEW
authorraptor <buckyballreaction@gmail.com>
Sun, 25 Aug 2019 19:39:29 -0600
changeset 15376 5c0479d0ed5b
parent 15375 dff37ac61dcf
child 15383 c8f37fc9c266
Remove last vestiges of GLEW
hedgewars/pas2cSystem.pas
hedgewars/uRender.pas
project_files/hwc/CMakeLists.txt
project_files/hwc/rtl/CMakeLists.txt
project_files/hwc/rtl/fpcrtl.h
project_files/hwc/rtl/misc.c
project_files/hwc/rtl/misc.h
--- a/hedgewars/pas2cSystem.pas	Sun Aug 25 23:43:46 2019 +0300
+++ b/hedgewars/pas2cSystem.pas	Sun Aug 25 19:39:29 2019 -0600
@@ -95,7 +95,7 @@
     glDeleteShader, glGetProgramiv, glGetProgramInfoLog, glUseProgram,
     glUniform1i, glGetUniformLocation, glEnableVertexAttribArray,
     glGetError, glDeleteProgram, glDeleteBuffers,
-    glGenBuffers, glBufferData, glBindBuffer, glewInit,
+    glGenBuffers, glBufferData, glBindBuffer,
     glUniform4f, glDisableVertexAttribArray, glTexEnvi,
     glLoadMatrixf, glMultMatrixf, glGetFloatv,
     glDrawBuffer, glReadBuffer: procedure;
@@ -114,7 +114,7 @@
     GL_RENDERBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
     GL_COLOR_ATTACHMENT0_EXT, GL_FLOAT, GL_UNSIGNED_BYTE, GL_COMPILE_STATUS,
     GL_INFO_LOG_LENGTH, GL_LINK_STATUS, GL_VERTEX_SHADER, GL_FRAGMENT_SHADER,
-    GL_NO_ERROR, GL_ARRAY_BUFFER, GL_STATIC_DRAW, GLEW_OK,
+    GL_NO_ERROR, GL_ARRAY_BUFFER, GL_STATIC_DRAW,
     GL_AUX_BUFFERS, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE, GL_ADD,
     GL_MODELVIEW_MATRIX, GL_AUX0, GL_BACK: integer;
 
--- a/hedgewars/uRender.pas	Sun Aug 25 23:43:46 2019 +0300
+++ b/hedgewars/uRender.pas	Sun Aug 25 19:39:29 2019 -0600
@@ -520,14 +520,6 @@
 
 {$IFDEF GL2}
 
-{$IFDEF PAS2C}
-    if glewInit() <> GLEW_OK then
-        begin
-        WriteLnToConsole('Failed to initialize GLEW.');
-        halt(HaltStartupError);
-        end;
-{$ENDIF}
-
 {$IFNDEF PAS2C}
     if not Load_GL_VERSION_2_0 then
         begin
--- a/project_files/hwc/CMakeLists.txt	Sun Aug 25 23:43:46 2019 +0300
+++ b/project_files/hwc/CMakeLists.txt	Sun Aug 25 19:39:29 2019 -0600
@@ -1,6 +1,5 @@
 #the usual set of dependencies
 find_package(OpenGL REQUIRED)
-find_package(GLEW REQUIRED)
 find_package(SDL2 REQUIRED)
 find_package(SDL2_mixer 2 REQUIRED)
 find_package(SDL2_net 2 REQUIRED)
@@ -8,7 +7,6 @@
 find_package(SDL2_ttf 2 REQUIRED)
 
 #compile our rtl implementation
-include_directories(${GLEW_INCLUDE_DIR})
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rtl)
 include_directories(${PHYSFS_INCLUDE_DIR})
 include_directories(${PHYSLAYER_INCLUDE_DIR})
@@ -115,7 +113,6 @@
                                 ${SDL2_NET_LIBRARIES}
                                 ${SDL2_IMAGE_LIBRARIES}
                                 ${SDL2_TTF_LIBRARIES}
-                                ${GLEW_LIBRARY}
                                 physfs
                                 physlayer
                                 m
--- a/project_files/hwc/rtl/CMakeLists.txt	Sun Aug 25 23:43:46 2019 +0300
+++ b/project_files/hwc/rtl/CMakeLists.txt	Sun Aug 25 19:39:29 2019 -0600
@@ -1,5 +1,3 @@
-
-include_directories(${GLEW_INCLUDE_DIR})
 
 file(GLOB fpcrtl_src *.c)
 
--- a/project_files/hwc/rtl/fpcrtl.h	Sun Aug 25 23:43:46 2019 +0300
+++ b/project_files/hwc/rtl/fpcrtl.h	Sun Aug 25 19:39:29 2019 -0600
@@ -13,10 +13,6 @@
 #include "fileio.h"
 #include "pmath.h"
 
-#ifndef EMSCRIPTEN
-#include "GL/glew.h"
-#endif
-
 #define fpcrtl_memcpy                       memcpy
 
 #define luapas_lua_gettop                   lua_gettop
--- a/project_files/hwc/rtl/misc.c	Sun Aug 25 23:43:46 2019 +0300
+++ b/project_files/hwc/rtl/misc.c	Sun Aug 25 19:39:29 2019 -0600
@@ -219,13 +219,6 @@
     return &s->s[1];
 }
 
-#ifdef EMSCRIPTEN
-GLenum glewInit()
-{
-    return GLEW_OK;
-}
-#endif
-
 void fpcrtl_glShaderSource(GLuint shader, GLsizei count,/* const dropped for pas2c compat */ GLchar **string, const GLint *length) {
     glShaderSource(shader, count, (const char * const *)string, length);
 }
--- a/project_files/hwc/rtl/misc.h	Sun Aug 25 23:43:46 2019 +0300
+++ b/project_files/hwc/rtl/misc.h	Sun Aug 25 19:39:29 2019 -0600
@@ -5,11 +5,7 @@
 #include <assert.h>
 #include <stdbool.h>
 
-#ifdef EMSCRIPTEN
-#include <GL/gl.h>
-#else
-#include <GL/glew.h>
-#endif
+#include "GL.h"
 
 #define     VA_NUM_ARGS(...)                        VA_NUM_ARGS_IMPL(__VA_ARGS__, 5,4,3,2,1)
 #define     VA_NUM_ARGS_IMPL(_1,_2,_3,_4,_5,N,...)  N
@@ -59,9 +55,4 @@
 string255   fpcrtl_astr2str(const astring s);
 #define     fpcrtl_TypeInfo                         sizeof // dummy
 
-#ifdef EMSCRIPTEN
-#define     GLEW_OK                                 1
-GLenum      glewInit();
 #endif
-
-#endif