Please sample code using multiple libraries?
Posted: Tue Mar 01, 2005 12:46 am
Hi, now a new problem. My code is getting kind of spaghetti, having initialization of openal + it's buffers + the sounds it must load, and then also my graphics, which are now somewhat in the count of 29, and with all the parameters, it might get kind of weird (still missing some more houses). I want to load elements separately beacause i believe they take less overhead on the system (pretty much using the same code as in the collision example, where 3 instances of the faerie are loadaed). That way i can have 1 house and then instance it 13 times or so, then a factory and do the same...i believe the way to do more readable and friendly code is to:
a) initialize graphics (main code) and load houses (external file)
b) initialize sound (main code) and laod sound (external file)
d) begin a loop, in each cycle check for logic and update
e) on exit kill sound, kill grapchis, close
If that's the kind of logic, can somebody please share some code showing:
1- Openl al implementation ? (can it be used form an external file?)
2- How to load object from another file (like an include file wchich has the code to load several objects). This possible or am i way off?
I know this is my own limitation beacause i'm not yet that fluent in c++, but some code will be really appreciated, thanks.
a) initialize graphics (main code) and load houses (external file)
b) initialize sound (main code) and laod sound (external file)
d) begin a loop, in each cycle check for logic and update
e) on exit kill sound, kill grapchis, close
If that's the kind of logic, can somebody please share some code showing:
1- Openl al implementation ? (can it be used form an external file?)
2- How to load object from another file (like an include file wchich has the code to load several objects). This possible or am i way off?
I know this is my own limitation beacause i'm not yet that fluent in c++, but some code will be really appreciated, thanks.