I am developing a plug-in in C++ inside a 3rd party program and need to display a window with OpenGL. I want to program in Win32 directly (ie. not use MFC or other wrappers).
I downloaded NeHes Win32 tutorial and compiled and ran it succesfully on my machine.
However this is a main program that loops and calls PeekMessage and then TranslateMessage and DispatchMessage if there was any message and redraws the OpenGL if not.
I want to "spawn-off" a Win32 OpenGL window and then return control to the 3rd party program:
void DisplayOpenGLWindow_ButtonPressed() {
CreateWindowEx(...);
InitOpenGL(...);
return;
}
But how do I get the new window to redraw the OpenGL scene? I tried to add a call to redraw OpenGL inside the callback function:
case WM_PAINT:
{
DrawGLScene();
return 0;
}
But this is not working; the window is all white even if the clear color is black. Resizing and moving the window does not help.