示例#1
0
ChunkLodDrawable::ChunkLodDrawable()
{
	setSupportsDisplayList(false);
	_tree = NULL;
	osg::Timer t;
	_last_tick = t.tick();
	_triangle_count = 0;
	_lastBoundIndex = -1;
	osg::StateSet *ss = getOrCreateStateSet();
	osg::CullFace *cull = new osg::CullFace();
	cull->setMode(osg::CullFace::BACK);
	ss->setAttributeAndModes(cull);
	osg::TexGen *texgen = new osg::TexGen();
	texgen->setMode(osg::TexGen::OBJECT_LINEAR);
	ss->setTextureAttributeAndModes(0, texgen);
//	ss->setMode(GL_LIGHTING,osg::StateAttribute::OFF);

	//_details = new RegisterCombinerDetails;
	_details = new MultiTextureARBDetails;
	
	_details->addDetail("detail_texture.png", 3125);
	_details->addDetail("detail5.png", 625);
	_details->addDetail("detail4.png", 125);
	
	_details->init(ss);

	// TODO delete _details in dtor
}
示例#2
0
osgParticle::ParticleSystem::ParticleSystem()
:    osg::Drawable(),
    _def_bbox(osg::Vec3(-10, -10, -10), osg::Vec3(10, 10, 10)),
    _alignment(BILLBOARD),
    _align_X_axis(1, 0, 0),
    _align_Y_axis(0, 1, 0),
    _particleScaleReferenceFrame(WORLD_COORDINATES),
    _useVertexArray(false),
    _useShaders(false),
    _dirty_uniforms(false),
    _doublepass(false),
    _frozen(false),
    _bmin(0, 0, 0),
    _bmax(0, 0, 0),
    _reset_bounds_flag(false),
    _bounds_computed(false),
    _def_ptemp(Particle()),
    _last_frame(0),
    _dirty_dt(true),
    _freeze_on_cull(false),
    _t0(0.0),
    _dt(0.0),
    _detail(1),
    _sortMode(NO_SORT),
    _visibilityDistance(-1.0),
    _estimatedMaxNumOfParticles(0)
{
    // we don't support display lists because particle systems
    // are dynamic, and they always changes between frames
    setSupportsDisplayList(false);
}
MYGUIManager::MYGUIManager()
:   _gui(0), _platform(0),
    _resourcePathFile("resources.xml"), _resourceCoreFile("MyGUI_Core.xml"),
	_activeContextID(0), _initialized(false), _gw(0), _uiScale(1.0f), _useHWCursor(true)
{
    setSupportsDisplayList( false );
    getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
    getOrCreateStateSet()->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
}
 NanoVGDrawable()
 :   _vg(NULL), _activeContextID(0), _width(800), _height(600), _initialized(false)
 {
     setSupportsDisplayList( false );
 }