mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
gpu,gpu/headless,app/internal/wm: add explicit RenderTarget API
Both the OpenGL and the Direct3D API are stateful and gpu.GPU renders to the render target current when Frame is called. Modern GPU API such as Metal don't have a concept of a current render target, and the target even changes each frame. Add RenderTarget and add an explicit target argument to GPU.Frame as well as the underlying driver.Device.BeginFrame. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
// APIs such as OpenGL, Direct3D useful for rendering Gio
|
||||
// operations.
|
||||
type Device interface {
|
||||
BeginFrame(clear bool, viewport image.Point) Framebuffer
|
||||
BeginFrame(target RenderTarget, clear bool, viewport image.Point) Framebuffer
|
||||
EndFrame()
|
||||
Caps() Caps
|
||||
NewTimer() Timer
|
||||
@@ -155,6 +155,7 @@ type Buffer interface {
|
||||
}
|
||||
|
||||
type Framebuffer interface {
|
||||
RenderTarget
|
||||
Invalidate()
|
||||
Release()
|
||||
ReadPixels(src image.Rectangle, pixels []byte) error
|
||||
|
||||
Reference in New Issue
Block a user