Jump to content
  • Advertisement
Sign in to follow this  
remdul

name collision

This topic is 3968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my window class I have a function void SwapBuffers(), inside which I call the Windows GL API function bool SwapBuffers(HDC hdc);
// swaps framebuffers
void CWindowExt::SwapBuffers()
{
 if (!hdc) return;
 SwapBuffers(hdc);
}
The compiler then generates the error that bool CWindowExt::SwapBuffers(HDC hdc); isn't found. How can I avoid such name collision, without renaming the class function member? (I'm using the same class in my Linux implementation, and I don't want to change the code because of a single Windows API quirk.) Any generic solution for similar problems will be greatly appreciated. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Use ::SwapBuffers() to access the function at file scope (which is presumably where the other function exists.)

Share this post


Link to post
Share on other sites
Whoa! Instant reply. :)

Yes, works like a charm. I never even knew you could do that.

Cheers mate!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!