mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
180e456a8e
commit
871a8869db
6
blend.go
6
blend.go
@ -67,7 +67,7 @@ const (
|
||||
BlendFactorDestinationAlpha
|
||||
BlendFactorOneMinusSourceAlpha
|
||||
BlendFactorOneMinusDestinationAlpha
|
||||
BlendFactorDestinationRGB
|
||||
BlendFactorDestinationColor
|
||||
)
|
||||
|
||||
func (b BlendFactor) internalBlendFactor(source bool) graphicsdriver.BlendFactor {
|
||||
@ -90,8 +90,8 @@ func (b BlendFactor) internalBlendFactor(source bool) graphicsdriver.BlendFactor
|
||||
return graphicsdriver.BlendFactorOneMinusSourceAlpha
|
||||
case BlendFactorOneMinusDestinationAlpha:
|
||||
return graphicsdriver.BlendFactorOneMinusDestinationAlpha
|
||||
case BlendFactorDestinationRGB:
|
||||
return graphicsdriver.BlendFactorDestinationRGB
|
||||
case BlendFactorDestinationColor:
|
||||
return graphicsdriver.BlendFactorDestinationColor
|
||||
default:
|
||||
panic(fmt.Sprintf("ebiten: invalid blend factor: %d", b))
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ const (
|
||||
// Deprecated: as of v2.5. Use BlendLighter instead.
|
||||
CompositeModeLighter
|
||||
|
||||
// Deprecated: as of v2.5. Use Blend with BlendFactorDestinationRGB and BlendFactorZero instead.
|
||||
// Deprecated: as of v2.5. Use Blend with BlendFactorDestinationColor and BlendFactorZero instead.
|
||||
CompositeModeMultiply
|
||||
)
|
||||
|
||||
@ -114,8 +114,8 @@ func (c CompositeMode) blend() Blend {
|
||||
return BlendLighter
|
||||
case CompositeModeMultiply:
|
||||
return Blend{
|
||||
BlendFactorSourceRGB: BlendFactorDestinationRGB,
|
||||
BlendFactorSourceAlpha: BlendFactorDestinationRGB,
|
||||
BlendFactorSourceRGB: BlendFactorDestinationColor,
|
||||
BlendFactorSourceAlpha: BlendFactorDestinationColor,
|
||||
BlendFactorDestinationRGB: BlendFactorZero,
|
||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
||||
BlendOperationRGB: BlendOperationAdd,
|
||||
|
@ -32,7 +32,7 @@ const (
|
||||
BlendFactorDestinationAlpha
|
||||
BlendFactorOneMinusSourceAlpha
|
||||
BlendFactorOneMinusDestinationAlpha
|
||||
BlendFactorDestinationRGB
|
||||
BlendFactorDestinationColor
|
||||
)
|
||||
|
||||
type BlendOperation byte
|
||||
|
@ -39,7 +39,7 @@ func blendFactorToBlend(f graphicsdriver.BlendFactor, alpha bool) _D3D12_BLEND {
|
||||
return _D3D12_BLEND_INV_SRC_ALPHA
|
||||
case graphicsdriver.BlendFactorOneMinusDestinationAlpha:
|
||||
return _D3D12_BLEND_INV_DEST_ALPHA
|
||||
case graphicsdriver.BlendFactorDestinationRGB:
|
||||
case graphicsdriver.BlendFactorDestinationColor:
|
||||
// D3D12_RENDER_TARGET_BLEND_DESC's *BlendAlpha members don't allow *_COLOR values.
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_render_target_blend_desc.
|
||||
if alpha {
|
||||
|
@ -314,8 +314,8 @@ func blendFactorToMetalBlendFactor(c graphicsdriver.BlendFactor) mtl.BlendFactor
|
||||
return mtl.BlendFactorOneMinusSourceAlpha
|
||||
case graphicsdriver.BlendFactorOneMinusDestinationAlpha:
|
||||
return mtl.BlendFactorOneMinusDestinationAlpha
|
||||
case graphicsdriver.BlendFactorDestinationRGB:
|
||||
return mtl.BlendFactorDestinationRGB
|
||||
case graphicsdriver.BlendFactorDestinationColor:
|
||||
return mtl.BlendFactorDestinationColor
|
||||
default:
|
||||
panic(fmt.Sprintf("metal: invalid blend factor: %d", c))
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ const (
|
||||
BlendFactorOneMinusSourceColor BlendFactor = 3
|
||||
BlendFactorSourceAlpha BlendFactor = 4
|
||||
BlendFactorOneMinusSourceAlpha BlendFactor = 5
|
||||
BlendFactorDestinationRGB BlendFactor = 6
|
||||
BlendFactorDestinationColor BlendFactor = 6
|
||||
BlendFactorOneMinusDestinationColor BlendFactor = 7
|
||||
BlendFactorDestinationAlpha BlendFactor = 8
|
||||
BlendFactorOneMinusDestinationAlpha BlendFactor = 9
|
||||
|
@ -55,7 +55,7 @@ func convertBlendFactor(f graphicsdriver.BlendFactor) blendFactor {
|
||||
return glOneMinusSrcAlpha
|
||||
case graphicsdriver.BlendFactorOneMinusDestinationAlpha:
|
||||
return glOneMinusDstAlpha
|
||||
case graphicsdriver.BlendFactorDestinationRGB:
|
||||
case graphicsdriver.BlendFactorDestinationColor:
|
||||
return glDstColor
|
||||
default:
|
||||
panic(fmt.Sprintf("opengl: invalid blend factor %d", f))
|
||||
|
Loading…
Reference in New Issue
Block a user