Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently starting upgrading my ios game to the latest Cocos2D (2.0 rc), and I am having some difficulties upgrading my texture generation code to OpenGL 2.0.

In the old version I generated images with this code:

CCRenderTexture *rt = 
[CCRenderTexture renderTextureWithWidth:WIDTH height:HEIGHT];

[rt beginWithClear:bgColor.r g:bgColor.g b:bgColor.b a:bgColor.a];


glVertexPointer(2, GL_FLOAT, 0, verts);
glColorPointer(4, GL_FLOAT, 0, colors);
glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)nVerts);


[rt end];

But since OpenGL 2.0 works differently this code won't work. What is the best way to use the new OpenGL?

share|improve this question

You say you are working on texture generation code and the function is called renderTextureWithWidth, but the arguments are never used and it looks to me like you're rendering a mesh without a texture.

Very odd.

What you want to do is convert your code to use Vertex Buffer Objects (VBO's). You can find a good tutorial on them here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.