diff --git a/internal/opengl/context_desktop.go b/internal/opengl/context_desktop.go index b264b0ef4..e3138c630 100644 --- a/internal/opengl/context_desktop.go +++ b/internal/opengl/context_desktop.go @@ -169,7 +169,7 @@ func (c *Context) bindFramebufferImpl(f framebufferNative) { }) } -func (c *Context) FramebufferPixels(f *Framebuffer, width, height int) ([]byte, error) { +func (c *Context) framebufferPixels(f *Framebuffer, width, height int) ([]byte, error) { var pixels []byte _ = c.runOnContextThread(func() error { gl.Flush() diff --git a/internal/opengl/context_js.go b/internal/opengl/context_js.go index 9b98d77fb..d2e813278 100644 --- a/internal/opengl/context_js.go +++ b/internal/opengl/context_js.go @@ -204,7 +204,7 @@ func (c *Context) bindFramebufferImpl(f framebufferNative) { gl.Call("bindFramebuffer", framebuffer, js.Value(f)) } -func (c *Context) FramebufferPixels(f *Framebuffer, width, height int) ([]byte, error) { +func (c *Context) framebufferPixels(f *Framebuffer, width, height int) ([]byte, error) { gl := c.gl c.bindFramebuffer(f.native) diff --git a/internal/opengl/context_mobile.go b/internal/opengl/context_mobile.go index 52cdaffcb..2141ebfc3 100644 --- a/internal/opengl/context_mobile.go +++ b/internal/opengl/context_mobile.go @@ -156,7 +156,7 @@ func (c *Context) bindFramebufferImpl(f framebufferNative) { gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(f)) } -func (c *Context) FramebufferPixels(f *Framebuffer, width, height int) ([]byte, error) { +func (c *Context) framebufferPixels(f *Framebuffer, width, height int) ([]byte, error) { gl := c.gl gl.Flush() diff --git a/internal/opengl/framebuffer.go b/internal/opengl/framebuffer.go index 66abf2996..26d1ba72d 100644 --- a/internal/opengl/framebuffer.go +++ b/internal/opengl/framebuffer.go @@ -24,8 +24,8 @@ type Framebuffer struct { height int } -// NewFramebufferFromTexture creates a framebuffer from the given texture. -func NewFramebufferFromTexture(texture Texture, width, height int) (*Framebuffer, error) { +// newFramebufferFromTexture creates a framebuffer from the given texture. +func newFramebufferFromTexture(texture Texture, width, height int) (*Framebuffer, error) { native, err := theContext.newFramebuffer(texture) if err != nil { return nil, err diff --git a/internal/opengl/image.go b/internal/opengl/image.go index a68b0fc99..e86c3b9d3 100644 --- a/internal/opengl/image.go +++ b/internal/opengl/image.go @@ -62,7 +62,7 @@ func (i *Image) Pixels() ([]byte, error) { return nil, err } w, h := i.Size() - p, err := theContext.FramebufferPixels(i.Framebuffer, w, h) + p, err := theContext.framebufferPixels(i.Framebuffer, w, h) if err != nil { return nil, err } @@ -81,7 +81,7 @@ func (i *Image) ensureFramebuffer() error { return nil } w, h := i.Size() - f, err := NewFramebufferFromTexture(i.Texture, math.NextPowerOf2Int(w), math.NextPowerOf2Int(h)) + f, err := newFramebufferFromTexture(i.Texture, math.NextPowerOf2Int(w), math.NextPowerOf2Int(h)) if err != nil { return err }