mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
opengl: Unexport some functions
This commit is contained in:
parent
2a7caf7755
commit
bc7dd2f050
@ -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
|
var pixels []byte
|
||||||
_ = c.runOnContextThread(func() error {
|
_ = c.runOnContextThread(func() error {
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
|
@ -204,7 +204,7 @@ func (c *Context) bindFramebufferImpl(f framebufferNative) {
|
|||||||
gl.Call("bindFramebuffer", framebuffer, js.Value(f))
|
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
|
gl := c.gl
|
||||||
|
|
||||||
c.bindFramebuffer(f.native)
|
c.bindFramebuffer(f.native)
|
||||||
|
@ -156,7 +156,7 @@ func (c *Context) bindFramebufferImpl(f framebufferNative) {
|
|||||||
gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(f))
|
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 := c.gl
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ type Framebuffer struct {
|
|||||||
height int
|
height int
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFramebufferFromTexture creates a framebuffer from the given texture.
|
// newFramebufferFromTexture creates a framebuffer from the given texture.
|
||||||
func NewFramebufferFromTexture(texture Texture, width, height int) (*Framebuffer, error) {
|
func newFramebufferFromTexture(texture Texture, width, height int) (*Framebuffer, error) {
|
||||||
native, err := theContext.newFramebuffer(texture)
|
native, err := theContext.newFramebuffer(texture)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -62,7 +62,7 @@ func (i *Image) Pixels() ([]byte, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
w, h := i.Size()
|
w, h := i.Size()
|
||||||
p, err := theContext.FramebufferPixels(i.Framebuffer, w, h)
|
p, err := theContext.framebufferPixels(i.Framebuffer, w, h)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ func (i *Image) ensureFramebuffer() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
w, h := i.Size()
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user