glRotatef

BlitzMax Forums/BlitzMax OpenGL Programming/glRotatef

Say I have a 64x64 image. I want to rotate that image to the right by 45.0 degrees (x?), and slant it backwards by 15.0 degrees (z?).

How does glRotatef work? (an example would be nice)
Should I use glPushMatrix and glPopMatrix to get back to the unrotated state?

EDIT:
I can rotate it to the right.. but how do I tilt it back? (z = x?)
How can I retain the original position of the tile?

SuperStrict

Framework brl.glmax2d
Import brl.pngloader

SetGraphicsDriver GLMax2DDriver()
Graphics 800,600,0

Global w:Float, h:Float
Global tex:Int = LoadTexture("tile.PNG")

glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR
glTexParameteri GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR
glLoadIdentity
glEnable GL_TEXTURE_2D

Local mx:Float = 200, my:Float = 200
While Not KeyHit(KEY_ESCAPE)
	'mx = MouseX(); my = MouseY()
	
	Cls
	
	glLoadIdentity
	glBindTexture GL_TEXTURE_2D, tex
	glShadeModel(GL_SMOOTH)
	
	If KeyDown(KEY_SPACE)
		glRotatef(45.0, 0.0, 0.0, 1.0)
		'glTranslatef(0.0, my, mx)
	End If
	
	'Draw the texture
	glBegin GL_QUADS
	 glTexCoord2f 0.0, 0.0; glVertex2f mx, my
	 glTexCoord2f 1.0, 0.0; glVertex2f mx + w, my
	 glTexCoord2f 1.0, 1.0; glVertex2f mx + w, my + h
	 glTexCoord2f 0.0, 1.0; glVertex2f mx, my + h
	glEnd
	
	Flip
	
	Delay 10
Wend

End


Function LoadTexture:Int(url:Object)
  Local pm:TPixmap, id:Int
	
	pm = LoadPixmap(url)
	w = pm.width; h = pm.height' / 2
	
	id = GLTexFromPixmap(pm)
	
	Return id
	
End Function


I'm guessing,
glRotatef(15.0,1,0,0)


Nope. I tried all combination's I could think of - including that..

Doesn't matter anymore, I got it working using standard max2d transformation variables.

I think it'd be like:

glMatrixMode GL_MODELVIEW
glRotatef(45,1,0,0)
glRotatef(15,0,1,0)

or something like that.