Archived

This topic is now archived and is closed to further replies.

Two windows questions

This topic is 5651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1)Why are my win32 D3D apps so huge? I mean 600K for an app which basically initialises d3d and nothing else? Why is this bloat there? I''ve seen demos in DX which are 64K including all textures and music - my app has no textures or even resources and must be under 200 lines of code, maybe under 100. What''s going on? 2)What exactly to the precompiled headres do in vc++? What difference does it make if I don''t have stdafx.h/.cpp in my projects?

Share this post


Link to post
Share on other sites
quote:
Original post by d000hg
1)Why are my win32 D3D apps so huge? I mean 600K for an app which basically initialises d3d and nothing else? Why is this bloat there? I''ve seen demos in DX which are 64K including all textures and music - my app has no textures or even resources and must be under 200 lines of code, maybe under 100. What''s going on?



Open windows.h and start tracing through the headers that are included. Every function prototype must have a definition somewhere, so there you have it...

2)What exactly to the precompiled headres do in vc++? What difference does it make if I don''t have stdafx.h/.cpp in my projects?

afaik, they only speed up compile time ...

Crispy

Share this post


Link to post
Share on other sites
1)if you havent done it already switch from Debug mode to Retail mode, also make sure you are using the shared libraries.

2)they make compile times shorter by compiling the headers you wont be modifing much or at all during development,stdafx.h/.cpp is just a list of the headers you want to precompile, you can remove em provided that you add the headers there inside your other files, but really what you might want to do is disable/enable precompiled headers on your project settings.

Share this post


Link to post
Share on other sites
More for #1: if you''re using D3DX, you get about 200 KB once you use any math functions, and even more if you attempt to use texture/mesh functions. Try to write your app without D3DX and check file size. Also, as was already mentioned, do a release build, optimize for size (default is for speed, and there is a significant difference), and use DLLs for everything you can.

Share this post


Link to post
Share on other sites