I learn to use glDrawPiexls to draw a bitmap on a top main window, and it works well.
But when I use the same code on a ChildView of a main window, It doesn’t work, so I wonder why? Can “glDrawPiexls” be used on a child window?
The calling is simple as below:
glRasterPos2i(0, 0);
glPixelZoom(1.0f, -1.0f);
glDrawPixels(640, 480, GL_RGBA, GL_UNSIGNED_BYTE, m_pImageData);
And the pixel format as:
PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
16,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0,
};
My env is Windows2000, Vs.net7.1,opengl1.0
And if anyboady have a sample code which show the usage of glDrawPixels on a child window, please let me know.
Thanks advanced.