mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
c00795416a
commit
bcc2ead670
15
blend.go
15
blend.go
@ -59,7 +59,22 @@ type Blend struct {
|
|||||||
BlendOperationAlpha BlendOperation
|
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 {
|
func (b Blend) internalBlend() graphicsdriver.Blend {
|
||||||
|
// A shortcut for the most common blend.
|
||||||
|
if b == (Blend{}) {
|
||||||
|
return defaultBlendInternalBlend
|
||||||
|
}
|
||||||
return graphicsdriver.Blend{
|
return graphicsdriver.Blend{
|
||||||
BlendFactorSourceRGB: b.BlendFactorSourceRGB.internalBlendFactor(true),
|
BlendFactorSourceRGB: b.BlendFactorSourceRGB.internalBlendFactor(true),
|
||||||
BlendFactorSourceAlpha: b.BlendFactorSourceAlpha.internalBlendFactor(true),
|
BlendFactorSourceAlpha: b.BlendFactorSourceAlpha.internalBlendFactor(true),
|
||||||
|
Loading…
Reference in New Issue
Block a user