Пример #1
0
//----------------------------------------------------------------//
void MOAIGfxDeviceStateCache::SetBlendMode ( const MOAIBlendMode& blendMode ) {

	if ( !this->mBlendEnabled ) {
	
		this->OnGfxStateWillChange ();
		
		zglEnable ( ZGL_PIPELINE_BLEND );
		
		this->mBlendMode = blendMode;
		zglBlendMode ( this->mBlendMode.mEquation );
		zglBlendFunc ( this->mBlendMode.mSourceFactor, this->mBlendMode.mDestFactor );
		this->mBlendEnabled = true;
	}
	else if ( !this->mBlendMode.IsSame ( blendMode )) {
	
		this->OnGfxStateWillChange ();
		
		this->mBlendMode = blendMode;
		zglBlendMode ( this->mBlendMode.mEquation );
		zglBlendFunc ( this->mBlendMode.mSourceFactor, this->mBlendMode.mDestFactor );
	}
}
Пример #2
0
//----------------------------------------------------------------//
void MOAIBlendMode::Bind () {
	
	zglEnable ( ZGL_PIPELINE_BLEND );
	zglBlendMode ( this->mEquation );
	zglBlendFunc ( this->mSourceFactor, this->mDestFactor );
}