Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: OpenGL for 2d purposes...

  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenGL for 2d purposes...

    How easy/hard would it be to use OpenGL for 2D graphics like you would use DirectX3D for 2D?

    I'm considering making my feature 360<sup>o</sup> Space Shooter type game cross-platform compatable, with the option to use either OpenGL/AL or DirectX, but not sure if existing libraries will do that for me and how smooth a time durring development will I have.


    Any ideas, hints or suggestions?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2

    OpenGL for 2d purposes...

    Very easy, once you get used to the style of OpenGl that is, and it?¢_Ts easy enough to not use any libraries.

  3. #3

    OpenGL for 2d purposes...

    It's pretty straightforward - you just need to set a 2d ortho view for the projection matrix (glMatrixMode(GL_PROJECTION); glOrtho(...)).

    If I remember then I'll email you some of my code when I get home (after 5, UK time).
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenGL for 2d purposes...

    That would be great. I've been eyeing OpenGL for some time, but only slightly. Wantering into the unknown isn't easy sometimes. However considering that so far the games that I have seen on the commercial side of the coin(Unreal Tournament/2003 , Quake 2&3, etc) have all ran really fast and smooth, I see not a reason to stay away if it isn't too hard. Cross platform capability doesn't suck either.

    Can I mix and match 3D effects with 2D? Or is that pretty much as taboo as Direct3D with 2D?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5

    OpenGL for 2d purposes...

    As there?¢_Ts no special 2D mode or something that would disable 3D, you can really do anything, just remember to turn depth test and depth mask on/off where needed.

  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenGL for 2d purposes...

    Hmm... someones really gotta lay out all of the settings of a basic OpenGL enviroment for me at some point. Perhaps a OpenGL for Beginners 101.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #7

    OpenGL for 2d purposes...

    Quote Originally Posted by WILL
    Hmm... someones really gotta lay out all of the settings of a basic OpenGL enviroment for me at some point. Perhaps a OpenGL for Beginners 101.
    I'm on it (and have been for a while, sigh). I've been meaning to do this recently but I've been smote with a cold over the past few days. :roll: I'll get back to writing stuff tomorrow with luck (today = maybe tidying up some code before letting you get your grubby mitts on it, tomorrow = coding, Friday = drinking, Saturday and Sunday afternoon = going back home to parents' house).

    It will get done "real soon now".
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  8. #8
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenGL for 2d purposes...

    Groovyness...

    Tanks Ali.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #9

    OpenGL for 2d purposes...

    Quote Originally Posted by Alimonster
    If I remember then I'll email you some of my code when I get home (after 5, UK time).
    I'm interested in 2d opengl too, could you please post your example here ?

    Thanks a lot!
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  10. #10

    OpenGL for 2d purposes...

    No problem. I'll post a link to the code tomorrow (edit: hmm, today, actually - I mean Tuesday) night sometime around 6-ish GMT, hopefully. I've still got a little bit of tidying up to do (both of the code and of my flat in real life, doh), but it's just about there.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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