diff --git a/src/external/include/ANGLE/EGL/egl.h b/src/external/ANGLE/EGL/egl.h similarity index 100% rename from src/external/include/ANGLE/EGL/egl.h rename to src/external/ANGLE/EGL/egl.h diff --git a/src/external/include/ANGLE/EGL/eglext.h b/src/external/ANGLE/EGL/eglext.h similarity index 100% rename from src/external/include/ANGLE/EGL/eglext.h rename to src/external/ANGLE/EGL/eglext.h diff --git a/src/external/include/ANGLE/EGL/eglplatform.h b/src/external/ANGLE/EGL/eglplatform.h similarity index 100% rename from src/external/include/ANGLE/EGL/eglplatform.h rename to src/external/ANGLE/EGL/eglplatform.h diff --git a/src/external/include/ANGLE/GLES2/gl2.h b/src/external/ANGLE/GLES2/gl2.h similarity index 100% rename from src/external/include/ANGLE/GLES2/gl2.h rename to src/external/ANGLE/GLES2/gl2.h diff --git a/src/external/include/ANGLE/GLES2/gl2ext.h b/src/external/ANGLE/GLES2/gl2ext.h similarity index 100% rename from src/external/include/ANGLE/GLES2/gl2ext.h rename to src/external/ANGLE/GLES2/gl2ext.h diff --git a/src/external/include/ANGLE/GLES2/gl2platform.h b/src/external/ANGLE/GLES2/gl2platform.h similarity index 100% rename from src/external/include/ANGLE/GLES2/gl2platform.h rename to src/external/ANGLE/GLES2/gl2platform.h diff --git a/src/external/include/ANGLE/GLES3/gl3.h b/src/external/ANGLE/GLES3/gl3.h similarity index 100% rename from src/external/include/ANGLE/GLES3/gl3.h rename to src/external/ANGLE/GLES3/gl3.h diff --git a/src/external/include/ANGLE/GLES3/gl3ext.h b/src/external/ANGLE/GLES3/gl3ext.h similarity index 100% rename from src/external/include/ANGLE/GLES3/gl3ext.h rename to src/external/ANGLE/GLES3/gl3ext.h diff --git a/src/external/include/ANGLE/GLES3/gl3platform.h b/src/external/ANGLE/GLES3/gl3platform.h similarity index 100% rename from src/external/include/ANGLE/GLES3/gl3platform.h rename to src/external/ANGLE/GLES3/gl3platform.h diff --git a/src/external/include/ANGLE/KHR/khrplatform.h b/src/external/ANGLE/KHR/khrplatform.h similarity index 100% rename from src/external/include/ANGLE/KHR/khrplatform.h rename to src/external/ANGLE/KHR/khrplatform.h diff --git a/src/external/include/ANGLE/angle_windowsstore.h b/src/external/ANGLE/angle_windowsstore.h similarity index 100% rename from src/external/include/ANGLE/angle_windowsstore.h rename to src/external/ANGLE/angle_windowsstore.h diff --git a/src/rlgl.c b/src/rlgl.c index f375b4a9f..d94edd7f4 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1166,7 +1166,7 @@ void rlglInit(int width, int height) if(strcmp(extList[i], (const char *)"GL_EXT_debug_marker") == 0) debugMarkerSupported = true; } -#ifdef _MSC_VER +#if defined(_MSC_VER) //free(extList); #endif @@ -2407,10 +2407,6 @@ Shader LoadShader(char *vsFileName, char *fsFileName) for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Shaders loading from external text file - char *vShaderStr = LoadText(vsFileName); - char *fShaderStr = LoadText(fsFileName); - unsigned int vertexShaderId = defaultVShaderId; unsigned int fragmentShaderId = defaultFShaderId; @@ -3181,82 +3177,46 @@ void EndVrDrawing(void) // Compile custom shader and return shader id static unsigned int CompileShader(const char *shaderStr, int type) { - unsigned int program = 0; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - GLuint vertexShader; - GLuint fragmentShader; - - vertexShader = glCreateShader(GL_VERTEX_SHADER); - fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); - - const char *pvs = vShaderStr; - const char *pfs = fShaderStr; - - glShaderSource(vertexShader, 1, &pvs, NULL); - glShaderSource(fragmentShader, 1, &pfs, NULL); + unsigned int shader = glCreateShader(type); + glShaderSource(shader, 1, &shaderStr, NULL); GLint success = 0; - - glCompileShader(vertexShader); - - glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success); + glCompileShader(shader); + glGetShaderiv(shader, GL_COMPILE_STATUS, &success); if (success != GL_TRUE) { - TraceLog(LOG_WARNING, "[VSHDR ID %i] Failed to compile vertex shader...", vertexShader); - + TraceLog(LOG_WARNING, "[SHDR ID %i] Failed to compile shader...", shader); int maxLength = 0; int length; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength); - glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &maxLength); - -#ifdef _MSC_VER +#if defined(_MSC_VER) char *log = malloc(maxLength); #else char log[maxLength]; #endif - glGetShaderInfoLog(vertexShader, maxLength, &length, log); + glGetShaderInfoLog(shader, maxLength, &length, log); TraceLog(LOG_INFO, "%s", log); -#ifdef _MSC_VER +#if defined(_MSC_VER) free(log); #endif } - else TraceLog(LOG_INFO, "[VSHDR ID %i] Vertex shader compiled successfully", vertexShader); + else TraceLog(LOG_INFO, "[SHDR ID %i] Shader compiled successfully", shader); - glCompileShader(fragmentShader); + return shader; +} // Load custom shader strings and return program id static unsigned int LoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId) { unsigned int program = 0; - if (success != GL_TRUE) - { - TraceLog(LOG_WARNING, "[FSHDR ID %i] Failed to compile fragment shader...", fragmentShader); - - int maxLength = 0; - int length; - - glGetShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &maxLength); - -#ifdef _MSC_VER - char *log = malloc(maxLength); -#else - char log[maxLength]; -#endif - glGetShaderInfoLog(fragmentShader, maxLength, &length, log); - - TraceLog(LOG_INFO, "%s", log); - -#ifdef _MSC_VER - free(log); -#endif - } - else TraceLog(LOG_INFO, "[FSHDR ID %i] Fragment shader compiled successfully", fragmentShader); +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + GLint success = 0; program = glCreateProgram(); glAttachShader(program, vShaderId); @@ -3304,9 +3264,6 @@ static unsigned int LoadShaderProgram(unsigned int vShaderId, unsigned int fShad program = 0; } else TraceLog(LOG_INFO, "[SHDR ID %i] Shader program loaded successfully", program); - - glDeleteShader(vertexShader); - glDeleteShader(fragmentShader); #endif return program; }