Framework and Graphics problem

BlitzMax Forums/BlitzMax Programming/Framework and Graphics problem

Tricky(Posted 2005) [#1]
I tried out the FrameWork command to make my executables smaller but that did not quite work.

Framework brl.system
Import brl.retro
Import brl.max2d
Import brl.linkedlist
Graphics 640,480,0

This results into the error that there was a call to a "Null" object

Framework brl.system
Import brl.retro
Import brl.max2d
Import brl.linkedlist
Graphics 640,480

This resulted in the error "Graphics Mode does not exist"

What am I doing wrong?


Dreamora(Posted 2005) [#2]
You aren't importing any driver

use import brl.glmax2d or import brl.d3d7max2d instead of brl.max2d

(or look for framework assistant :-))


EOF(Posted 2005) [#3]
You also need to use either of these commands BEFORE the Graphics call:
SetGraphicsDriver GLMax2DDriver() ' Max OpenGL
SetGraphicsDriver D3D7Max2DDriver() ' Max DX

So, for Max OpenGL:
Framework BRL.GLMax2D
Import BRL.System
Import BRL.Retro
Import BRL.LinkedList

SetGraphicsDriver GLMax2DDriver()
Graphics 640,480

For Max DX:
Framework BRL.D3D7Max2D
Import BRL.System
Import BRL.Retro
Import BRL.LinkedList

SetGraphicsDriver D3D7Max2DDriver()
Graphics 640,480

(or look for framework assistant :-))
Thanks Dreamora! --- Tricrokra, see my link.


Hotcakes(Posted 2005) [#4]
Actually, you don't NEED to use SetGraphicsDriver... if you omit it it uses DirectX by default (on win32 only obviously)...


Tricky(Posted 2005) [#5]
Well, without framework I didn't need the SetGraphicsDriver-command.
I'll try out your link and I'll take a look at that framework assistant ;)