Hi Roger, thanks..
I guess it could be my environment that is broken. But just to make
clear, most OSG examples do work, and only a few (using producer) does
give this error.
Come to think of it, its probably the WGLExtentions that doesn't work
in all those cases.
And again (i did mention it?), i did get osgpbuffer.exe to run 2-3
times out of 20 executions..
Sometimes it did create the window, but everything in it was really messed up.
And sometimes everything worked ok. Except constant memory leakage..
This is the code that i use to create my window (that works ok):
_renderSurface = new Producer::RenderSurface;
_renderSurface->setWindowName(WindowName);
_renderSurface->fullScreen(true);
_renderSurface->shareAllGLContexts(true);
_renderSurface->realize();
_sceneView = new osgUtil::SceneView;
_sceneView->setDefaults();
_sceneView->setSceneData(model);
And to update:
_sceneView->setViewport(0,0,_renderSurface->getWindowWidth(),_renderSurface->getWindowHeight());
_sceneView->update();
_sceneView->cull();
_sceneView->draw();
_renderSurface->swapBuffers();
I don't really know where to go from here, as i need the renderSurface
to work correct to use pbuffers (right?).
Should i try a complete re-installation of windows (would rather not)?
On 5/8/06, Roger James <[EMAIL PROTECTED]> wrote:
David
> Producer::WGLExtentions: Could not create and initialize the temporary
> window
A failure at this point is "Goodnight Vienna". It looks like OpenGL is
broken in your environment.
I suggest that you hack up a little console app in VC and stick the
following in main() and step through it with the debugger to see what is
going on. If you can get this going consistently take a look at the
corresponding in code in WGLExtensions.cpp TemporaryWindow::create() and see
what is different. I think this must be specific to your setup as far as I
know even the ATI drivers are not this broken!
Roger
BOOL bRet;
// Windows system specific code
// Create a private window class
WNDCLASSEX MyWndClassEx =
{
sizeof(WNDCLASSEX),
CS_OWNDC,
MyWindowProc,
0,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
"EnvironRenderer",
NULL
};
ATOM MyClass = RegisterClassEx(&MyWndClassEx);
DWORD dwError = GetLastError();
HWND MyWindow = CreateWindow("EnvironRenderer", "MyWindow",
WS_POPUP, 0, 0, 800, 600, NULL, NULL, NULL, NULL);
dwError = GetLastError();
// Retrieve the private window DC
m_MyDC = GetDC(MyWindow);
PIXELFORMATDESCRIPTOR Pfd =
{
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
24, // 24-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
int iPixelFormat;
// get the best available match of pixel format for the device
context
iPixelFormat = ChoosePixelFormat(m_MyDC, &Pfd);
dwError = GetLastError();
// make that the pixel format of the device context
bRet = SetPixelFormat(m_MyDC, iPixelFormat, &Pfd);
dwError = GetLastError();
// Create a OpenGL rendering context
m_MyContext = wglCreateContext(m_MyDC);
dwError = GetLastError();
bRet = wglMakeCurrent(m_MyDC, m_MyContext);
dwError = GetLastError();
and the window proc
LRESULT CALLBACK MyWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
{
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/