DGL
https://delphigl.com/forum/

2D in OpenGL?
https://delphigl.com/forum/viewtopic.php?f=19&t=2401
Seite 1 von 1

Autor:  Gast [ So Jan 18, 2004 12:09 ]
Betreff des Beitrags:  2D in OpenGL?

Hi

I want to create a 2D game like Worm/Snake. Is OpenGL the way to go or should I use DirectX?

I know Delphi quite well, but I am completely new to openGL/DirectX.

Best regards,
Mikael

Autor:  Sascha Willems [ So Jan 18, 2004 12:19 ]
Betreff des Beitrags: 

Yes, OpenGL is very well suited for 2D. Just use an orthagonal projection, where you have no perspective and you can take advantage of OpenGLs features to make things easier and a lot faster. First you can use the hardware acceleration to get many fps and second you can use OpenGL's z-buffer to easily sort your sprites, and third advantage is that OpenGL also lets you make parts of textures (sprites) transparent very easy by using alpha masking.

Autor:  Gast [ Mo Jan 19, 2004 06:25 ]
Betreff des Beitrags: 

Sound great!

Do you have an I dea of where I should start?

I suspect that first I must learn OpenGL (the basic and the 2D stuff of OpenGL). Where can I find help on that?

Does anyone know where I can download a ultra simple "sprite" example somewhere?

Autor:  red [ Mo Jan 19, 2004 14:41 ]
Betreff des Beitrags: 

I don't know any examples about opengl-sprites, but you might want to have a look at sulaco's "window" example, which in my opinion very good to learn from.

To make sprites, just load a texture and show it with gl_Quads... animated sprites wouldn't be hard, you just have to show one texture a specific amount of time and then cycle to the next one. or you can subdivide the texture in more than just one sprite-animation (which obviously need less resources)

Regards,
red-

Autor:  noeska [ Sa Jan 24, 2004 18:12 ]
Betreff des Beitrags: 

take a look here: http://www.delphipraxis.com/topic15398_ ... ngl+sprite

It might just be what you need...

Autor:  Gast [ Mo Jan 26, 2004 06:36 ]
Betreff des Beitrags: 

Thanks for the replies.

I googled the net and found several info about using sprites with OpenGL and Delphi. The best solution (for me) seems to be GLXtreem (http://www.glxtreem.tk/). It is an open-source OpenGL framework that contains stuff like a timer, an image list and a sprite engine. 3D stuff are also very well supported. I well use some weeks learning the framework (and OpenGL) and I will let you all know my opinion about GLXtreem at that time.

Best regards,
Mikael Thomsen
http://www.mikaelthomsen.dk

Autor:  Gast [ So Feb 29, 2004 17:33 ]
Betreff des Beitrags: 

GLXtreem seems to be a very fine set of components if you want to use openGL in Delphi.

I have made my first and quite small demo (http://www.mikaelthomsen.dk/download/Glxtest.zip) that shows some of the stuff I have learned so far. I am now able to paint lines, sprites and text with openGL :D

Best regards
Mikael

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/