comparison Framework/Scene2D/Internals/OpenGLTextureProgram.cpp @ 611:e3f21a265be5

Added version directive to GLSL shader code + glew init function in sample code AND commented-out glew init function in StoneInitialize
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 30 Apr 2019 16:07:48 +0200
parents b66ced2c43d4
children 1091b2adeb5a
comparison
equal deleted inserted replaced
610:0c4c0693b97c 611:e3f21a265be5
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 21
22 #include "OpenGLTextureProgram.h" 22 #include "OpenGLTextureProgram.h"
23 #include "OpenGLShaderVersionDirective.h"
23 24
24 static const unsigned int COMPONENTS = 2; 25 static const unsigned int COMPONENTS = 2;
25 static const unsigned int COUNT = 6; // 2 triangles in 2D 26 static const unsigned int COUNT = 6; // 2 triangles in 2D
26 27
27 static const char* VERTEX_SHADER = 28 static const char* VERTEX_SHADER =
29 ORTHANC_STONE_OPENGL_SHADER_VERSION_DIRECTIVE
28 "attribute vec2 a_texcoord; \n" 30 "attribute vec2 a_texcoord; \n"
29 "attribute vec4 a_position; \n" 31 "attribute vec4 a_position; \n"
30 "uniform mat4 u_matrix; \n" 32 "uniform mat4 u_matrix; \n"
31 "varying vec2 v_texcoord; \n" 33 "varying vec2 v_texcoord; \n"
32 "void main() \n" 34 "void main() \n"