Incbin Failure

BlitzMax Forums/BlitzMax Beginners Area/Incbin Failure

spacerat(Posted 2007) [#1]
So put bluntly, here is my problem: This works...
SuperStrict
Graphics 800, 600
Global IBlock:TImage = LoadImage("Sprites\block.png") 
While Not KeyDown(KEY_ESCAPE) 
	DrawImage(IBlock, 20, 20) 
	Flip
WEnd


And this does not, it just throws Unhandled Exception:Attempt to access field or method of Null object.
SuperStrict
Graphics 800, 600
IncBin "Sprites\block.png"
Global IBlock:TImage = LoadImage("incbin::Sprites\block.png") 
While Not KeyDown(KEY_ESCAPE) 
	DrawImage(IBlock, 20, 20) 
	Flip
WEnd


EDITS: Scratch that, I found the problem: I needed to import brl.basic. Thanks for NOT making that clear bmx manual. I mean, if incbin is listed under brl.blitz, I expect to need only to import brl.blitz to use incbin. Otherwise it breaks the whole concept of the modules and including.

Sheesh.


Sledge(Posted 2007) [#2]
EDIT: Whoops, didn't see your edit!


JazzieB(Posted 2007) [#3]
Try the Framework Assistant for when trying to determine which modules to import into your code. You'll never look back, I promise ;o)


*(Posted 2007) [#4]
Incbin:: also fails on loading pixelmaps it doesnt work at all.


Brucey(Posted 2007) [#5]
IncBin requires BRL.RamStream to work, so if you are using Framework, you'll need to import it somewhere....


xlsior(Posted 2007) [#6]
If you haven't already, try using Framework Assistant -- it will give you a list of all modules that you need to import to get your program to work properly.