Skip to main content
GameDev.net gamedev.net
🔒 Locked

Reusable files

Started by Tron3k Jun 8, 2002 at 7:52 PM 8 replies 250+ views
Original Post
Tron3k
Tron3k
When you have cpp and h files that you use a lot, do you just copy them to each project when you need to use them, or do you do like: #include "c:\tron\modules\clog.h" (ie. you have a folder where you put all of them and include it directly from there). The problem with the second method is if you change it drastically it won''t work anymore, but the problem with the first method is if you add something useful, you have to recopy it to the project folder. What do you guys do? Firebird Entertainment
“[The clergy] believe that any portion of power confided to me, will be exerted in opposition to their schemes. And they believe rightly: for I have sworn upon the altar of God, eternal hostility against every form of tyranny over the mind of man” - Thomas Jefferson
IndirectX
IndirectX
The include way. If you change something for the better, the old project(s) will benefit from the changes as well.
---visit #directxdev on afternet <- not just for directx, despite the name
Tron3k
Tron3k
OK, well I guess I''m going to have to change everything then, because I''ve been doing the copying thing. Thanks for your advice.

Firebird Entertainment
“[The clergy] believe that any portion of power confided to me, will be exerted in opposition to their schemes. And they believe rightly: for I have sworn upon the altar of God, eternal hostility against every form of tyranny over the mind of man” - Thomas Jefferson
elis-cool
elis-cool
I copy, its no big deal, and if you end up changing something wrong you have a backup... also some stuff may vary slightly from project to project...

CEO Plunder Studios
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
IndirectX
IndirectX
quote:
Original post by elis-cool
I copy, its no big deal

The problem comes when you have two projects that are using the same shared file. If you modify it and forget to copy the file back, you might modify the other one next and you'll be in a big mess. Besides, why copy files around if you can reference the same file?
quote:

also some stuff may vary slightly from project to project...


If you have to 'slightly' change common files to suit different projects, then they are not really common. They have have project-dependent specifics that prevent them from being truly common. They are more like 'parts of a specific project that can be used in other projects with certain modifications' than 'common files that can be used in any project (within reasonable constraints, of course) for whatever they are doing'.

[edited by - IndirectX on June 8, 2002 10:21:11 PM]
---visit #directxdev on afternet <- not just for directx, despite the name
phueppl1
phueppl1
Create an own folder within your Visual C++ include folder and off you go..

just my 2 cents,
cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states )
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
George2
George2
How about putting them in a dll.
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
caffeineaddict
caffeineaddict
if you use stuff alot, like initialization code for DirectX or OGL, just make a library, then make calls to it, alot simpler, and i think it''s alot cleaner. Just my 2.49183 Japanese Yen ( two cents for you who are too lazy to go see what it equals

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.