Onrendersizechangege offriden的访问误差减少了?
我通过DLL在WPF中托管Win32 OpenGL窗口。在DLL中,当我尝试从基类 hwndhost 中覆盖 时,我会发现它被降低访问被覆盖。为什么会发生这种情况?如何解决?
我正在关注这两个教程和演练:托管WPF中的Win32控件。后者来自微软。
这是我的功能:
virtual void OnRenderSizeChanged(SizeChangedInfo^ sizeInfo) override
{
if (m_hDC == NULL || m_hRC == NULL)
return;
// Apply DPI correction
// NOTE: sizeInfo->NewSize contains doubles, so we do the multiplication before
// converting to int.
int iHeight = (int)(sizeInfo->NewSize.Height * m_dScaleY);
int iWidth = (int)(sizeInfo->NewSize.Width * m_dScaleX);
if (iWidth == 0 || iHeight == 0)
return;
wglMakeCurrent(m_hDC, m_hRC);
glViewport(0, 0, iWidth, iHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, 1.0, 100.0);
// gluPerspective( 67.5, ((double)(iWidth) / (double)(iHeight)), 1.0, 500.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个类,从基类或接口中的任何方法实现虚拟方法无法降低该方法的访问。
使该函数公开已修复。
A class that implements a virtual method from a base class or any method from an interface cannot reduce the access of that method.
Making the function public fixed it.