mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app/internal/gl/impl: extract platform dependent opengl bindings
We'd like to support Gio using a different renderer binding than the builtin. A first step is to define the Functions interface in package gl, and extract the concrete implementations to a separate package. Updates #26 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
type context struct {
|
||||
caps caps
|
||||
*gl.Functions
|
||||
gl.Functions
|
||||
}
|
||||
|
||||
type caps struct {
|
||||
@@ -32,7 +32,7 @@ type textureTriple struct {
|
||||
typ gl.Enum
|
||||
}
|
||||
|
||||
func newContext(glctx *gl.Functions) (*context, error) {
|
||||
func newContext(glctx gl.Functions) (*context, error) {
|
||||
ctx := &context{
|
||||
Functions: glctx,
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ var (
|
||||
attribUV gl.Attrib = 1
|
||||
)
|
||||
|
||||
func New(ctx *gl.Functions) (*GPU, error) {
|
||||
func New(ctx gl.Functions) (*GPU, error) {
|
||||
g := &GPU{
|
||||
pathCache: newOpCache(),
|
||||
cache: newResourceCache(),
|
||||
@@ -233,7 +233,7 @@ func New(ctx *gl.Functions) (*GPU, error) {
|
||||
return g, nil
|
||||
}
|
||||
|
||||
func (g *GPU) init(glctx *gl.Functions) error {
|
||||
func (g *GPU) init(glctx gl.Functions) error {
|
||||
ctx, err := newContext(glctx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user