Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Sa Jul 19, 2025 23:43

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: 2D in OpenGL?
BeitragVerfasst: So Jan 18, 2004 12:09 
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


Nach oben
  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jan 18, 2004 12:19 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
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.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jan 19, 2004 06:25 
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?


Nach oben
  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jan 19, 2004 14:41 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Feb 24, 2003 18:19
Beiträge: 165
Wohnort: Cologne
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-

_________________
www.omfg.biz - aktuelles projekt


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Jan 24, 2004 18:12 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
take a look here: http://www.delphipraxis.com/topic15398_ ... ngl+sprite

It might just be what you need...

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jan 26, 2004 06:36 
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


Nach oben
  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Feb 29, 2004 17:33 
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


Nach oben
  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.007s | 14 Queries | GZIP : On ]