Problems using FRAMEWORK command
BlitzMax Forums/BlitzMax Programming/Problems using FRAMEWORK command
| ||
I'm afraid I have to admit I have something I cannot understand... How do I use Framework? I have a sample module... Module itspeedway.test ' Import Brl.linkedlist Import brl.retro ' ModuleInfo "Author: Si Dunford" ' Function testmodule$() Return "Hey its ok" End Function The module works fine like this: Framework itspeedway.test Print testmodule() But when I try to use graphics, I get an error, 'Unhandled Exception: Attempt to access field or method of Null object' in module Brl.Max2d - SetBlend() Framework itspeedway.test Import brl.max2d Graphics 800 , 600 SetBlend(ALPHABLEND) DrawText( testmodule(), 0,0 ) Is there a module I should be including that initialises the graphics object? |
| ||
Looks like you haven't imported an implementation of Max2D. Max2D is just a generic 2d engine with no renderer implemented. Graphics defaults to DX now, I guess, so you would also need to Import brl.d3d7max2d Does that do it? EDIT: Fixed sleepy typo. |
| ||
I get the error Compile Error: Expecting identifier but encountered Mod. I think I see what you are saying. I have to select DirectX etc with the appropriate module... I tried, this but it failed too. Import brl.dxgraphics |
| ||
Try to scan your module with Framework Assistant and see what's required? |
| ||
Take out the hard work and use the excellent FrameWork Assistant |
| ||
Sorry, still half asleep. I meant to typeImport brl.d3d7max2d |
| ||
Sorry, still half asleep. I meant to type Import brl.d2d7max2d Should really be listening to the half that's awake as it *IS* brl.d3d7Max2d. :-) |
| ||
Should really be listening to the half that's awake as it *IS* brl.d3d7Max2d. :-) Yes it is, but that's not what I typed originally either ;) I fixed up the first message and then typoed again when adding a reply :P |
| ||
Framework assistant says I need:Framework BRL.GLMax2D Import itspeedway.test or Framework BRL.D3D7Max2D Import itspeedway.test Does that mean mine cannot be a framework? |
| ||
I have no idea why the code you've posted is expecting Pub.win32 and BRL.Win32MaxGui. Does it compile OK if you take them out? When I run FA against Framework itspeedway.test Import brl.max2d Graphics 800 , 600 SetBlend(ALPHABLEND) DrawText( testmodule(), 0,0 ) it returns : Framework BRL.GLMax2D or Framework BRL.D3D7Max2D You can then use the compiler directives to make the code x-platform |
| ||
Thanks, the Win32 bit was my mistake. I ran Fa against the wrong source file... |
| ||
I've never really known the real difference between Framework and Import so I came up with an explanation which I'm happy with. Some modules provide a 'basic template' as they import a number of modules themselves. This means you don't have to specify all the imported modules individually. These would be your starting 'framework'. However, on top of the framework, you might need some additional function. These are not necessary for the template and would cause .exes to be larger than necessary so BRL have made them 'optional'. These are your imports. That's my guess anyway. Your module *can* be a framework if you want it to be. It's whether it will be used a a base template or as additional function is the question. |
| ||
Posted 2 days ago? I knew I was sleepy, but I had no idea I'd dozed off for 2 days there. The only real difference between Framework and Import is that Framework says Import blah ( and don't import anything else. ) where as Import just says import this ( plus whatever else you have lying around. ) Framework is to stop all the standard BRL modules you're not using being imported anyway. The alternative, I guess, would be to never import modules unless you ask for them, but that's a lot less beginner friendly, so I think the chosen way is best. |
| ||
Hello Peeps Gab, this The only real difference between Framework and Import is that Framework says Import blah ( and don't import anything else. ) where as Import just says import this ( plus whatever else you have lying around. ) Is this true of Moduals. Because I dont use framework in a mod import If you see what I mean ;) |
| ||
No, it's not true of modules. Modules can't "see" any BRL module commands unless you explicitly import the module. |