Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Blitz => Topic started by: Shockwave on May 07, 2011
-
I downloaded the trial version today and I've been having a play with some of the examples that are included, I've been quite impressed with the language at first glance, expecially the ease that you can use Opengl so I wondered what the trade-off is and looked at the exes and they are pretty big, all of them well over 1mb.
I've seen smaller bmax stuff so I'm wondering if it's possible to get the exe size right down, and if so - how to do it?
-
Download the FrameWork assistant from here: http://homepage.ntlworld.com/config/fa/index.htm (http://homepage.ntlworld.com/config/fa/index.htm)
Let that software examine you source and it will tell you what line to put at the top of your code so that it only compiles the actual modules you are using into your final exe. That combined with upx should do a fairly good job at getting the file size down.
Alternatively you could start messing about with cutting unwanted stuff out of the modules to shrink them further down, but I am not sure I would recomend that. I think that bmax is the best programming language I have ever used and it is still the language I use when I need to make something for the pc.
-
That framework iss a really cool idea :)
I'm going to try it out for 30 days and if I get hooked in the 30 days I'll buy the full copy.
Thanks mate.
-
Framework assistant is very useful tho I have found the odd time it misses a module i need to include or occasionally adds one that i dont, but thats generally when I am not using the default graphics drivers :P
Outside of the framework setup the only way to get smaller exe's is to make your own window and graphics setup code with the bare minimum of stuff in it, which is what I did, but depending on what other modules you include it can have less impact on the overall exe size.
Oh and if you think the easy of opengl useage is simple, you can include the glew module, the call glewinit() and get access to all the extensions etc. in opengl up to about version 2.1 I think with the default version of glew, you can upgrade that yourself, or if you understand how to do it you can create your own code to get the extensions you want without glew, which is something me and zawran did and what ultimately led to me making the small gl framework code as glew takes up a few kb but does make it easy to start with :)
As zawran has said, bmax is probably one of the best languages I have ever used, it's easy to understand but extremely powerful, the oop stuff is so useful, the methods for types act like c++ class's and you can extend types based of other types. But if you dont want to you dont have to do any of that stuff and can code stuff like old blitz basic as well.
-
Framework assistant is very useful tho I have found the odd time it misses a module i need to include or occasionally adds one that i dont, but thats generally when I am not using the default graphics drivers :P
Outside of the framework setup the only way to get smaller exe's is to make your own window and graphics setup code with the bare minimum of stuff in it, which is what I did, but depending on what other modules you include it can have less impact on the overall exe size.
Oh and if you think the easy of opengl useage is simple, you can include the glew module, the call glewinit() and get access to all the extensions etc. in opengl up to about version 2.1 I think with the default version of glew, you can upgrade that yourself, or if you understand how to do it you can create your own code to get the extensions you want without glew, which is something me and zawran did and what ultimately led to me making the small gl framework code as glew takes up a few kb but does make it easy to start with :)
As zawran has said, bmax is probably one of the best languages I have ever used, it's easy to understand but extremely powerful, the oop stuff is so useful, the methods for types act like c++ class's and you can extend types based of other types. But if you dont want to you dont have to do any of that stuff and can code stuff like old blitz basic as well.
I've been using a framework that RBZ developed for Opengl for the past few years and it makes tiny executables, sub 10kb crunched if it's only simple effects being done but to be honest with you the ease that you can just open a screen up and start prototyping is what appeals to me about it the most. I may well try to port Rbz's framework to Bmax as I believe it was designed originally with 1kb intros in mind so that would probably be a good place to start. No doublt that I'll be asking questions on here while I learn stuff about it..
I'm going to see if I can make my wireframe challenge entry with Bmax.
-
I am not sure what the version of bmax is that the demo offers, but it should offer a way to just open a glgraphics screen without including all the max2d stuff. It means you have to do the gl drawing all yourself, but you have been doing that already in you FB stuff.
In the version I use you can "SetGraphicsDriver GLGraphicsDriver()" or a simpler way which also will open your screen for you and set the GLGraphicsDriver,
" GLGraphics(width,height,depth,hertz,GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER)"
this gives a basic opengl context and away you go :)
-
Also to add to your comment of easy of use and prototyping, well apart from the exe size, which isnt of course bmax's focus, it is easy to use but so expandable, the added bonus is that apart from windows specific modules (like the dx7 & dx9 ones) if you stay within the language your code will compile and run on linux and macos as well. I actually recently setup the linux version and apart from my windows specific code, everything I have ever made with bmax will compile and run on it, including my 3d engine :)
-
Yes, the portability to Linux is a very nice feature.
-
You could always just use a 3rd party app such as UPX compressor which will make your exe much smaller with little to no overhead when loading.
http://upx.sourceforge.net/