Results 1 to 3 of 3

Thread: Using OpenGL For 2D Stuff...

  1. #1
    Member Contributor
    Join Date
    Dec 2001
    Location
    Raleigh, NC, USA
    Posts
    72

    Using OpenGL For 2D Stuff...

    OK, I've been doing 3D in OpenGL for ages now, and it works just fine. However, I want to try some 2D stuff now, and I was wondering how I would go about displaying everything in a 2D aspect. I want to try making a platform game, like Sonic or Mario, which is why I need a 2D display mode. Thanks for the help.
    -Sephiroth

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Using OpenGL For 2D Stuff...

    I think openGL works great in that type 2D application.

    On a 2D game like Sonic, you draw in layers.
    First the back ground scene, then the next layers scene, object layer (Sonic, Rings things to bump into), forground layers ( score graphic, etc.).

    With openGL layers become Z depth, and use textured qauds for sprites.

    nehe.gamedev.net has a nice tutor on a simple 2D game.... lesson 32 I think.


    Originally posted by Sephiroth:
    OK, I've been doing 3D in OpenGL for ages now, and it works just fine. However, I want to try some 2D stuff now, and I was wondering how I would go about displaying everything in a 2D aspect. I want to try making a platform game, like Sonic or Mario, which is why I need a 2D display mode. Thanks for the help.

  3. #3
    Member Contributor
    Join Date
    Dec 2001
    Location
    Raleigh, NC, USA
    Posts
    72

    Re: Using OpenGL For 2D Stuff...

    Ah good, that is whatI have been coding for. I'm setting the engine up similar to that. Here's a basic run-down. Each map specifies a clear-color in case the background has transparency, for effects such as sky behind a moving background. Then there are up to four background layers drawn, each having the ability to use transparency for a wide range of effects. Now we draw the blocks and such that the player can collide with. Next up is the player and enemy stuff, as well as usable objects. Finally we have the info (score, health, whatever). And if the user had pressed the menu button, we'd draw the menus last.

    Anyways, thanks for the info! I just wanted to make sure that I was going about this project the right way before I had some fancy engine that looked like crud!
    -Sephiroth

Similar Threads

  1. openGL and showing stuff
    By nolfolk in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-13-2009, 11:01 AM
  2. c++ stuff/OpenGL
    By in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 02-26-2003, 03:44 PM
  3. OpenGL stuff
    By Mihail121 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 11-02-2002, 10:06 AM
  4. using OpenGL 1.2 stuff
    By naeblis81 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-06-2002, 03:02 PM
  5. I have VB5 - what OpenGL stuff do I need?
    By TheVBGod in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-01-2000, 11:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean