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