pouët.net

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 ?
added on the 2003-06-07 22:44:32 by gelis gelis
btw. i use the Sdk of 9.0, not 9.0a, does it change anything ?
added on the 2003-06-07 22:46:30 by gelis gelis
use /nodefaultlib compiler option and recode CRT routines in assembler. it should enable you to win between 10 and 20kbytes.
added on the 2003-06-08 08:40:06 by nystep nystep
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)
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.
added on the 2003-06-08 10:44:11 by ryg ryg
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!
added on the 2003-06-08 12:14:49 by vizual vizual
thanks for the info, I could compile a 4k exe... Would openGL be smaller than DX though ?
added on the 2003-06-08 16:40:06 by gelis gelis
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.
added on the 2003-06-08 21:40:53 by vizual vizual

login