Fix shader issue

This commit is contained in:
2018-09-18 20:41:33 +02:00
parent a2d58a3d5f
commit f31e4df888

View File

@@ -6,6 +6,8 @@
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
#define USE_ES_SHADERS 0
static const GLfloat textureVertices[] = static const GLfloat textureVertices[] =
{ {
0.0f, 1.0f, 0.0f, 1.0f,
@@ -110,7 +112,7 @@ bool lvrcInitFrameResources(struct lvrcInstance * instance)
//float warp_scale = 0.305f; // test //float warp_scale = 0.305f; // test
float warp_adj = 1.0f; float warp_adj = 1.0f;
#if 0 #if USE_ES_SHADERS
const char* vertex; const char* vertex;
ohmd_gets(OHMD_GLSL_ES_DISTORTION_VERT_SRC, &vertex); ohmd_gets(OHMD_GLSL_ES_DISTORTION_VERT_SRC, &vertex);
const char* fragment; const char* fragment;
@@ -172,9 +174,11 @@ static void prepare(GLuint texture)
static void draw() static void draw()
{ {
#if USE_ES_SHADERS
glVertexAttribPointer(glGetAttribLocation(shader, "coords"), 2, GL_FLOAT, 0, 0, textureVertices); glVertexAttribPointer(glGetAttribLocation(shader, "coords"), 2, GL_FLOAT, 0, 0, textureVertices);
glEnableVertexAttribArray(glGetAttribLocation(shader, "coords")); glEnableVertexAttribArray(glGetAttribLocation(shader, "coords"));
assert(GL_NO_ERROR == glGetError()); assert(GL_NO_ERROR == glGetError());
#endif // USE_ES_SHADERS
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
assert(GL_NO_ERROR == glGetError()); assert(GL_NO_ERROR == glGetError());