Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43

Thread: 2D using OpenGL

  1. #1

    2D using OpenGL

    I've searched many sites for this one and I haven't quite been able to find that what I'm looking for.

    As many of you know, I used SDL to make my previous gaming project (Caimans quest), and this time I want to make a new game now for a school.

    It's supposed to be an educational game for children around the age of 11.

    After running some tests and demos on the pcs here I found out OpenGL is the best way to go.

    Now I'm everything but experienced in OpenGL, but I found out via Tilestudio's website it can be done, and the demo looks great.

    After doing some research I found out they used the Clean library for sprites, it looks nice and everything, but I want to build my own mapmaker and build my own engine. Clean is a bit too complete and is difficult to change too much, not my type of engine.

    What I really want is a small demo or tutorial to get me started on placing some 2D sprites on a background.

    What I want to know at first is:
    - How to get started using this? (Tutorial or sourcecode would suffice)
    - How to animate a sprite on a polygon in 2D?

    Being able to place a 2d object and move it around in 2D would suffice for me at first.
    Just need a little boost start and I can start programming
    Huhuhu

  2. #2

    2D using OpenGL

    This is propably the best site there is, many tutorials with delphi source
    http://nehe.gamedev.net/

    Then i would point out this link for the latest OpenGL 1.9 header (Library section under Files) and lots of demos too. Too bad it's mostly german site
    http://www.delphigl.com/

    Those sites i used when creating GLEngine (under development), in some level as easy as DelphiX but faster and better graphics...

  3. #3

    2D using OpenGL

    In JEDI-SDL I ported quite a few of the Nehe OpenGL tutorials, most can be found on the Nehe site or in the JEDI-SDL sourceforge CVS.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #4
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    2D using OpenGL

    All my latest games use SDL and OpenGL. I have written a set of wrapper libraries to make it easy to load images and draw them to the screen. So although its using OpenGL you dont actually need to know OpenGL to use them.

    The souce code available for most of my games includes a copy of the wrappers (I call it S2DL - Simple 2D library) - I can also upload the latest version of the wrappers later if you like.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  5. #5

    2D using OpenGL

    I've taken the liberty of trying the NeHe site and so far it is going great. I've managed to place some stuff on the screen...

    I'm working on a blockbuilder now which places blocks on the screen depending on the integer value of the block (so far, 0=none, 1=block)

    Now for texturing...

    Thanks for the help, it really works!
    Huhuhu

  6. #6

    2D using OpenGL

    About the wrappers....

    Thanks for the offer, but this is a school internship project and I have to show them I can make it all from scratch from the basic delphi components...

    Too, bad, but that's the way it is...

    Found another problem btw...

    I've added a couple of rectangular tiles, but I can't really seem to get a single transparent color. Is there a simple way without using gifs to get this?

    So like in SDL I want to set a transparent color (Pink or FF00FF).

    I have found a way to animate tiles, but I don't know if it's the most efficient way to go...
    I'm filling an array with textures (bitmaps) and each time I redraw the polygon (rectangle) I load a different texture each time. Don't know if it is efficient or not, but if anyone has a better suggestion I'm open to it.
    Huhuhu

  7. #7

    2D using OpenGL

    If you are using OpenGL, you need to use a texture format that supports transparency layers, something like png and look up blending ( nehe lesson 8 - http://nehe.gamedev.net/data/lessons...n.asp?lesson=8 ). If you are just just looking for a color key type effect then you need to look up masking ( nehe lesson 20 - http://nehe.gamedev.net/data/lessons....asp?lesson=20 )

    I hope this helps.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  8. #8

    2D using OpenGL

    Have a look at these tutorials. And be sure to check out the download page as well!

  9. #9

    2D using OpenGL

    Savage,

    I hoped to avoid both those methods to add transparency.
    This game will feature a level editor and I want to make it easy on people to change the images.

    The biggest problem is that I have to assume the people who want to create their own graphics and such don't have any knowledge of anything which has something to do with drawing pictures.

    I hoped to just get them to use paint and copy-paste some stuff.

    Now it seems there are only the masking or image transparency layers (PNG or GIF).

    Masking needs to work with a seperate file (black/white) or a loop on all pixels (could work, but doesn't sound efficient)

    A transparency layer could work, I think.. Just need to add a written tutorial on how to make gifs with transparency.

    (You guys must be thinking, what in the world did this guy get into?)

    I'll look futher into the masking bit for now... I hope I missed something that will make it all a bit easier on me


    BTW traveller. Thanks for another great set of demos... They really helped out so far.... The example for adding text is more clear to me there than in NeHe's example
    Huhuhu

  10. #10

    2D using OpenGL

    Have a look at the SDL code here -
    http://osdl.sourceforge.net/OSDL/OSD...-examples.html
    It shows another way of achieving colour keyed transparency.

    Don't forget that since you are using OpenGL you will need to tell users of your software to create Power of 2 textures if they want the least amount of hassle amongst graphics.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 1 of 5 123 ... 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
  •