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.
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)
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.
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
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.