"Unable to calculate tex size"
This really puts a dampening on the learning if I cant even load a texture in without an error. The code posted here is from a tutorial over at the blitzmax wiki... Everything else goes ok, just this texfrompixmap command errors out. The texture is a 256x256 png
Hanging out in the opengl programming forum will be a complete waste of time as the previous post is 23 hours old, and down from that, 3 days, 1 week, and so on.... I need an answer asap to continue the learning otherwise I am at a complete standstill....
Please assist!
SetGraphicsDriver GLGraphicsDriver() CreateGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER | BGL_DEPTHBUFFER ) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45, 1.33, .01, 10000) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glEnable(GL_DEPTH_TEST) 'Enables testing the depth buffer glEnable(GL_TEXTURE_2D) 'Enables textures Local A:Float A=0 Global texture:Int = CreateTexture("crate.png") Repeat A:+1 If A > 360 Then A = 0 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() glTranslatef(0,0,-6) glRotatef(A,1,0,0) glRotatef(A,0,1,0) glRotatef(A,0,0,1) glColor3f(1,1,1) glBindTexture(GL_TEXTURE_2D, texture) glBegin(GL_QUADS) glTexCoord2f(0,1) glVertex3f(1, 1, -1) glTexCoord2f(1,1) glVertex3f(-1, 1, -1) glTexCoord2f(1,0) glVertex3f(-1, 1, 1) glTexCoord2f(0,0) glVertex3f(1, 1, 1) glTexCoord2f(0,1) glVertex3f(1, -1, 1) glTexCoord2f(1,1) glVertex3f(-1, -1, 1) glTexCoord2f(1,0) glVertex3f(-1, -1, -1) glTexCoord2f(0,0) glVertex3f(1, -1, -1) glTexCoord2f(0,1) glVertex3f(1, 1, 1) glTexCoord2f(1,1) glVertex3f(-1, 1, 1) glTexCoord2f(1,0) glVertex3f(-1, -1, 1) glTexCoord2f(0,0) glVertex3f(1, -1, 1) glTexCoord2f(0,1) glVertex3f(1, -1, -1) glTexCoord2f(1,1) glVertex3f(-1, -1, -1) glTexCoord2f(1,0) glVertex3f(-1, 1, -1) glTexCoord2f(0,0) glVertex3f(1, 1, -1) glTexCoord2f(0,1) glVertex3f(-1, 1, 1) glTexCoord2f(1,1) glVertex3f(-1, 1, -1) glTexCoord2f(1,0) glVertex3f(-1, -1, -1) glTexCoord2f(0,0) glVertex3f(-1, -1, 1) glTexCoord2f(0,1) glVertex3f(1, 1, -1) glTexCoord2f(1,1) glVertex3f(1, 1, 1) glTexCoord2f(1,0) glVertex3f(1, -1, 1) glTexCoord2f(0,0) glVertex3f(1, -1, -1) glEnd() Flip() Until KeyDown(key_escape) Function CreateTexture(url:String) Local tempPM:TPixmap = LoadPixmap(url) If (tempPM = Null) Return -1 EndIf Return GLTexFromPixmap(tempPM)'<-----Errors out here!!!!! EndFunction
This really puts a dampening on the learning if I cant even load a texture in without an error. The code posted here is from a tutorial over at the blitzmax wiki... Everything else goes ok, just this texfrompixmap command errors out. The texture is a 256x256 png
Hanging out in the opengl programming forum will be a complete waste of time as the previous post is 23 hours old, and down from that, 3 days, 1 week, and so on.... I need an answer asap to continue the learning otherwise I am at a complete standstill....
Please assist!



