Sign in to follow this  
Estraven

Pointer dereferences

Recommended Posts

Are pointer dereferences bad for game programming? Consider the case where you have a Game Engine designed in OO fashion. i.e. Graphics Engine, Input, Sound, etc. All function calls to the engines look something like this: gGraphics->...(...); Would it be better to just use C-style modules? Thanks, Est

Share this post


Link to post
Share on other sites
Using the OO approach is good as it makes cleaning up the code very easy (via deconstructors). But it all depends on how you want the engine to look when it's done. I'm using the namespace approach:
System::Graphics::DrawLine(0,0,100,100);
if(System::Input::Mouse::ButtonDown(LEFT)) ...
Again, it's completely up to you and how you want your engine to look.

Share this post


Link to post
Share on other sites
Thanks for the reply. Namespaces are in the unfamiliar territory for me. I'm so used to unix programming, and it is not very cutting edge.

When you call DrawLine like this,

System::Graphics::DrawLine(0,0,100,100);

What object are you using? Is it the COM interface?

Dave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this