Hello Robert,

I tested your example and adapted it a little to add command line
options, and a CMakeLists.txt file to compile it.  Zip file attached
so that others can test it out easily.

You need to add ${OSGGA_LIBRARY} to the TARGET_LINK_LIBRARIES line. Also it was missing some things to make it link to the debug libraries when compiling in debug, which is required on Windows. Here is the changed file if anyone else wants to test on Windows.

To test run with a pbuffer if supported, with the app running for 100 frames:

   pbuffertest

If pbuffer isn't supported by your driver/hardware the OSG will
fallback to using a normal graphics window in the Viewer::realize()
method.

On my system it gives the following output:

Frame : 0
PixelBufferWin32::makeCurrentImplementation, wglMakeCurrent error: The requested resource is in use.

Warning: detected OpenGL error 'invalid operation' at Before Renderer::compile Warning: detected OpenGL error 'invalid operation' at After Renderer::compile
Frame : 1
Frame : 1

and then it crashes.

I also tried to compile against OSG 2.8.3 (replacing OSG_NOTICE with osg::notify(osg::NOTICE) ), there I get:

Frame : 0
PixelBufferWin32::makeCurrentImplementation, wglMakeCurrent error: The requested
 resource is in use.

Frame : E1r
ror: OpenGL version test failed, requires valid graphics context.

This sounds very similar to what Olivier is getting.

I have just tested the osgscreencapture example on svn trunk, with the command:

osgscreencapture.exe axes.osg --pbuffer-only 640 480

as given in another thread, and it gives the same result. I remember this example working in the not too distant past, so it may be that something has been broken in nVidia's Windows drivers. I am using the most recent version (260.99), what version are you using Olivier?

With the -w argument it works fine (with a window coming up on the screen of course).

So I'll investigate a bit more as to why pbuffer is failing. We've not ruled out a driver bug or an OSG bug here as far as I can see, it could still be both, since all the OSG pbuffer examples I've tried have failed in the same way.

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
cmake_minimum_required(VERSION 2.6)

PROJECT(pbuffertest)

SET(CMAKE_MODULE_PATH 
"${osggroudsim_SOURCE_DIR}/../CMakeModules;${CMAKE_MODULE_PATH}")

FIND_PACKAGE(OpenThreads)
FIND_PACKAGE(osg)
FIND_PACKAGE(osgUtil)
FIND_PACKAGE(osgGA)
FIND_PACKAGE(osgDB)
FIND_PACKAGE(osgViewer)

SET(SOURCES
    pbuffertest.cpp
)

INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR} ${OSG_INCLUDE_DIR})
LINK_DIRECTORIES(${OSG_LIB_DIR})
ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${SOURCES})
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} 
    optimized ${OSG_LIBRARY} 
    debug ${OSG_LIBRARY_DEBUG} 
    optimized ${OSGVIEWER_LIBRARY} 
    debug ${OSGVIEWER_LIBRARY_DEBUG}
    optimized ${OSGGA_LIBRARY}
    debug ${OSGGA_LIBRARY_DEBUG}
    optimized ${OPENTHREADS_LIBRARY} 
    debug ${OPENTHREADS_LIBRARY_DEBUG} 
)
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to