internal/graphicsdriver/opengl/gl: remove IsTexture

Updates #805
This commit is contained in:
Hajime Hoshi 2024-01-09 02:33:47 +09:00
parent 48e3c766f7
commit 5a36b4bb48
6 changed files with 0 additions and 37 deletions

View File

@ -275,9 +275,6 @@ func (c *context) framebufferPixelsToBuffer(f *framebuffer, buffer buffer, width
}
func (c *context) deleteTexture(t textureNative) {
if !c.ctx.IsTexture(uint32(t)) {
return
}
if c.lastTexture == t {
c.lastTexture = 0
}

View File

@ -433,15 +433,6 @@ func (d *DebugContext) IsRenderbuffer(arg0 uint32) bool {
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) {
d.Context.LinkProgram(arg0)
fmt.Fprintln(os.Stderr, "LinkProgram")

View File

@ -212,10 +212,6 @@ package gl
// typedef GLboolean (*fn)(GLuint 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) {
// typedef void (*fn)(GLuint program);
// ((fn)(fnptr))(program);
@ -376,7 +372,6 @@ type defaultContext struct {
gpIsFramebuffer C.uintptr_t
gpIsProgram C.uintptr_t
gpIsRenderbuffer C.uintptr_t
gpIsTexture C.uintptr_t
gpLinkProgram C.uintptr_t
gpPixelStorei C.uintptr_t
gpReadPixels C.uintptr_t
@ -653,11 +648,6 @@ func (c *defaultContext) IsRenderbuffer(renderbuffer uint32) bool {
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) {
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.gpIsProgram = C.uintptr_t(g.get("glIsProgram"))
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.gpPixelStorei = C.uintptr_t(g.get("glPixelStorei"))
c.gpReadPixels = C.uintptr_t(g.get("glReadPixels"))

View File

@ -70,7 +70,6 @@ type defaultContext struct {
fnIsFramebuffer js.Value
fnIsProgram js.Value
fnIsRenderbuffer js.Value
fnIsTexture js.Value
fnLinkProgram js.Value
fnPixelStorei js.Value
fnReadPixels js.Value
@ -201,7 +200,6 @@ func NewDefaultContext(v js.Value) (Context, error) {
fnIsFramebuffer: v.Get("isFramebuffer").Call("bind", v),
fnIsProgram: v.Get("isProgram").Call("bind", v),
fnIsRenderbuffer: v.Get("isRenderbuffer").Call("bind", v),
fnIsTexture: v.Get("isTexture").Call("bind", v),
fnLinkProgram: v.Get("linkProgram").Call("bind", v),
fnPixelStorei: v.Get("pixelStorei").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()
}
func (c *defaultContext) IsTexture(texture uint32) bool {
return c.fnIsTexture.Invoke(c.textures.get(texture)).Bool()
}
func (c *defaultContext) LinkProgram(program uint32) {
c.fnLinkProgram.Invoke(c.programs.get(program))
}

View File

@ -72,7 +72,6 @@ type defaultContext struct {
gpIsFramebuffer uintptr
gpIsProgram uintptr
gpIsRenderbuffer uintptr
gpIsTexture uintptr
gpLinkProgram uintptr
gpPixelStorei uintptr
gpReadPixels uintptr
@ -349,11 +348,6 @@ func (c *defaultContext) IsRenderbuffer(renderbuffer uint32) bool {
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) {
purego.SyscallN(c.gpLinkProgram, uintptr(program))
}
@ -528,7 +522,6 @@ func (c *defaultContext) LoadFunctions() error {
c.gpIsFramebuffer = g.get("glIsFramebuffer")
c.gpIsProgram = g.get("glIsProgram")
c.gpIsRenderbuffer = g.get("glIsRenderbuffer")
c.gpIsTexture = g.get("glIsTexture")
c.gpLinkProgram = g.get("glLinkProgram")
c.gpPixelStorei = g.get("glPixelStorei")
c.gpReadPixels = g.get("glReadPixels")

View File

@ -75,7 +75,6 @@ type Context interface {
IsFramebuffer(framebuffer uint32) bool
IsProgram(program uint32) bool
IsRenderbuffer(renderbuffer uint32) bool
IsTexture(texture uint32) bool
LinkProgram(program uint32)
PixelStorei(pname uint32, param int32)
ReadPixels(dst []byte, x int32, y int32, width int32, height int32, format uint32, xtype uint32)