mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
parent
48e3c766f7
commit
5a36b4bb48
@ -275,9 +275,6 @@ func (c *context) framebufferPixelsToBuffer(f *framebuffer, buffer buffer, width
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) deleteTexture(t textureNative) {
|
func (c *context) deleteTexture(t textureNative) {
|
||||||
if !c.ctx.IsTexture(uint32(t)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if c.lastTexture == t {
|
if c.lastTexture == t {
|
||||||
c.lastTexture = 0
|
c.lastTexture = 0
|
||||||
}
|
}
|
||||||
|
@ -433,15 +433,6 @@ func (d *DebugContext) IsRenderbuffer(arg0 uint32) bool {
|
|||||||
return out0
|
return out0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DebugContext) IsTexture(arg0 uint32) bool {
|
|
||||||
out0 := d.Context.IsTexture(arg0)
|
|
||||||
fmt.Fprintln(os.Stderr, "IsTexture")
|
|
||||||
if e := d.Context.GetError(); e != NO_ERROR {
|
|
||||||
panic(fmt.Sprintf("gl: GetError() returned %d at IsTexture", e))
|
|
||||||
}
|
|
||||||
return out0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *DebugContext) LinkProgram(arg0 uint32) {
|
func (d *DebugContext) LinkProgram(arg0 uint32) {
|
||||||
d.Context.LinkProgram(arg0)
|
d.Context.LinkProgram(arg0)
|
||||||
fmt.Fprintln(os.Stderr, "LinkProgram")
|
fmt.Fprintln(os.Stderr, "LinkProgram")
|
||||||
|
@ -212,10 +212,6 @@ package gl
|
|||||||
// typedef GLboolean (*fn)(GLuint renderbuffer);
|
// typedef GLboolean (*fn)(GLuint renderbuffer);
|
||||||
// return ((fn)(fnptr))(renderbuffer);
|
// return ((fn)(fnptr))(renderbuffer);
|
||||||
// }
|
// }
|
||||||
// static GLboolean glowIsTexture(uintptr_t fnptr, GLuint texture) {
|
|
||||||
// typedef GLboolean (*fn)(GLuint texture);
|
|
||||||
// return ((fn)(fnptr))(texture);
|
|
||||||
// }
|
|
||||||
// static void glowLinkProgram(uintptr_t fnptr, GLuint program) {
|
// static void glowLinkProgram(uintptr_t fnptr, GLuint program) {
|
||||||
// typedef void (*fn)(GLuint program);
|
// typedef void (*fn)(GLuint program);
|
||||||
// ((fn)(fnptr))(program);
|
// ((fn)(fnptr))(program);
|
||||||
@ -376,7 +372,6 @@ type defaultContext struct {
|
|||||||
gpIsFramebuffer C.uintptr_t
|
gpIsFramebuffer C.uintptr_t
|
||||||
gpIsProgram C.uintptr_t
|
gpIsProgram C.uintptr_t
|
||||||
gpIsRenderbuffer C.uintptr_t
|
gpIsRenderbuffer C.uintptr_t
|
||||||
gpIsTexture C.uintptr_t
|
|
||||||
gpLinkProgram C.uintptr_t
|
gpLinkProgram C.uintptr_t
|
||||||
gpPixelStorei C.uintptr_t
|
gpPixelStorei C.uintptr_t
|
||||||
gpReadPixels C.uintptr_t
|
gpReadPixels C.uintptr_t
|
||||||
@ -653,11 +648,6 @@ func (c *defaultContext) IsRenderbuffer(renderbuffer uint32) bool {
|
|||||||
return ret == TRUE
|
return ret == TRUE
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *defaultContext) IsTexture(texture uint32) bool {
|
|
||||||
ret := C.glowIsTexture(c.gpIsTexture, C.GLuint(texture))
|
|
||||||
return ret == TRUE
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *defaultContext) LinkProgram(program uint32) {
|
func (c *defaultContext) LinkProgram(program uint32) {
|
||||||
C.glowLinkProgram(c.gpLinkProgram, C.GLuint(program))
|
C.glowLinkProgram(c.gpLinkProgram, C.GLuint(program))
|
||||||
}
|
}
|
||||||
@ -832,7 +822,6 @@ func (c *defaultContext) LoadFunctions() error {
|
|||||||
c.gpIsFramebuffer = C.uintptr_t(g.get("glIsFramebuffer"))
|
c.gpIsFramebuffer = C.uintptr_t(g.get("glIsFramebuffer"))
|
||||||
c.gpIsProgram = C.uintptr_t(g.get("glIsProgram"))
|
c.gpIsProgram = C.uintptr_t(g.get("glIsProgram"))
|
||||||
c.gpIsRenderbuffer = C.uintptr_t(g.get("glIsRenderbuffer"))
|
c.gpIsRenderbuffer = C.uintptr_t(g.get("glIsRenderbuffer"))
|
||||||
c.gpIsTexture = C.uintptr_t(g.get("glIsTexture"))
|
|
||||||
c.gpLinkProgram = C.uintptr_t(g.get("glLinkProgram"))
|
c.gpLinkProgram = C.uintptr_t(g.get("glLinkProgram"))
|
||||||
c.gpPixelStorei = C.uintptr_t(g.get("glPixelStorei"))
|
c.gpPixelStorei = C.uintptr_t(g.get("glPixelStorei"))
|
||||||
c.gpReadPixels = C.uintptr_t(g.get("glReadPixels"))
|
c.gpReadPixels = C.uintptr_t(g.get("glReadPixels"))
|
||||||
|
@ -70,7 +70,6 @@ type defaultContext struct {
|
|||||||
fnIsFramebuffer js.Value
|
fnIsFramebuffer js.Value
|
||||||
fnIsProgram js.Value
|
fnIsProgram js.Value
|
||||||
fnIsRenderbuffer js.Value
|
fnIsRenderbuffer js.Value
|
||||||
fnIsTexture js.Value
|
|
||||||
fnLinkProgram js.Value
|
fnLinkProgram js.Value
|
||||||
fnPixelStorei js.Value
|
fnPixelStorei js.Value
|
||||||
fnReadPixels js.Value
|
fnReadPixels js.Value
|
||||||
@ -201,7 +200,6 @@ func NewDefaultContext(v js.Value) (Context, error) {
|
|||||||
fnIsFramebuffer: v.Get("isFramebuffer").Call("bind", v),
|
fnIsFramebuffer: v.Get("isFramebuffer").Call("bind", v),
|
||||||
fnIsProgram: v.Get("isProgram").Call("bind", v),
|
fnIsProgram: v.Get("isProgram").Call("bind", v),
|
||||||
fnIsRenderbuffer: v.Get("isRenderbuffer").Call("bind", v),
|
fnIsRenderbuffer: v.Get("isRenderbuffer").Call("bind", v),
|
||||||
fnIsTexture: v.Get("isTexture").Call("bind", v),
|
|
||||||
fnLinkProgram: v.Get("linkProgram").Call("bind", v),
|
fnLinkProgram: v.Get("linkProgram").Call("bind", v),
|
||||||
fnPixelStorei: v.Get("pixelStorei").Call("bind", v),
|
fnPixelStorei: v.Get("pixelStorei").Call("bind", v),
|
||||||
fnReadPixels: v.Get("readPixels").Call("bind", v),
|
fnReadPixels: v.Get("readPixels").Call("bind", v),
|
||||||
@ -495,10 +493,6 @@ func (c *defaultContext) IsRenderbuffer(renderbuffer uint32) bool {
|
|||||||
return c.fnIsRenderbuffer.Invoke(c.renderbuffers.get(renderbuffer)).Bool()
|
return c.fnIsRenderbuffer.Invoke(c.renderbuffers.get(renderbuffer)).Bool()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *defaultContext) IsTexture(texture uint32) bool {
|
|
||||||
return c.fnIsTexture.Invoke(c.textures.get(texture)).Bool()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *defaultContext) LinkProgram(program uint32) {
|
func (c *defaultContext) LinkProgram(program uint32) {
|
||||||
c.fnLinkProgram.Invoke(c.programs.get(program))
|
c.fnLinkProgram.Invoke(c.programs.get(program))
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,6 @@ type defaultContext struct {
|
|||||||
gpIsFramebuffer uintptr
|
gpIsFramebuffer uintptr
|
||||||
gpIsProgram uintptr
|
gpIsProgram uintptr
|
||||||
gpIsRenderbuffer uintptr
|
gpIsRenderbuffer uintptr
|
||||||
gpIsTexture uintptr
|
|
||||||
gpLinkProgram uintptr
|
gpLinkProgram uintptr
|
||||||
gpPixelStorei uintptr
|
gpPixelStorei uintptr
|
||||||
gpReadPixels uintptr
|
gpReadPixels uintptr
|
||||||
@ -349,11 +348,6 @@ func (c *defaultContext) IsRenderbuffer(renderbuffer uint32) bool {
|
|||||||
return byte(ret) != 0
|
return byte(ret) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *defaultContext) IsTexture(texture uint32) bool {
|
|
||||||
ret, _, _ := purego.SyscallN(c.gpIsTexture, uintptr(texture))
|
|
||||||
return byte(ret) != 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *defaultContext) LinkProgram(program uint32) {
|
func (c *defaultContext) LinkProgram(program uint32) {
|
||||||
purego.SyscallN(c.gpLinkProgram, uintptr(program))
|
purego.SyscallN(c.gpLinkProgram, uintptr(program))
|
||||||
}
|
}
|
||||||
@ -528,7 +522,6 @@ func (c *defaultContext) LoadFunctions() error {
|
|||||||
c.gpIsFramebuffer = g.get("glIsFramebuffer")
|
c.gpIsFramebuffer = g.get("glIsFramebuffer")
|
||||||
c.gpIsProgram = g.get("glIsProgram")
|
c.gpIsProgram = g.get("glIsProgram")
|
||||||
c.gpIsRenderbuffer = g.get("glIsRenderbuffer")
|
c.gpIsRenderbuffer = g.get("glIsRenderbuffer")
|
||||||
c.gpIsTexture = g.get("glIsTexture")
|
|
||||||
c.gpLinkProgram = g.get("glLinkProgram")
|
c.gpLinkProgram = g.get("glLinkProgram")
|
||||||
c.gpPixelStorei = g.get("glPixelStorei")
|
c.gpPixelStorei = g.get("glPixelStorei")
|
||||||
c.gpReadPixels = g.get("glReadPixels")
|
c.gpReadPixels = g.get("glReadPixels")
|
||||||
|
@ -75,7 +75,6 @@ type Context interface {
|
|||||||
IsFramebuffer(framebuffer uint32) bool
|
IsFramebuffer(framebuffer uint32) bool
|
||||||
IsProgram(program uint32) bool
|
IsProgram(program uint32) bool
|
||||||
IsRenderbuffer(renderbuffer uint32) bool
|
IsRenderbuffer(renderbuffer uint32) bool
|
||||||
IsTexture(texture uint32) bool
|
|
||||||
LinkProgram(program uint32)
|
LinkProgram(program uint32)
|
||||||
PixelStorei(pname uint32, param int32)
|
PixelStorei(pname uint32, param int32)
|
||||||
ReadPixels(dst []byte, x int32, y int32, width int32, height int32, format uint32, xtype uint32)
|
ReadPixels(dst []byte, x int32, y int32, width int32, height int32, format uint32, xtype uint32)
|
||||||
|
Loading…
Reference in New Issue
Block a user