[osg-users] Problems with loading model in OSG 2.2
Ricky
Tuanros at gmail.com
Wed Jul 2 05:29:31 PDT 2008
I still can't solve this problem:
Error: [screen #0] ChooseMatchingPixelFormat() - Unable to choose the
requested pixel format
I just loaded a simple model but the program run really slowly (in
debug mode), it's better in release mode.
I used osg1.2 and it run so fast, even in debug mode.
Please support me with this problem, is it because of that error?
My code is simply like this:
#include <osg/PositionAttitudeTransform>
#include <osg/Group>
#include <osg/Node>
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>
int main()
{
osg::ref_ptr<osg::Node> m_node = new osg::Node();
osg::ref_ptr<osg::Group> root = new osg::Group();
osgViewer::Viewer viewer;
osg::Vec3 m_nodePosit;
osg::ref_ptr<osg::PositionAttitudeTransform> nodeXform = new
osg::PositionAttitudeTransform();
m_node = osgDB::readNodeFile("baitap.flt");
root->addChild(nodeXform.get());
m_nodePosit.set(5,0,0);
nodeXform->setPosition( m_nodePosit );
nodeXform->addChild(m_node.get());
viewer.setSceneData( root.get() );
viewer.setUpViewInWindow(32,32,512,512);
return viewer.run();
}
More information about the osg-users
mailing list