Problems width Framework

BlitzMax Forums/BlitzMax Beginners Area/Problems width Framework

sczerbiak(Posted 2005) [#1]
hi!!
i was trying to get started width frameworks.. i was trying the examples but it gives me always this error message -- Unhandled Exception: Attemp to access field or method of Null object.

the sorce code is:

Rem
:Import specifies the external BlitzMax modules and source files used by the program.
End Rem

Framework BRL.GlMax2D

Import BRL.System

Graphics 640,480,32

While Not KeyHit(KEY_ESCAPE)
Cls
DrawText "Minimal 2D App!",0,0
Flip
Wend


JazzieB(Posted 2005) [#2]
Are you running Windows? If so, it will default to DirectX and you're importing the OpenGL module. So, all you need to do is SetGraphicsDriver GLMax2DDriver() after your last Import and before Graphics.

The sample in the docs was written before there was a DirectX module.


klepto2(Posted 2005) [#3]

Framework BRL.GlMax2D

Import BRL.System
Rem
Very important as you only include the Gl Drivers but BMax 
uses DX as a standard in windows
End Rem

SetGraphicsDriver(GLMax2DDriver())

Graphics 640,480,32

While Not KeyHit(KEY_ESCAPE)
Cls
DrawText "Minimal 2D App!",0,0
Flip
Wend 


Thats because you have only included the BMax OpenGl Drivers .
But BMax runs with DX drivers on standard in Windows, so you have to switch to OpenGl before the Graphics command.


EOF(Posted 2005) [#4]
If you get stuck with which modules you are supposed to include and which you don't need have a look at my Framework Assistant.


sczerbiak(Posted 2005) [#5]
yeh :p i was seing some posts and found your FA program that resolved my problem :D but thank you all anyway :D