Anyone with BMax experience?

BlitzMax Forums/BlitzMax OpenGL Programming/Anyone with BMax experience?

"Unable to calculate tex size"

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!

You probably have more chance of help in the BlitzMax programming forum?

I dont know max.

GL stuff was changed slightly in 1.12. Changing the second line to this works (runs anyway):

GLGraphics(640,480)


GL stuff was changed slightly in 1.12. Changing the second line to this works (runs anyway):


Changed the line, still doesnt work.....

This is really frustrating, and discouraging....

Thanks for moving my topic into a dead forum......

Been at a stand still for 6 hours now with now way of loading a freakin texture......

Blimey...Calm down dear! ;o)

I haven't got a clue about all this GL stoof, but, a quick flick through the docs, and...

SuperStrict

SetGraphicsDriver GLGraphicsDriver()
Local GLDriver:TGraphics = CreateGraphics( 640,480,0,60, GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER )
SetGraphics GLDriver
'above 3 line can be replaced with : GLGraphics 640,480,0,60, GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER
'...aparently :o)


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)

CloseGraphics GLDriver

End


Function CreateTexture:Int(url:String)
	Local tempPM:TPixmap = LoadPixmap(url)

	If (tempPM = Null)
		Return -1
	EndIf
	
	Return GLTexFromPixmap(tempPM)
	
EndFunction


Did you run it? Did it work for you?

The reason I am so buggered on this is because I can't really sit and learn how to do proper 3D opengl in Blitzmax if I can't even load a texture.. A world without textures is rather boring... And I dont want to move on to more advanced topics since they involve textures as well...

Thanks for the reply, but I am still just as frustrated, and still discouraged over this...

I can run opengl windows just fine. I can get through all the NEHE tutorials that dont require textures.. But this GLTexFromPixmap is just killing me here...

YanCanCode's code works just fine here, have you tried it?

*sigh*

Here:



And here's the error:



Here's the texture (256x256 crate.png):

Tried converting it to a bmp, tried taking the image size down to 32x32 in all png, bmp, jpg formats, no difference.

Machine specs: P4 3.0 Ghz HT | 512 MB DDR | Intel 82865G with driver 6.14.10.4299


INTEL(R) EXTREME GRAPHICS 2 REPORT


Report Date: 12/03/2005
Report Time[hr:mm:ss]: 04:14:04
Driver Version: 6.14.10.4299
Operating System: Windows XP* Professional, Service Pack 1 (5.1.2600)
Default Language: English
DirectX* Version: 9.0
Physical Memory: 494 MB
Minimum Graphics Memory: 0 MB
Maximum Graphics Memory: 96 MB
Graphics Memory in Use: 6 MB
Processor: x86
Processor Speed: 2992 MHZ
Vendor ID: 8086
Device ID: 2572
Device Revision: 02


* Accelerator Information *

Accelerator in Use: Intel(R) 82865G Graphics Controller
Video BIOS: Not Available
Current Graphics Mode: 1280 by 1024 True Color (60 Hz)



* Devices Connected to the Graphics Accelerator *


Active Monitors: 1


* Monitor *

Monitor Name: Plug and Play Monitor
Display Type: Analog
Gamma Value: 2.20
DDC2 Protocol: Supported
Maximum Image Size: Horizontal: 14.9 inches
Vertical: 11.8 inches
Monitor Supported Modes:
640 by 480 (60 Hz)
640 by 480 (67 Hz)
640 by 480 (72 Hz)
640 by 480 (75 Hz)
720 by 400 (70 Hz)
800 by 600 (56 Hz)
800 by 600 (60 Hz)
800 by 600 (72 Hz)
800 by 600 (75 Hz)
832 by 624 (75 Hz)
1024 by 768 (60 Hz)
1024 by 768 (70 Hz)
1024 by 768 (75 Hz)
1152 by 864 (75 Hz)
1152 by 870 (75 Hz)
1280 by 1024 (60 Hz)
1280 by 1024 (60 Hz)
1280 by 1024 (75 Hz)
Display Power Management Support:
Standby Mode: Not Supported
Suspend Mode: Not Supported
Active Off Mode: Supported

* Other names and brands are the property of their respective owners.


Any other info?

I have run games in opengl on this machine many-a-time. Nothing has changed on the machine since then... I can run opengl apps with blitzmax fine, I can see polygons, i can see colors, I can do anything BUT use the GLTexFromPixmap function!

Alright, the following code works:
Framework BRL.GLGraphics
Import brl.bmploader
Import brl.max2d

Global ScreenWidth:Int=800
Global ScreenHeight:Int=600
Global ScreenDepth:Int=0

Global xrot:Float=0
Global yrot:Float=0
Global zrot:Float=0

Global Checkimage:Byte[256,256,4]
Global Texname:Int

GLGraphics(ScreenWidth,ScreenHeight,ScreenDepth,0,gl_BACKBUFFER | gl_DEPTHBUFFER) '| gl_FULLSCREEN
InitGl()
'' False
While Not KeyHit( KEY_ESCAPE )
	nehe6()
	glColor3f(1.0,1.0,1.0)
	'Framecounter--------------------------------------------
	Framecounter_counter=Framecounter_counter+1
	If Framecounter_time=0 Then Framecounter_time=MilliSecs()
	If Framecounter_time+1001 <MilliSecs() Then
		Framecounter_framerate=Framecounter_counter
		Framecounter_counter=0
		Framecounter_time=MilliSecs()
	EndIf
	GLDrawText("FPS : "+Framecounter_framerate,ScreenWidth-(8*12),ScreenHeight-16-8)
	'--------------------------------------------------------
	GLDrawText("Nehe lesson 6",10,24)
	Flip
Wend
End

Function InitGl()
	LoadGlTextures()
	glClearColor(0.0, 0.0, 0.0, 0.0)
	glClearDepth 1.0
	glDepthFunc(GL_LESS)
	glEnable(GL_DEPTH_TEST)
	glShadeModel(GL_SMOOTH)
	glViewport(0,0,ScreenWidth,ScreenHeight)
	glMatrixMode(GL_PROJECTION)
	glLoadIdentity()
	gluPerspective(45.0,Float(ScreenWidth)/Float(ScreenHeight),1.0,100.0)
	glMatrixMode(GL_MODELVIEW)
End Function

Function LoadGlTextures()
	Local PointeurImg:Byte Ptr
	Local TexWidth
	Local TexHeight
	tex01:TPixmap=LoadPixmap("data\NeHe.bmp")
	TexWidth=tex01.Width
	TexHeight=tex01.Height
	PointeurImg=PixmapPixelPtr(tex01,0,0)
	pp=0
	For y=TexHeight-1 To 0 Step -1
		For x=0 To TexWidth-1
			Checkimage[y,x,0]=PointeurImg[pp]
			Checkimage[y,x,1]=PointeurImg[pp+1]
			Checkimage[y,x,2]=PointeurImg[pp+2]
			Checkimage[y,x,3]=100
			pp=pp+3
		Next
	Next
	tex01=Null
	glPixelStorei(GL_UNPACK_ALIGNMENT,1)
	glGenTextures(1, Varptr Texname)
	glBindTexture(GL_TEXTURE_2D, Texname)
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, Checkimage)
End Function

Function nehe6()
	glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
   	glEnable(GL_TEXTURE_2D)
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE)
	glBindTexture GL_TEXTURE_2D,Texname
	
	glLoadIdentity
	glTranslatef 0.0,0.0,-5.0
	glRotatef xrot,1.0,0.0,0.0                         ' Rotate On The X Axis
	glRotatef yrot,0.0,1.0,0.0                         ' Rotate On The Y Axis
	glRotatef zrot,0.0,0.0,1.0                         ' Rotate On The Z Axis

	glBegin GL_QUADS
		' Front Face
		glTexCoord2f 0.0, 0.0; glVertex3f -1.0, -1.0, 1.0       ' Bottom Left Of The Texture And Quad
		glTexCoord2f 1.0, 0.0; glVertex3f  1.0, -1.0, 1.0       ' Bottom Right Of The Texture And Quad
		glTexCoord2f 1.0, 1.0; glVertex3f  1.0,  1.0, 1.0       ' Top Right Of The Texture And Quad
		glTexCoord2f 0.0, 1.0; glVertex3f -1.0,  1.0, 1.0       ' Top Left Of The Texture And Quad
		' Back Face
		glTexCoord2f 1.0, 0.0; glVertex3f -1.0, -1.0, -1.0      ' Bottom Right Of The Texture And Quad
		glTexCoord2f 1.0, 1.0; glVertex3f -1.0,  1.0, -1.0      ' Top Right Of The Texture And Quad
		glTexCoord2f 0.0, 1.0; glVertex3f  1.0,  1.0, -1.0      ' Top Left Of The Texture And Quad
		glTexCoord2f 0.0, 0.0; glVertex3f  1.0, -1.0, -1.0      ' Bottom Left Of The Texture And Quad
		' Top Face
		glTexCoord2f 0.0, 1.0; glVertex3f -1.0,  1.0, -1.0      ' Top Left Of The Texture And Quad
		glTexCoord2f 0.0, 0.0; glVertex3f -1.0,  1.0,  1.0      ' Bottom Left Of The Texture And Quad
		glTexCoord2f 1.0, 0.0; glVertex3f  1.0,  1.0,  1.0      ' Bottom Right Of The Texture And Quad
		glTexCoord2f 1.0, 1.0; glVertex3f  1.0,  1.0, -1.0      ' Top Right Of The Texture And Quad
		' Bottom Face
		glTexCoord2f 1.0, 1.0; glVertex3f -1.0, -1.0, -1.0      ' Top Right Of The Texture And Quad
		glTexCoord2f 0.0, 1.0; glVertex3f  1.0, -1.0, -1.0      ' Top Left Of The Texture And Quad
		glTexCoord2f 0.0, 0.0; glVertex3f  1.0, -1.0,  1.0      ' Bottom Left Of The Texture And Quad
		glTexCoord2f 1.0, 0.0; glVertex3f -1.0, -1.0,  1.0      ' Bottom Right Of The Texture And Quad
		' Right face
		glTexCoord2f 1.0, 0.0; glVertex3f  1.0, -1.0, -1.0      ' Bottom Right Of The Texture And Quad
		glTexCoord2f 1.0, 1.0; glVertex3f  1.0,  1.0, -1.0      ' Top Right Of The Texture And Quad
		glTexCoord2f 0.0, 1.0; glVertex3f  1.0,  1.0,  1.0      ' Top Left Of The Texture And Quad
		glTexCoord2f 0.0, 0.0; glVertex3f  1.0, -1.0,  1.0      ' Bottom Left Of The Texture And Quad
		' Left Face
		glTexCoord2f 0.0, 0.0; glVertex3f -1.0, -1.0, -1.0      ' Bottom Left Of The Texture And Quad
		glTexCoord2f 1.0, 0.0; glVertex3f -1.0, -1.0,  1.0      ' Bottom Right Of The Texture And Quad
		glTexCoord2f 1.0, 1.0; glVertex3f -1.0,  1.0,  1.0      ' Top Right Of The Texture And Quad
		glTexCoord2f 0.0, 1.0; glVertex3f -1.0,  1.0, -1.0      ' Top Left Of The Texture And Quad
	glEnd

	xrot = xrot + 0.333                     ' X Axis Rotation
	yrot = yrot + 0.222                     ' Y Axis Rotation
	zrot = zrot + 0.444                     ' Z Axis Rotation
	glDisable(GL_TEXTURE_2D)
End Function


So the question is why.... Going to figure it out tomorrow, i am dead tired from trial and error tonight.

Did you run it? Did it work for you?
Your version doesn't, my version does (if I comment out the SetGraphics() command, I get the 'Unable to calculate tex size' error).

That picture isn't showing the code I posted!

Also, isn't BGL_DEPTHBUFFER throwing an error for you?
It does for me.

Your version doesn't, my version does (if I comment out the SetGraphics() command, I get the 'Unable to calculate tex size' error).


I just pasted your code in (the entire thing just to say to myself that I tried it your way), and I get the same error.
That picture isn't showing the code I posted!

Because your code states "'above 3 line can be replaced with : GLGraphics 640,480,0,60, GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER
'...aparently :o)", so i figured I would try it that way as well.

Also, isn't BGL_DEPTHBUFFER throwing an error for you?
It does for me.


Oddly enough, it isnt throwing an error. In fact, I can run all the stuff without textures with it (strange). I am running 1.14 and did a fresh synmods before I started this thread.

Seems either your Blitzmax is different than mine, or there is some other issue.

At least the nehe tutorials work (with the minor modifications for the new glgraphics and what not). So I can continue on the lessons. But it still leaves me to wonder if it will work the same at home as well (I am at work currently). This is somewhat disturbing.

I'd recommend service pack two for xp!!
and updating you graphics drivers too...

I'd recommend service pack two for xp!!


Sorry, would rather burn in hell. Besides, I can't ask every enduser to have SP2 either. SP1 is one thing, but SP2 is nothing but crap....


and updating you graphics drivers too...


I don't see why my graphics drivers are allowing the way he is doing the NEHE tutorial to work, but not the simple opengl tutorial over at the wiki to work....... Do you?

Oddly enough, it isnt throwing an error.

It will if you put Strict at the top of your code.

With Strict you should get a message that BGL_DEPTHBUFFER is not found.
Without Strict a new variable named BGL_DEPTHBUFFER will be created and given a value of 0.

Sorry, would rather burn in hell. Besides, I can't ask every enduser to have SP2 either. SP1 is one thing, but SP2 is nothing but crap....

Well if you want to get hacked thats your problem! SP2 is just fine as well as having being out ages, you must be missing a whole bunch of updates lol!
I don't see why my graphics drivers are allowing the way he is doing the NEHE tutorial to work, but not the simple opengl tutorial over at the wiki to work....... Do you?

Yes its where you implementation of opengl comes from.
the nehe examples are fairly out of date now, are there any particular ones your having problems with? I have some of them converted...

It will if you put Strict at the top of your code.
DOH!...I didn't notice that. I must of just added it out of habit. :o)

Well if you want to get hacked thats your problem! SP2 is just fine as well as having being out ages, you must be missing a whole bunch of updates lol!


lol, tell you what, if you can break into my network, i will gladly update to sp2....

the nehe examples are fairly out of date now, are there any particular ones your having problems with? I have some of them converted...


I have run games in opengl on this machine many-a-time. Nothing has changed on the machine since then... I can run opengl apps with blitzmax fine, I can see polygons, i can see colors, I can do anything BUT use the GLTexFromPixmap function!



It's just that function....

Honestly though, I do appreciate everyones effort to help.

Just replace
CreateGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER | BGL_DEPTHBUFFER )

With
GLGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER | BGL_DEPTHBUFFER )

Using the code from your original post, works fine here.

You mean

from:
CreateGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER | BGL_DEPTHBUFFER )

To:
GLGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER )

I hope... :)

Sveinung

DOH :)

SP2 is nothing but crap....

DEP is very nice. Security Center and Firewall improvements are less nice, but nice nonetheless.

you must be missing a whole bunch of updates lol!

Updates are still coming out for SP1.

I've only seen one computer ever refuse to boot up after upgrading to SP2.

Unfortunately it was my own.

Mine didn't refuse to boot, but the HTTP: protocol was completely routed. Get it? Routed? Never mind.

Anyways, that was on a 3 year old machine, on brand new installs it works perfectly...

@ First Post

You are Creating a graphic Object but not selecting it
Change second line to

SetGraphic (CreateGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER | BGL_DEPTHBUFFER ))

Or just use GLGRaphics() by itself.

Also I seem to remember that the "unable to calculate texture size" error has something to do with the screen not being opened or not being supported by your hardware, more than anything whatsoever actually to do with textures.

Its An error in GLAdjustTexSize called by GLTexFromPixmap.

I Agree that Saying use GLGraphics is a good answer, but that wouldnt explain what Dark had done wrong, which was that they were createing a graphic object, and not setting it as the one to use

Four months old.

Its not just an answer for Dark thou is it?
Its also for the next time someone has this error,(which happened to me Yestrday).
So it doesnt matter How old the thread is. Its still there to be searched.

Its not just an answer for Dark thou is it?

@ First Post


I rest my case.

@ dark or @ first post. Hmmmm, wonder if they might mean differnt things ;)

"@ dark or @ first post. Hmmmm, wonder if they might mean differnt things"

Nope, since Dark Half made the first post.

ParicleEmmiter ptr or FirstParticle ptr,
Hmmmm, wonder if they might mean differnt things

That is the worst rebuttal I've seen in.. two days.

LOL. Ok maybe
But I did honsetly mean my post to be for anyone else who was getting the error and not just dark.
It is an easy thing to do, (well I have done it at least twice). And the error message never points to where you havent rememberd to select the graphics object you have created;(

And the error "Unable to calculate tex size", doesnt give much clue to the fact you made the misstake in the first 3 lines of code.

I honestly cut GLAdjustTexSize and GLTexFromPixmap from the source and put it in my program adding loads of console prints all over the place.

It was only after I had given up on trying to call it that I got an error message that led me to realise my mistake.