Hi,
I am trying to convert the example here from ObjectiveC to C*+ but I am running into some problems, the following code gives me issues:
Link: http://www.raywenderlich.com/3857/how-to-create-dynamic-textures-with-ccrendertexture
I added a* sign before each line that tell’s me I am missing a reference:
glDisable(GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
float gradientAlpha = 0.7;
CCPoint vertices[4];
ccColor4F colors[4];
int nVertices = 0;
vertices[nVertices] = CCPointMake(0, 0);
colors[nVertices**] = ;
vertices[nVertices] = CCPointMake;
colors[nVertices**] = (ccColor4F){0, 0, 0, 0};
vertices[nVertices] = CCPointMake(0, textureSize);
colors[nVertices**] = ;
vertices[nVertices] = CCPointMake;
colors[nVertices**] = (ccColor4F){0, 0, 0, gradientAlpha};
- glVertexPointer(2, GL_FLOAT, 0, vertices);
- glColorPointer(4, GL_FLOAT, 0, colors);
glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)nVertices);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
I tried #include “CCGL.h” but that didn’t solve it and I got the latest from GitHub as well which also didn’t solve it.
The API calls that I am using here are from OpenGLES 1.0 and I assume my code automatically uses 2.0, I think I rather make it work in 2.0 then figure out how to use 1.0
I know this must be easy to fix, but so far I haven’t been able to extract the answer from Google yet.
-Mark