Merge
authorraptor <buckyballreaction@gmail.com>
Mon, 26 Aug 2019 15:44:03 -0600
changeset 15384 c5934cdeecb6
parent 15382 34eb5cc72241 (current diff)
parent 15383 c8f37fc9c266 (diff)
child 15385 114b036522a6
Merge
hedgewars/uRender.pas
--- a/hedgewars/pas2cSystem.pas	Mon Aug 26 23:17:17 2019 +0300
+++ b/hedgewars/pas2cSystem.pas	Mon Aug 26 15:44:03 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	Mon Aug 26 23:17:17 2019 +0300
+++ b/hedgewars/uRender.pas	Mon Aug 26 15:44:03 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	Mon Aug 26 23:17:17 2019 +0300
+++ b/project_files/hwc/CMakeLists.txt	Mon Aug 26 15:44:03 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})
@@ -74,6 +72,9 @@
 if(GL2)
     set(pas2c_args ${pas2c_args} -d GL2)
 endif()
+if(APPLE)
+    set(pas2c_args ${pas2c_args} -d DARWIN)
+endif()
 
 if(LIBAV_FOUND)
     add_subdirectory(${CMAKE_SOURCE_DIR}/hedgewars/avwrapper ${CMAKE_CURRENT_BINARY_DIR}/avwrapper)
@@ -115,7 +116,6 @@
                                 ${SDL2_NET_LIBRARIES}
                                 ${SDL2_IMAGE_LIBRARIES}
                                 ${SDL2_TTF_LIBRARIES}
-                                ${GLEW_LIBRARY}
                                 physfs
                                 physlayer
                                 m
--- a/project_files/hwc/rtl/CMakeLists.txt	Mon Aug 26 23:17:17 2019 +0300
+++ b/project_files/hwc/rtl/CMakeLists.txt	Mon Aug 26 15:44:03 2019 -0600
@@ -1,5 +1,3 @@
-
-include_directories(${GLEW_INCLUDE_DIR})
 
 file(GLOB fpcrtl_src *.c)
 
--- a/project_files/hwc/rtl/fpcrtl.h	Mon Aug 26 23:17:17 2019 +0300
+++ b/project_files/hwc/rtl/fpcrtl.h	Mon Aug 26 15:44:03 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	Mon Aug 26 23:17:17 2019 +0300
+++ b/project_files/hwc/rtl/misc.c	Mon Aug 26 15:44:03 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	Mon Aug 26 23:17:17 2019 +0300
+++ b/project_files/hwc/rtl/misc.h	Mon Aug 26 15:44:03 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