Fix shader class compatibility with vbsp project. Update Readme

This commit is contained in:
lewa_j 2019-08-08 21:54:51 +03:00
parent a82434379c
commit fa636f7825
2 changed files with 13 additions and 10 deletions

View File

@ -6,17 +6,16 @@ I put it here so as not to lose by accident.
Writen in C++. Uses OpenGL/ES 2.
Use '-help' for comand line arguments.
## Dependencies
MinGW-W64
* [MinGW-W64](https://mingw-w64.org)
* [GLFW 3.3](https://www.glfw.org/)
* [GLM 0.9.9.0](https://glm.g-truc.net/0.9.9/index.html)
* [GLEW 2.0](http://glew.sourceforge.net/)
GLFW 3.3
GLM 0.9.9.0
GLEW 2.0
## demos
## Demos
**StarFleet** - space battles "game". With basic fighter AI, but withous gameplay
@ -38,3 +37,4 @@ GLEW 2.0
**ComprTex** - demonstrates some compressed texture formats
**[vbsp-gles](https://github.com/lewa-j/vbsp-gles)** - vbsp maps loader and renderer

View File

@ -124,8 +124,11 @@ void glslProg::print_log(GLuint object)
GLuint glslProg::CreateShader(const char *src, GLint type, const char *flags)
{
GLuint sid = glCreateShader(type);
const char *strings[]={flags,src};
glShaderSource(sid,2,strings,NULL);
char ver[] = "#version 100\n";
if(strstr(src,"#version"))
ver[0] = 0;
const char *strings[] = {ver,flags,src};
glShaderSource(sid,3,strings,NULL);
glCompileShader(sid);
GLint compile_ok = GL_FALSE;
glGetShaderiv(sid,GL_COMPILE_STATUS, &compile_ok);