Which module do I import to use Incbin?

BlitzMax Forums/BlitzMax Beginners Area/Which module do I import to use Incbin?

Wayward(Posted 2005) [#1]
I'm trying to load an image that has been incbinned. Here's some sample code:
Framework BRL.GLMax2D
Import BRL.PNGLoader

Graphics 1024, 768

Incbin "image.png"

Global MyImage:TImage = LoadImage( "incbin::image.png" )

Repeat
	Cls
	DrawImage MyImage, 0, 0
	Flip
Until KeyHit( KEY_ESCAPE )

The sample fails at 'DrawImage' with 'Unhandled Exception: Attempt to access field or method of Null object', indicating the prior 'LoadImage' didn't succeed.

It will work if I remove the 'incbin::' and just load the image from a file, so I've imported all the required modules to load and display a png image.

It will work with the 'incbin::' if I take out the framework command, suggesting that I'm not importing the module that makes 'incbin::' work.

Which module do I need to import to get 'incbin::' working? I've tried every one I can think of.


EOF(Posted 2005) [#2]
Try:
Framework BRL.GLMax2D
Import BRL.PNGLoader
Import BRL.Blitz



Wayward(Posted 2005) [#3]
Nope, importing brl.blitz doesn't fix it. I've been assuming that brl.blitz is always imported anyway.


Wayward(Posted 2005) [#4]
I've found something that works. Oddly, 'brl.retro' gets the incbin:: device working. Surely that's wrong...


Yan(Posted 2005) [#5]
I think 'brl.basic' is the module you're looking for (although you could probably prune it down even more), 'brl.retro' also imports this but the retro mod itself isn't needed for your code.


Wayward(Posted 2005) [#6]
I looked in 'retro.bmx' and found the 'Import brl.basic'. Importing brl.basic does work, but all 'basic.bmx' does is a load more imports. I've wittled it down to 'Import brl.RamStream'.


Yan(Posted 2005) [#7]
Hence...
although you could probably prune it down even more
...in my previous post.


Wayward(Posted 2005) [#8]
Yes, I did catch that part. Thanks for your help.


Damien Sturdy(Posted 2005) [#9]

I've wittled it down to 'Import brl.RamStream'



As did I about 5 weeks back, i could have sworn i posted about that??n Oh well....