[SDL] OpenGL tile based game question

Chris Herborth chrish at skoroworld.com
Tue Feb 22 15:59:20 PST 2005


Tobias Langner wrote:
> I want to write a tile based game using SDL/OpenGL. I want to realize 
> each field/unit by a texturized quad.

I've been experimenting with the same thing (using PyGame)...

> My question is this - which is the easiest to draw the field:
> 
> - create a OpenGL texture for each of the 4 rotated views of each texture

"Free" rotation is one of the big wins for using OpenGL to render 
something like this, the other being "free" alpha blending...

> - rotate the texture during drawing (can I do that by changing the 
> texture coordinates?)

I'm not an expert, but IIRC the texture co-ordinates are used to specify 
which parts of the texture are drawn, and they can be used to mirror the 
texture, but not rotate it.

> - rotate the quad?

That's probably the easiest approach, IMHO.

> Thanks for your help.

That's what we're here for! ;-)

-- 
Chris Herborth (chrish at pobox.com)
Never send a monster to do the work of an evil scientist.





More information about the SDL mailing list