hi,
i have multiple module (.bas files) open in fbide 0.4 with fb 0.14.
certain modules like draw the mouse, animation etc..
how should i go about initializng sdl, blitiing, etc..
currently i run into many error & craches passing pointers & stuff around...
thanx
multiple modules & sdl
-
- Posts: 341
- Joined: May 27, 2005 7:01
- Location: Canada
- Contact:
Well, you need a main module, that will call the functions on each module to do the initializations.
FB will make the first .bas file passed to command line the main module.
Try not use inter-module global vars and arrays, but if they are really needed, use COMMON to share them.
Always use OPTION EXPLICIT on each source file, any typo on a global var and things can start to not work.
Don't put dynamic arrays in module level (outside functions) if it's not the main module, the arrays will never be allocated (as in QB). If you have global dynamic arrays, declare them as "dim shared myarray() as sometype" in the module level and allocate the array inside an Init or so function using "redim myarray(lower to upper)" etc.
FB will make the first .bas file passed to command line the main module.
Try not use inter-module global vars and arrays, but if they are really needed, use COMMON to share them.
Always use OPTION EXPLICIT on each source file, any typo on a global var and things can start to not work.
Don't put dynamic arrays in module level (outside functions) if it's not the main module, the arrays will never be allocated (as in QB). If you have global dynamic arrays, declare them as "dim shared myarray() as sometype" in the module level and allocate the array inside an Init or so function using "redim myarray(lower to upper)" etc.
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
-
- Posts: 1759
- Joined: May 23, 2007 21:52
- Location: Cut Bank, MT
- Contact: