Closed GoogleCodeExporter closed 9 years ago
You should disable the texture array before drawing and enable it again after
drawing. That's probably the interface of the FPS label you're seeing. Don't
disable the color array after drawing, other nodes/sprites depend on it.
You should look at other drawPrimitives functions in 0.99.5 to get some
inspiration.
Also you're only drawing 3 points ( = one triangle) now, glDrawArrays should
have count of 12, so you'll draw 4 triangles).
Original comment by marcotil...@gmail.com
on 21 Feb 2011 at 3:27
Thank you for your help! Indeed, after small modification function draw
correctly!
void drawSmoothLine(CGPoint pos1, CGPoint pos2, float width) // works fine now
{
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
// old code here
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
}
//---
"glDrawArrays should have count of 12,"
I do not why but it does not work for 12. It draws strange shapes. It works
fine for 4 and 6 but does not work for 12.
Original comment by a1rex2...@gmail.com
on 21 Feb 2011 at 3:44
not a bug. closing it.
Original comment by ricardoq...@gmail.com
on 24 Feb 2011 at 1:38
Original issue reported on code.google.com by
a1rex2...@gmail.com
on 11 Feb 2011 at 3:03