mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
8ff6546285
NewDevice creates a Device given an API, which is the necessary GPU resources for a backend. Convert gpu.New to take an API instead of a backend.Device directly. In turn, this frees us to later unexport the backend package along with the backend implementations (for now just gioui.org/gpu/gl for OpenGL). It also allows programs that embed Gio (such as gioui.org/example/glfw) to freely choose a backend, not just OpenGL. Signed-off-by: Elias Naur <mail@eliasnaur.com>
16 lines
428 B
Go
16 lines
428 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
package gpu
|
|
|
|
import "gioui.org/gpu/backend"
|
|
|
|
// 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 API = backend.API
|
|
|
|
// OpenGL denotes the OpenGL or OpenGL ES API.
|
|
type OpenGL = backend.OpenGL
|
|
|
|
// Direct3D11 denotes the Direct3D API.
|
|
type Direct3D11 = backend.Direct3D11
|