Odd compile error

BlitzMax Forums/BlitzMax Programming/Odd compile error

Pineapple(Posted 2010) [#1]
SuperStrict

Framework BRL.System 'minimize the size of the compiled interpreter
Import BRL.LinkedList
Import BRL.Max2D
Import BRL.Graphics
Import BRL.Retro
Import BRL.Blitz

[[wall of code]]

'execute the program
AppTitle="Madness VM"
Graphics 400,300

Global io:console=New console
io.add "This is a test"
io.update 0
Flip
WaitKey

Parse code



The compiler throws me an error at Flip, "Attempt to access field or method of null object". Why?


Zeke(Posted 2010) [#2]
you must import one graphicsdriver module

Import BRL.D3D7Max2D

or
Import BRL.D3D9Max2D

or
Import BRL.GLMax2D



GfK(Posted 2010) [#3]
Its because there is no graphics object being created. There are two reasons.

First, you'll need Import BRL.D3D9Max2D.

Second, running that code in release mode will force it to fullscreen, and your hardware likely doesn't support that resolution in fullscreen. Try 640x480 or 800x600.

[edit] I'd recommend Framework Assistant to avoid problems like this in the future.


Pineapple(Posted 2010) [#4]
Cool, thanks.