mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
parent
c00795416a
commit
bcc2ead670
15
blend.go
15
blend.go
@ -59,7 +59,22 @@ type Blend struct {
|
||||
BlendOperationAlpha BlendOperation
|
||||
}
|
||||
|
||||
var (
|
||||
defaultBlendInternalBlend = graphicsdriver.Blend{
|
||||
BlendFactorSourceRGB: BlendFactorDefault.internalBlendFactor(true),
|
||||
BlendFactorSourceAlpha: BlendFactorDefault.internalBlendFactor(true),
|
||||
BlendFactorDestinationRGB: BlendFactorDefault.internalBlendFactor(false),
|
||||
BlendFactorDestinationAlpha: BlendFactorDefault.internalBlendFactor(false),
|
||||
BlendOperationRGB: BlendOperationAdd.internalBlendOperation(),
|
||||
BlendOperationAlpha: BlendOperationAdd.internalBlendOperation(),
|
||||
}
|
||||
)
|
||||
|
||||
func (b Blend) internalBlend() graphicsdriver.Blend {
|
||||
// A shortcut for the most common blend.
|
||||
if b == (Blend{}) {
|
||||
return defaultBlendInternalBlend
|
||||
}
|
||||
return graphicsdriver.Blend{
|
||||
BlendFactorSourceRGB: b.BlendFactorSourceRGB.internalBlendFactor(true),
|
||||
BlendFactorSourceAlpha: b.BlendFactorSourceAlpha.internalBlendFactor(true),
|
||||
|
Loading…
Reference in New Issue
Block a user