I have a dll written in c++ to render a scene to a window.
If I test with a c++ form everything gets rendered nicely but in c# there's a lot of flickering.
Here's the important code:
CEngine::CEngine(HWND hWnd)
{
m_HWnd = hWnd;
GetClientRect(hWnd,&m_Rect);
m_HDC = GetDC(hWnd);
m_Depth = 32;
SetupPixelFormat(m_HDC);
m_HGLRC = wglCreateContext(m_HDC);
wglMakeCurrent(m_HDC,m_HGLRC);
SizeOpenGLScreen(m_Rect.left -m_Rect.right,m_Rect.top -m_Rect.bottom);
m_Width = m_Rect.left -m_Rect.right;
m_Height = m_Rect.top -m_Rect.bottom;
CurrentScene = NULL;
}
And at the end of a render I have:
SwapBuffers(m_HDC);
How do the code tags work here btw?
Thank you!