Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: I was making a 2d game.. porting to OpenGL?

  1. #1
    Guest

    I was making a 2d game.. porting to OpenGL?

    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)

  2. #2
    Junior Member Regular Contributor
    Join Date
    May 2001
    Location
    Germany, Hannover
    Posts
    224

    Re: I was making a 2d game.. porting to OpenGL?

    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 ...

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: I was making a 2d game.. porting to OpenGL?

    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.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Guest

    Re: I was making a 2d game.. porting to OpenGL?

    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •