Archived

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

D3DX Bloat

This topic is 5148 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

Hi, I''m trying to make a small program which is at the moment around 60kb in size, but the addition of the ID3DXSprite interface from d3dx bloats it right up over half a meg. Do you know how I could "rip" the ID3DXSprite interface and associated functions out of d3dx so i''m using only them, or somehow get the filesize down to a sane level? Thanks

Share this post


Link to post
Share on other sites
I don''t think there''s a way to get just one interface out of the library. Perhaps you can write your own sprite routine using regular d3d and that might be smaller. There''s some good tutorials on this site about how to do that. I''m not totally sure if it would end up smaller though.

Share this post


Link to post
Share on other sites
What d3dx header file are you using? If you are using the main one (d3d9x.h) you could just use the one with ID3DXSprite in it.

Mentioning that... let me look that one up...

Ouch.. I guess you use d3dx9core.h . That might help, but if it doesn''t listen to Anozireth''s advice.

Share this post


Link to post
Share on other sites
Does it bloat it up that much when you compile as Release? I always though VC++ was pretty good at removing unreferenced calls from a LIB file, but maybe I''m wrong.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
I don''t think changing the header file does anything, as the compiler should remove the unreferenced code/functions/etc automatically, so it''s probably the d3dx9.lib file. Or maybe you''re not specifying small executable optimization in your project settings (MSVC++).

Share this post


Link to post
Share on other sites
Regarding "including the header file with ID3DXSprite": All D3DX headers include d3dx9.h, which in turn includes all D3DX headers.

Regarding the 5 MB thing:
quote:
Dave Bartholomeo (MS) once said, on DIRECTXDEV
While function level linking is typically disabled for debug builds, the linker still only pulls in only the individual .obj files that it needs.
A static lib is just a big bag of .obj files. If you reference at least one symbol (function, variable, etc.) from a particular .obj in a library, the linker brings in the whole .obj, but it doesn''t necessarily bring in any other .objs from that library. Linking to the static debug lib for D3DX won''t make your .exe 5MB bigger, unless you manage to
reference something from every single one of the 205 .obj files that make up d3dx9dt.lib


Muhammad Haggag

Share this post


Link to post
Share on other sites