DX9 - Small executables
category: general [glöplog]
hello
I'm trying to make a 64k intro with Visual .NET 2002 in C++ and my exe can't get under 33kb after max compression with UPX 1.24 (and complaining about the PE). I used the main tricks that worked with Visual 6 (msvcrt.lib, WinMainCRTStartup). The only included header is d3d9.h and the libs are d3d9.lib + msvcrt.lib.... Any hints to get below this 33kb limit ?
I'm trying to make a 64k intro with Visual .NET 2002 in C++ and my exe can't get under 33kb after max compression with UPX 1.24 (and complaining about the PE). I used the main tricks that worked with Visual 6 (msvcrt.lib, WinMainCRTStartup). The only included header is d3d9.h and the libs are d3d9.lib + msvcrt.lib.... Any hints to get below this 33kb limit ?
btw. i use the Sdk of 9.0, not 9.0a, does it change anything ?
use /nodefaultlib compiler option and recode CRT routines in assembler. it should enable you to win between 10 and 20kbytes.
my exe files are smaller with vs.net2003 than with vc6 so i wonder what you have been doing wrong :-)
(i use opengl though, but that shouldn't mean alot)
(i use opengl though, but that shouldn't mean alot)
You can easily get a working DX startup in a <4k executable.
But unless you're a bit more specific about what you're doing, it's relatively hard to help you.
But unless you're a bit more specific about what you're doing, it's relatively hard to help you.
I've made a particle system with dx9 in 3.5kb upx compressed, 4.5kb uncompressed.
Tips: don't use any external library other than d3d9.lib, kernel32.lib and user32.lib. You certanly have to use them. Choose compiler optimizations to minimize size. Disable inline function expansion. Don't write code you won't use. If you need math functions, code them (including trig, vector and matrix handling).
Happy coding!
Tips: don't use any external library other than d3d9.lib, kernel32.lib and user32.lib. You certanly have to use them. Choose compiler optimizations to minimize size. Disable inline function expansion. Don't write code you won't use. If you need math functions, code them (including trig, vector and matrix handling).
Happy coding!
thanks for the info, I could compile a 4k exe... Would openGL be smaller than DX though ?
don't know, never coded opengl, only direct3d. there are some tuts in the hugi diskmag about small opengl startups in windows. check them out.