Which module do I import to use Incbin?
BlitzMax Forums/BlitzMax Beginners Area/Which module do I import to use Incbin?
| ||
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. |
| ||
Try:Framework BRL.GLMax2D Import BRL.PNGLoader Import BRL.Blitz |
| ||
Nope, importing brl.blitz doesn't fix it. I've been assuming that brl.blitz is always imported anyway. |
| ||
I've found something that works. Oddly, 'brl.retro' gets the incbin:: device working. Surely that's wrong... |
| ||
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. |
| ||
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'. |
| ||
Hence... although you could probably prune it down even more ...in my previous post. |
| ||
Yes, I did catch that part. Thanks for your help. |
| ||
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.... |