Sign in to follow this  

name collision

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

This topic is 3630 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.

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