I ported my Opengl project from Qt to MFC with success.. only in debug mode.
Everything works great in debug mode.
It even works in release mode, as long as _DEBUG is defined. If it's not, every OpenGL function get called, but without result on the screen.
I use no assert function anywhere in the code. I use Glew to get OpenGL function pointers.
Here is the (slow) OpenGL function, even if I don't think it will really help:
void COpenGLView::Render()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
for(u32 i = 0; i < 144; ++i)
{
for(u32 j = 0; j < 160; ++j)
{
switch( lcd_[(i * 160)+j] & 0x3 )
{
case WHITE: glColor3f(0.75f,1.0f,0.75f); break;
case LIGHT_GREY: glColor3f(0.50f, 0.80f, 0.50f); break;
case DARK_GREY: glColor3f(0.25f,0.60f,0.25f); break;
case BLACK: glColor3f(0.0f,0.0f,0.0f); break;
}
glVertex2d(j,i);
glVertex2d(j,i + 1);
glVertex2d(j + 1,i + 1);
glVertex2d(j + 1,i);
}
}
glEnd();
FinishRender();
}
So the main problem is: There is nothing OpenGL-related on the screen if _DEBUG is not defined!
Anyone know where do this problem come from?