How do you deal with tons of different same fundamental data types?

Started by
14 comments, last by Norman Barrows 8 years, 6 months ago


I will split all the work into two projects (which was not the initial intention because I am actually working alone on it).
Euhm, how is the number of projects related to the number of people working on it?

The normal reason to make a separate project is to handle code sharing between projects (eg you make a library that you want to use in other projects too), or due to licensing or code support reasons (maybe you make code for special device that not everybody has).

Secondly, why do you need two projects?

It's perfectly fine to include 3rd party header files into the .cpp file, possibly with declaring some classes in the header file to make the compiler happy.

In that way, the "pollution" of the 3rd party definition stays within a few .cpp files, instead of spreading to the entire project.

Advertisement


I will split all the work into two projects (which was not the initial intention because I am actually working alone on it).
Euhm, how is the number of projects related to the number of people working on it?

The normal reason to make a separate project is to handle code sharing between projects (eg you make a library that you want to use in other projects too), or due to licensing or code support reasons (maybe you make code for special device that not everybody has).

Secondly, why do you need two projects?

It's perfectly fine to include 3rd party header files into the .cpp file, possibly with declaring some classes in the header file to make the compiler happy.

In that way, the "pollution" of the 3rd party definition stays within a few .cpp files, instead of spreading to the entire project.

Usually it's not related. But I am not working on a "huge" project, and I also like to keep things simple. I am also lazy and I do not like spending much time into VS project settings : p

Since I usually work with a laptop and since I usually need to stay in battery mode only, splitting into two project will allows me to include the winAPI headers into PCH where I need, this will speed up the compilation a lot and deny annoying accurate header-include-tree planning. Finally I really like to abuse the static analysis tools, so compilation time get more important than ever for me.

I know these are not good practice in general, but they should works for me.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/
@alessio1989 sorry for the downvote, I hit the -1 button when trying to go back to previous page from my phone, it was not my intention to downvote

no problem.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

I've worked with quite a few engines that put "windows.h" into the PCH, which pollutes every single damn file... IMHO this is a terrible thing to do.


QFT.

Rage fills me every time I see that happen.

Not only does it pollute the files, but then other team members end up _using_ the bullcrap that's in windows.h, and then when it comes time to port your game to another platform you end up having to rewrite goofy Windows functions for all your platforms (and accept any inefficiencies or the like imposed by trying to wrap a Windows interface around a non-Windows OS' primitives).

If you ever include windows.h from another project-public header, you done goofed.

Sean Middleditch – Game Systems Engineer – Join my team!

wrapper api's for all 3rd party libs is what i usually end up doing. its rare when you find a lib with an API so clean you couldn't greatly simplify it with a wrapper api.

an example, my wrapper API for directx 9 (PODs and procedural code):

http://www.gamedev.net/blog/1731/entry-2258674-the-z3d-api/

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement