Jump to content
  • Advertisement
Sign in to follow this  
infernosnow

What kind of VC++.NET project type for a game?

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

I'll be using C++ and DirectX but none of the .NET stuff. When I create a project, it asks for all these different types and I'm not sure which one I should use. I don't see anything like windows app. The closest thing is Windows Forms Application or Empty Project (.NET)

Share this post


Link to post
Share on other sites
Advertisement
You could start with a Win32 project, not console.

Just get a window and a message pump.

Share this post


Link to post
Share on other sites
Typically it's a Win32 project but you change the option to "An Empty Project" when the dialog box appears asking you what options you would like.

Gives you empty everything, you don't even get a window or message pump. Create it all yourself.

Share this post


Link to post
Share on other sites
Ok, thanks. I did Win32 and added in a C++ file. I have a DirectX book that shows how to create a window and register it, then with DX9 create a DX object, rendering device, clear the screen, display the scene, clean up by releasing objects I've used, and a few other little things. About 6KB of code.

When I build my project, the application is 120KB big. This... seems slightly large for only 6 KB of actual program language code. Is this normal?

Share this post


Link to post
Share on other sites
Try building it in release mode, that'll bring your executable size right down - but do this only when you're about to make a release version of your program.

Share this post


Link to post
Share on other sites
Also, go into the project's properties, go to the C++->Code Generation settings and set Runtime Library or whatever it's called to Multithreaded Debug DLL for your Debug build and Multithreaded DLL for your Release build. That will chop off quite a bit more of your executable's size (but will require every target machine to have the DLL file for the C and possibly C++ library, which you can distribute with your application anyway).

Share this post


Link to post
Share on other sites
WOW. Changing it to release mode brought it from 120 to 30KB. Then the DLL trick brought it down to 5. Incredible. I'm so glad I asked about this. Thanks a lot guys.

I did however, try to run it on my other computer, but couldn't get it to work. As you said, you have to instal the multi-threading dll file on whatever machine it will be running on in order for the application to run. I looked up the name in help and it's msvcr71.dll and then attempted to copy that file to my system32 directory on my computer to install it, but it said the file could not be replaced because it was already in use by windows. Inevitably, my question is, how do I get around this?

Share this post


Link to post
Share on other sites
You link the library statically again, and back you are, with a larger executable, just to choose.

EDIT: however, there are "small" replacements that can bring the file size down even more, but why care? I mean you are making a game... and that will need one texture, and oops there you are, already passed the size of your final exe.

Share this post


Link to post
Share on other sites
If it says it couldn't replace the file, that means there's already a copy of it in there. If your program uses the C++ standard library as well as the C library you may also need msvcp71.dll. If you want to run the debug builds of the program you would need msvcr71d.dll and msvcp71d.dll.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!