I've decided to go with opengl mainly because:
* It's easy to combine with SDL (which i know pretty well).
* Fast (so far my frame rate has quadrupled compared to what i drew with SDL and sdl_gfx)
* 3D: if I want to do 3d later, it's probably nice knowing some opengl.
* Cairo/Opengl-combo seems cool.
* Cross-platform-friendly
I've started trying out some opengl. And so far i've only just created some basic shapes.
This is kind of off-topic, but i've encountered a small problem. I wrote this piece of code:
void CGfx::drawFilledPolygon(b2Vec2* vertices, int vertexCount){
glBegin(GL_POLYGON);
glColor3f(1.f,1.f,1.f);
for(int i=0; i<vertexCount; i++){
glVertex2f(vertices[i].x,vertices[i].y);
}
glEnd();
}
And i was convinced it would draw white polygons, but what i got was this:
screenshotWhy aren't they white? Doesn't glColor3f(1.f,1.f,1.f); mean full red, green and blue?
EDIT:Also I found some tutorials on 2d opengl/sdl:
http://basic4gl.wikispaces.com/2D+Drawing+in+OpenGLhttp://gpwiki.org/index.php/SDL:Tutorials:Using_SDL_with_OpenGLhttp://www.meandmark.com/opengl2dbook.html (not yet published book on 2d opengl)