Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Pointers to Core Services (like Fulcrum Physics)

Author
Message
iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 24th Mar 2011 01:30
Weird, I thought I posted this before, but it didn't show up....

Anyway, I'm beginning to write out the framework for my game which uses DarkGDK and Fulcrum Physics. Now, with Dark GDK functions like dbLoadObject() I can invoke from anywhere since it's not wrapped within a class (as long as I include the header file, I can invoke globally I guess you can say). But with FulcrumPhy I need to invoke it via pointer because there should only ever be one instance (right?).

So say I have a class GameEntity and it needs to use FulcrumPhy functions like setLinearVelocity. Should I just have a member pointer like FulcrumPhy *FP; inside the Entity, and pass it a pointer to the current live instance of FulcrumPhy every time I instantiate? Isn't that kinda memory intensive (one pointer for each object on screen)?
iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 24th Mar 2011 05:35
** I THINK I SOLVED IT **

The way I'm working on using Fulcrum Physics in my classes is...

I created a class called WorldPointers, and I put a static FulcrumPhy* pointer in there, with a static accessor function. That way I can call WorldPointers::getFulcrumPhy() from anywhere!

Login to post a reply

Server time is: 2024-11-19 12:40:50
Your offset time is: 2024-11-19 12:40:50