mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
@@ -10,6 +10,7 @@ import (
|
||||
"unsafe"
|
||||
|
||||
"gioui.org/gpu/backend"
|
||||
"gioui.org/internal/f32color"
|
||||
gunsafe "gioui.org/internal/unsafe"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
@@ -26,7 +27,7 @@ type Device struct {
|
||||
}
|
||||
|
||||
type Backend struct {
|
||||
clearColor [4]float32
|
||||
clearColor f32color.RGBA
|
||||
clearDepth float32
|
||||
viewport _D3D11_VIEWPORT
|
||||
depthState depthState
|
||||
@@ -539,7 +540,7 @@ func (b *Backend) NewProgram(vertexShader, fragmentShader backend.ShaderSources)
|
||||
}
|
||||
|
||||
func (b *Backend) ClearColor(colr, colg, colb, cola float32) {
|
||||
b.clearColor = [...]float32{colr, colg, colb, cola}
|
||||
b.clearColor = f32color.RGBA{R: colr, G: colg, B: colb, A: cola}
|
||||
}
|
||||
|
||||
func (b *Backend) Clear(buffers backend.BufferAttachments) {
|
||||
|
||||
@@ -5,9 +5,10 @@ package d3d11
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"syscall"
|
||||
"gioui.org/internal/f32color"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
@@ -1033,7 +1034,7 @@ func (c *_ID3D11DeviceContext) ClearDepthStencilView(target *_ID3D11DepthStencil
|
||||
)
|
||||
}
|
||||
|
||||
func (c *_ID3D11DeviceContext) ClearRenderTargetView(target *_ID3D11RenderTargetView, color *[4]float32) {
|
||||
func (c *_ID3D11DeviceContext) ClearRenderTargetView(target *_ID3D11RenderTargetView, color *f32color.RGBA) {
|
||||
syscall.Syscall(
|
||||
c.vtbl.ClearRenderTargetView,
|
||||
3,
|
||||
@@ -1243,7 +1244,7 @@ func (c *_ID3D11DeviceContext) DrawIndexed(count, start uint32, base int32) {
|
||||
)
|
||||
}
|
||||
|
||||
func (c *_ID3D11DeviceContext) OMSetBlendState(state *_ID3D11BlendState, factor *[4]float32, sampleMask uint32) {
|
||||
func (c *_ID3D11DeviceContext) OMSetBlendState(state *_ID3D11BlendState, factor *f32color.RGBA, sampleMask uint32) {
|
||||
syscall.Syscall6(
|
||||
c.vtbl.OMSetBlendState,
|
||||
4,
|
||||
|
||||
Reference in New Issue
Block a user