Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

2D Graphics with OpenGL

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 ThomasHopf   Members   

122
Like
Likes
Like

Posted 29 June 2001 - 01:38 AM

Hi! Is there any possiblity to use common 2d functions like bitmap blitting or drawing lines with openGL? i am searching for a solution that works with pixel coordinates, so i can blit images or draw lines like with the gdi, but gdi isn''t working with my GL code (because of the double buffering?)

#2 Julio   Members   

116
Like
Likes
Like

Posted 29 June 2001 - 01:47 AM

well, you can do 2d in OpenGL, but it isn''t as easy as drawing sprites. Instead of sprites you use textured quads. to get the 2d world set up, do this:
glViewport(0,0,screen_width,screen_height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0f,screen_width,screen_height,0.0f,-1.0f,1.0f);
glMatrixMode(GL_MODELVIEW);

then, you can say glVertex2f(x,y) to draw your quads.

HHSDrum@yahoo.com
Polarisoft Home Page

#3 mittens   Members   

1323
Like
Likes
Like

Posted 29 June 2001 - 07:08 AM

Check out NeHe''s lesson 21 tutorial (at least... I think thats what it is), well, whatever number it is, it shows a complete 2D game done in OpenGL. Check it out... NOW!

------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.