   2d with opengl
  Hi!I''m new with opengl, I''ve always used directx.I would like to know if OpenGl may be used to write a 2d gameor if it is related only to 3d.Are there some api for 2d games other than directdraw (possibly available both for win32 and linux)?Thanks 
  search for sdl, has everything you need plus it''s available for linux and windows, but if you want to rotate stuff etc. stick to opengl, sdl sucks at this.greets ;  you can set up an orthagonal projection, and this gets rid of perspective, and can be set up so the (x,y) coordinates from OGL are the same as pixel coordinates. you just use textured quads for your sprites, and you have 2D! plus you can still rotate them, use alpha, etc etc... ;  here''s a tip i discovered while coding my last project, when calling glOrtho use a negative value for the height parameter and viola the origin is now in the top left corner. There''s probably some sort-of matrix to do this too but i''m not good with the maths.   Lorenz (krysole) Pretterhofersleep, caffeine for the weak minded ;  Someone on these forums posted these functions a week or so ago, I found it very helpfull:When you''re about to draw something 2D in screen pixel coords (like an interface item in your 3D world). Use this function:void Enable2D(){ // Get the current viewport dimensions int viewPort[4];    // Select the projection matrix    // Push the current projection matrix  glGetIntegerv(GL_VIEWPORT, viewPort);glMatrixMode(GL_PROJECTION);    glPushMatrix();    //save matrix   glLoadIdentity();   // Setup ortho mode    // Select modelview matrix   glOrtho(0, viewPort[2], 0, viewPort[3], -1, 1);glMatrixMode(GL_MODELVIEW);//Push the current modelview matrix   glPushMatrix();  glLoadIdentity(); //reset modelview matrix}// Disables orthographic mode and returns back to // perspective projection mode for 3D renderingvoid Disable2D(){    // Select the projection matrix    glMatrixMode(GL_PROJECTION);    // Pop the current projection matrix to return to  // perspective mode, our original projection matrix  glPopMatrix();    glMatrixMode(GL_MODELVIEW);  glPopMatrix();}