Pixmap as texture problem

BlitzMax Forums/OpenGL Module/Pixmap as texture problem

Ibmurai(Posted 2005) [#1]
It used to work but suddenly it doesn't... Some memory isn't being allocated or something. I've tried three different approaches with varying success. It all started when I began minimizin the application size by Framework and Import...

This crashes the app but BlitzMax doens't care:
Incbin "picture.jpg"

Local ..
	thePixmap:TPixmap = New TPixmap, ..
	theTexture:Int

thePixmap = LoadPixmap("incbin::picture.jpg")
theTexture = bglTexFromPixmap(thePixmap)


And this makes BlitzMax go "Attempt to access field or method of Null object" at the last line:
Framework BRL.BlitzGL

Incbin "picture.jpg"

Local ..
	thePixmap:TPixmap = New TPixmap, ..
	theTexture:Int

thePixmap = LoadPixmap("incbin::picture.jpg")
theTexture = bglTexFromPixmap(thePixmap)


Also it makes no difference whether i "New TPixmap" or not, so I guess I shouldn't.

HELP!


TeraBit(Posted 2005) [#2]
My current project uses these:
Framework BRL.BLITZGL
Import BRL.Retro
Import Pub.Glew
Import BRL.Pixmap
Import BRL.Max2D
Import BRL.PNGLoader
Import BRL.JPGLoader



Ibmurai(Posted 2005) [#3]
That gives me the same result as not using Framework and Imports - a crashing app. :(


Ibmurai(Posted 2005) [#4]
Hmm got it working in practice now by importing Ramstream (I guess retro does this?) and jpgloader... But the minimal app I've posted still crashes :S
I guess this is OK, but it makes me nervous about whether my project will work further down the road...


TeraBit(Posted 2005) [#5]
Not sure. But I don't use IncBin, which I think is probably responsible for the RAMSTREAM dependancy.


EOF(Posted 2005) [#6]
*Plug*

My Framework Assistant should help you here.
It'll scan through your source and produce a framework template which you can then paste into your code.

Just to make life easier. Click my sig for link.