Improved spacing and indentaton
To keep things consistent with the rest of the OSG
This commit is contained in:
committed by
GitHub
parent
2f8a262a0e
commit
9d4ee0d766
@@ -2,7 +2,8 @@
|
||||
|
||||
using namespace osg;
|
||||
|
||||
int ImageTextureBinding::compare(const osg::StateAttribute &sa)const{
|
||||
int ImageTextureBinding::compare(const osg::StateAttribute &sa) const
|
||||
{
|
||||
COMPARE_StateAttribute_Types(ImageTextureBinding,sa)
|
||||
// Compare each parameter in turn against the rhs.
|
||||
COMPARE_StateAttribute_Parameter(_target)
|
||||
@@ -14,15 +15,18 @@ int ImageTextureBinding::compare(const osg::StateAttribute &sa)const{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ImageTextureBinding::apply(osg::State&state)const{
|
||||
if(_target.valid()){
|
||||
osg::Texture::TextureObject *to = _target->getTextureObject( state.getContextID() );
|
||||
if( !to ){
|
||||
// _target never been applied yet
|
||||
_target->apply(state);
|
||||
to = _target->getTextureObject( state.getContextID() );
|
||||
}
|
||||
state.get<osg::GLExtensions>()->glBindImageTexture(_imageunit, to->id(), _level, _layered, _layer, _access, _format);
|
||||
void ImageTextureBinding::apply(osg::State&state) const
|
||||
{
|
||||
if(_target.valid())
|
||||
{
|
||||
osg::Texture::TextureObject *to = _target->getTextureObject( state.getContextID() );
|
||||
if( !to )
|
||||
{
|
||||
// _target never been applied yet
|
||||
_target->apply(state);
|
||||
to = _target->getTextureObject( state.getContextID() );
|
||||
}
|
||||
state.get<osg::GLExtensions>()->glBindImageTexture(_imageunit, to->id(), _level, _layered, _layer, _access, _format);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user