gpu

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: MIT, Unlicense Imports: 34 Imported by: 4

Documentation

Overview

Package gpu implements the rendering of Gio drawing operations. It is used by package app and package app/headless and is otherwise not useful except for integrating with external window implementations.

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceLost = driver.ErrDeviceLost

ErrDeviceLost is returned from GPU operations when the underlying GPU device is lost and should be recreated.

Functions

This section is empty.

Types

type API

type API = driver.API

An API carries the necessary GPU API specific resources to create a Device. There is an API type for each supported GPU API such as OpenGL and Direct3D.

type Direct3D11

type Direct3D11 = driver.Direct3D11

Direct3D11 denotes the Direct3D API.

type Direct3D11RenderTarget

type Direct3D11RenderTarget = driver.Direct3D11RenderTarget

Direct3D11RenderTarget is a render target suitable for the Direct3D 11 backend.

type FBO added in v0.3.1

type FBO struct {
	// contains filtered or unexported fields
}

type GPU

type GPU interface {
	// Release non-Go resources. The GPU is no longer valid after Release.
	Release()
	// Clear sets the clear color for the next Frame.
	Clear(color color.NRGBA)
	// Frame draws the graphics operations from op into a viewport of target.
	Frame(frame *op.Ops, target RenderTarget, viewport image.Point) error
}

func New

func New(api API) (GPU, error)

New creates a GPU for the given API.

func NewWithDevice

func NewWithDevice(d driver.Device) (GPU, error)

NewWithDevice creates a GPU with a pre-existing device.

Note: for internal use only.

type Metal

type Metal = driver.Metal

Metal denotes the Apple Metal API.

type MetalRenderTarget

type MetalRenderTarget = driver.MetalRenderTarget

MetalRenderTarget is a render target suitable for the Metal backend.

type OpenGL

type OpenGL = driver.OpenGL

OpenGL denotes the OpenGL or OpenGL ES API.

type OpenGLRenderTarget

type OpenGLRenderTarget = driver.OpenGLRenderTarget

OpenGLRenderTarget is a render target suitable for the OpenGL backend.

type RenderTarget

type RenderTarget = driver.RenderTarget

A RenderTarget denotes the destination framebuffer for a frame.

type Vulkan

type Vulkan = driver.Vulkan

Vulkan denotes the Vulkan API.

type VulkanRenderTarget

type VulkanRenderTarget = driver.VulkanRenderTarget

VulkanRenderTarget is a render target suitable for the Vulkan backend.

Directories

Path Synopsis
Package headless implements headless windows for rendering an operation list to an image.
Package headless implements headless windows for rendering an operation list to an image.
internal
rendertest
Package rendertest is intended for testing of drawing ops only.
Package rendertest is intended for testing of drawing ops only.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL