PDA

View Full Version : I was making a 2d game.. porting to OpenGL?



07-17-2001, 05:23 PM
I was making a 2d RPG (i don't want it to be 3d) The library I was using is really lacking in display modes and font support. Can anyone point me in the direction of tutorials on 2d in OpenGL? Or should I look at a different API? I hear DirectDraw is gone from DirectX and will be completely removed by the next release. (with XP)

T2k
07-18-2001, 01:37 AM
if you want to use opengl for 2d drawings, look how to init an opengl rendering context, and some orthoview containing the x-y-plane, and then call the commands like this, both do the same think(3D get 2d if you set one axis to 0 for each point/vertex on it):
glVertex2f(x,y); or glVertex3f(x,y, 0);
this commands for example would insert an Vertex( not working without glBegin(); and glEnd(); )
and so on ...

Deiussum
07-18-2001, 04:46 AM
Just wanted to comment on you thinking that DirectDraw will be completely removed from the next release of DirectX. This is most likely false information. DirectX adds new interfaces, but it does not remove any of the old interfaces. (i.e. DirectX 7 interfaces are still available in Dx8 as well as Dx5 interfaces, Dx3 interfaces, etc.)

Removing DirectDraw completely would be a huge mistake for a couple of reasons. First, the COM specifications say that new interfaces can be added, but old interfaces should remain, and remain unchanged. Second, there are a ton of games out there that use DirectDraw and removing those interfaces would directly affect all of them. I don't think MS would want to do that.

MS may have not included any new DirectDraw interfaces in Dx8, but I think you can be fairly confident that the DirectDraw interfaces for Dx7 will remain.

So far as using 2d in OpenGL, it is a fairly simple matter. You can simply setup an orthographic projection the same size as your window and use textured quads to display things.

07-18-2001, 02:14 PM
thanks for your help, and thanks for clearing up the info on DirectDraw.. I still think I'd rather use OpenGL. Could you point me in the direction of some reading on OpenGL in 2d (nehe's (has great tutorials) only does a bit of 2d.. and by the time he gets to texturing everything is 3d and more advanced than i'm ready to get just yet)