• Advertisement
Sign in to follow this  

name collision

This topic is 3698 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