-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurface.go
More file actions
36 lines (29 loc) · 874 Bytes
/
Copy pathsurface.go
File metadata and controls
36 lines (29 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package webgpu
import "github.com/bluescreen10/webgpu-go/driver"
type SurfaceDescriptor = driver.SurfaceDescriptor
type SurfaceDescriptorFromMetalLayer = driver.SurfaceDescriptorFromMetalLayer
// A Surface represents a platform-specific
// surface (e.g. a window) onto which rendered
// images may be presented.
type Surface struct {
surface driver.Surface
}
type SurfaceConfiguration struct {
Usage TextureUsage
Format TextureFormat
Width uint32
Height uint32
PresentMode PresentMode
AlphaMode CompositeAlphaMode
ViewFormats []TextureFormat
}
func (s *Surface) GetCurrentTexture() (*Texture, error) {
tex, err := s.surface.GetCurrentTexture()
return &Texture{tex}, err
}
func (s *Surface) Configure(device *Device, config SurfaceConfiguration) {
s.surface.Configure(device.device, config)
}
func (s *Surface) Present() {
//TODO
}