Jump to content
  • Advertisement


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


#Includes and where to

This topic is 5330 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 have been working with D3D for some time and always followed the SDK framework and put all includes in the .cpp source files. I believe this is more compiler effecient, or so I''ve read. Anyway, I have transported myself back in time and have started using DirectDraw7. I am using the exact same Windows application as used for D3D, when using D3D I include the d3d9.h header file as usual in the base class source file and no problems. Yet when I put the ddraw.h header file include in the base class source file, it does not pick it up. The code is fine and it should work. So I put the ddraw.h header include in the base class .h header file. It picked up, compiled succesfully and run without a hitch. Is this something to do with the ddraw.h/ddraw.lib files. Is it something to do with my compiler path setup? Why is it only happening with ddraw.h? Anyone out there help?

Share this post

Link to post
Share on other sites
On the whole it is better to try and place your includes in cpp files as it prevents twisted dependecies, and *should* compile faster. You can use forward declarations and the like to refrence objects you might need.

Of course sometimes its required to place a header in a header, and thats fine too, just try to avoid it if its not required.

If you don''''t gosub a program loop you''''ll never get a sub-routine - Kryten Red Dwarf

Share this post

Link to post
Share on other sites

  • 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!