Null Max2dDriver

BlitzMax Forums/MaxGUI Module/Null Max2dDriver

TwoCorin517(Posted 2008) [#1]
I'm trying to add a map to my GUI, but I've run into a problem... Its giving me the usual error.
Unhandled Exception:Attempt to access field or method of Null object
But its reporting it on _max2dDriver.Cls within Cls().




kfprimm(Posted 2008) [#2]
I'm guessing that it's because you failed to import BRL.D3D7Max2D and BRL.GLMax2D.


plash(Posted 2008) [#3]
Just a note: that is a horrible implementation for a module.


TwoCorin517(Posted 2008) [#4]
Khomy Prime:
I included the code to import those, but nothing happened different, same problem.

Plash:
I obviously didn't include ALL the code... so there are some reasons for some manipulations. Another thing is that I'm still working on getting it functional, I've not even begun work on one aspect... I intend on getting it functional first, then pretty, and finally fast if necessary.

In any case, I'd be interested in knowing what's so wrong about it, and what you would do to fix it.. I'm aware that I'm using too many Globals and I intend on eliminating many of them, some however require direct manipulation in the main program.


plash(Posted 2008) [#5]
A module should contain types/functions/features frequently used, you will probably run into some problems using the constant state of your gadgets, and the like, with the way it is.


TwoCorin517(Posted 2008) [#6]
Ah... Well I'm not exactly making a module per ce. Its more of a framework/engine/base on which to build a game... I'm mostly developing it for myself.


plash(Posted 2008) [#7]
I included the code to import those, but nothing happened different, same problem.
Did you recompile the module..?


TwoCorin517(Posted 2008) [#8]
The changes wouldn't be implemented if I didn't. Anyway, yes I did.


jsp(Posted 2008) [#9]
Does it help if you add this line before the CLS:
SetViewport 0,0,GadgetWidth( Map_Canvas),GadgetHeight( Map_Canvas)


TwoCorin517(Posted 2008) [#10]
I've now tried that, nothing changed.
And I recompiled the module.