Hi, as I said in the title of the topic, I am a complete newbie. I’m starting to program on Delphi ( in a school so I don’t have choice concerning language).
I have to develop a game until June 2004.
I plan on developping some kind of a tetris with special modes, AI.
So basically, it’s a 2D game and yet, I would like to add some effects similar to explosions, and, … you know, fancy stuff so the game looks good.
My question is, : is OpenGL appropriate for this kind of stuff ( 2D ) ?
Is what I plan to do 2D or 3D ? ( I mean is it possible to mix 2D and 3D or use 3D as a false 2D and real 3D for FX ??
I know I’m not being so clear so please try to be understandful, i really don’t know much about Delphi programming (I know how to start Delphi and how to exit it … )
www.delphi3d.net has lots of examples.
“My question is, : is OpenGL appropriate for this kind of stuff ( 2D ) ?”
Depends on your teacher.
You can add 2D elements in anything 3D. Tetris is quite popular, so you will find plenty of examples on the net.
“You can add 2D elements in anything 3D”
Maybe my thinking is a bit naive, but what I wnated to do would rather have been something like "adding 3D (the FX) elements in a 2D environment (the blocks falling, the backgroung . . .)
Anyway, can someone absolutely confirm me that 2D IS possible with OpenGL … (I know it’s stupid …)
Yes, u can do 2D in OpenGL.
For an example,
One solution (which I would go for) is to do all the blocks, the playfiled etc in 3D, with a fixed camera in front of the playfiled so that it vaguely looks like 2D. You can use textures to give nice colors and patterns to your blocks and backgrounds, and if you want you can draw text (with the CPU) in a texture that you put on a planar surface facing the camera.
This means that you have to learn a bit of OpenGL, but you would have to anyway if you want to add the fancy effects.
OK thanks I’ll do that, but I think I’ll probably start to work on the very game that I will first run in text mode with characters as blocks so it gives me some time to learn opengl . . . and some PASCAL . . .
First thing you should do is to check out how to setup an orthogonal view-frustum. Than it really looks like 2D because you don´t get a 3D distortion.
However OpenGL is a very good choice for your problem. You can do all you 2D stuff plus the 3D effects without problems.
>>Yes, u can do 2D in OpenGL.
>>For an example,
erm, i’m not sure this time, but i think that GL is filling the z parameter with 0.0f by default. but it may depend on projection mode, as said: not sure.