mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/graphicsdriver/opengl: remove unused functions
This commit is contained in:
parent
4ae84c2232
commit
cee948048d
@ -375,15 +375,6 @@ func (c *context) uniformInt(p program, location string, v int) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) uniformFloat(p program, location string, v float32) bool {
|
|
||||||
l := int32(c.locationCache.GetUniformLocation(c, p, location))
|
|
||||||
if l == invalidUniform {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
gl.Uniform1f(l, v)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *context) uniformFloats(p program, location string, v []float32, typ shaderir.Type) bool {
|
func (c *context) uniformFloats(p program, location string, v []float32, typ shaderir.Type) bool {
|
||||||
l := int32(c.locationCache.GetUniformLocation(c, p, location))
|
l := int32(c.locationCache.GetUniformLocation(c, p, location))
|
||||||
if l == invalidUniform {
|
if l == invalidUniform {
|
||||||
|
@ -344,15 +344,6 @@ func (c *context) uniformInt(p program, location string, v int) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) uniformFloat(p program, location string, v float32) bool {
|
|
||||||
l := c.locationCache.GetUniformLocation(c, p, location)
|
|
||||||
if l == invalidUniform {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
c.ctx.Uniform1f(int32(l), v)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *context) uniformFloats(p program, location string, v []float32, typ shaderir.Type) bool {
|
func (c *context) uniformFloats(p program, location string, v []float32, typ shaderir.Type) bool {
|
||||||
l := c.locationCache.GetUniformLocation(c, p, location)
|
l := c.locationCache.GetUniformLocation(c, p, location)
|
||||||
if l == invalidUniform {
|
if l == invalidUniform {
|
||||||
|
@ -451,16 +451,6 @@ func (c *context) uniformInt(p program, location string, v int) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) uniformFloat(p program, location string, v float32) bool {
|
|
||||||
gl := c.gl
|
|
||||||
l := c.locationCache.GetUniformLocation(c, p, location)
|
|
||||||
if l.equal(invalidUniform) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
gl.uniform1f.Invoke(js.Value(l), v)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *context) uniformFloats(p program, location string, v []float32, typ shaderir.Type) bool {
|
func (c *context) uniformFloats(p program, location string, v []float32, typ shaderir.Type) bool {
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
l := c.locationCache.GetUniformLocation(c, p, location)
|
l := c.locationCache.GetUniformLocation(c, p, location)
|
||||||
|
@ -163,7 +163,6 @@ package gl
|
|||||||
// typedef void (APIENTRYP GPTEXIMAGE2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
|
// typedef void (APIENTRYP GPTEXIMAGE2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
|
||||||
// typedef void (APIENTRYP GPTEXPARAMETERI)(GLenum target, GLenum pname, GLint param);
|
// typedef void (APIENTRYP GPTEXPARAMETERI)(GLenum target, GLenum pname, GLint param);
|
||||||
// typedef void (APIENTRYP GPTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
|
// typedef void (APIENTRYP GPTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
|
||||||
// typedef void (APIENTRYP GPUNIFORM1F)(GLint location, GLfloat v0);
|
|
||||||
// typedef void (APIENTRYP GPUNIFORM1I)(GLint location, GLint v0);
|
// typedef void (APIENTRYP GPUNIFORM1I)(GLint location, GLint v0);
|
||||||
// typedef void (APIENTRYP GPUNIFORM1FV)(GLint location, GLsizei count, const GLfloat * value);
|
// typedef void (APIENTRYP GPUNIFORM1FV)(GLint location, GLsizei count, const GLfloat * value);
|
||||||
// typedef void (APIENTRYP GPUNIFORM2FV)(GLint location, GLsizei count, const GLfloat * value);
|
// typedef void (APIENTRYP GPUNIFORM2FV)(GLint location, GLsizei count, const GLfloat * value);
|
||||||
@ -383,9 +382,6 @@ package gl
|
|||||||
// static void glowTexSubImage2D(GPTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
|
// static void glowTexSubImage2D(GPTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
|
||||||
// (*fnptr)(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
// (*fnptr)(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
||||||
// }
|
// }
|
||||||
// static void glowUniform1f(GPUNIFORM1F fnptr, GLint location, GLfloat v0) {
|
|
||||||
// (*fnptr)(location, v0);
|
|
||||||
// }
|
|
||||||
// static void glowUniform1i(GPUNIFORM1I fnptr, GLint location, GLint v0) {
|
// static void glowUniform1i(GPUNIFORM1I fnptr, GLint location, GLint v0) {
|
||||||
// (*fnptr)(location, v0);
|
// (*fnptr)(location, v0);
|
||||||
// }
|
// }
|
||||||
@ -498,7 +494,6 @@ var (
|
|||||||
gpTexImage2D C.GPTEXIMAGE2D
|
gpTexImage2D C.GPTEXIMAGE2D
|
||||||
gpTexParameteri C.GPTEXPARAMETERI
|
gpTexParameteri C.GPTEXPARAMETERI
|
||||||
gpTexSubImage2D C.GPTEXSUBIMAGE2D
|
gpTexSubImage2D C.GPTEXSUBIMAGE2D
|
||||||
gpUniform1f C.GPUNIFORM1F
|
|
||||||
gpUniform1i C.GPUNIFORM1I
|
gpUniform1i C.GPUNIFORM1I
|
||||||
gpUniform1fv C.GPUNIFORM1FV
|
gpUniform1fv C.GPUNIFORM1FV
|
||||||
gpUniform2fv C.GPUNIFORM2FV
|
gpUniform2fv C.GPUNIFORM2FV
|
||||||
@ -796,10 +791,6 @@ func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, wid
|
|||||||
C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
|
C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Uniform1f(location int32, v0 float32) {
|
|
||||||
C.glowUniform1f(gpUniform1f, (C.GLint)(location), (C.GLfloat)(v0))
|
|
||||||
}
|
|
||||||
|
|
||||||
func Uniform1i(location int32, v0 int32) {
|
func Uniform1i(location int32, v0 int32) {
|
||||||
C.glowUniform1i(gpUniform1i, (C.GLint)(location), (C.GLint)(v0))
|
C.glowUniform1i(gpUniform1i, (C.GLint)(location), (C.GLint)(v0))
|
||||||
}
|
}
|
||||||
@ -1053,10 +1044,6 @@ func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {
|
|||||||
if gpTexSubImage2D == nil {
|
if gpTexSubImage2D == nil {
|
||||||
return errors.New("gl: glTexSubImage2D is missing")
|
return errors.New("gl: glTexSubImage2D is missing")
|
||||||
}
|
}
|
||||||
gpUniform1f = (C.GPUNIFORM1F)(getProcAddr("glUniform1f"))
|
|
||||||
if gpUniform1f == nil {
|
|
||||||
return errors.New("gl: glUniform1f is missing")
|
|
||||||
}
|
|
||||||
gpUniform1i = (C.GPUNIFORM1I)(getProcAddr("glUniform1i"))
|
gpUniform1i = (C.GPUNIFORM1I)(getProcAddr("glUniform1i"))
|
||||||
if gpUniform1i == nil {
|
if gpUniform1i == nil {
|
||||||
return errors.New("gl: glUniform1i is missing")
|
return errors.New("gl: glUniform1i is missing")
|
||||||
|
@ -81,7 +81,6 @@ var (
|
|||||||
gpTexImage2D uintptr
|
gpTexImage2D uintptr
|
||||||
gpTexParameteri uintptr
|
gpTexParameteri uintptr
|
||||||
gpTexSubImage2D uintptr
|
gpTexSubImage2D uintptr
|
||||||
gpUniform1f uintptr
|
|
||||||
gpUniform1i uintptr
|
gpUniform1i uintptr
|
||||||
gpUniform1fv uintptr
|
gpUniform1fv uintptr
|
||||||
gpUniform2fv uintptr
|
gpUniform2fv uintptr
|
||||||
@ -379,10 +378,6 @@ func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, wid
|
|||||||
purego.SyscallN(gpTexSubImage2D, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))
|
purego.SyscallN(gpTexSubImage2D, uintptr(target), uintptr(level), uintptr(xoffset), uintptr(yoffset), uintptr(width), uintptr(height), uintptr(format), uintptr(xtype), uintptr(pixels))
|
||||||
}
|
}
|
||||||
|
|
||||||
func Uniform1f(location int32, v0 float32) {
|
|
||||||
Uniform1fv(location, 1, (*float32)(Ptr([]float32{v0})))
|
|
||||||
}
|
|
||||||
|
|
||||||
func Uniform1i(location int32, v0 int32) {
|
func Uniform1i(location int32, v0 int32) {
|
||||||
purego.SyscallN(gpUniform1i, uintptr(location), uintptr(v0))
|
purego.SyscallN(gpUniform1i, uintptr(location), uintptr(v0))
|
||||||
}
|
}
|
||||||
@ -636,10 +631,6 @@ func InitWithProcAddrFunc(getProcAddr func(name string) uintptr) error {
|
|||||||
if gpTexSubImage2D == 0 {
|
if gpTexSubImage2D == 0 {
|
||||||
return errors.New("gl: glTexSubImage2D is missing")
|
return errors.New("gl: glTexSubImage2D is missing")
|
||||||
}
|
}
|
||||||
gpUniform1f = getProcAddr("glUniform1f")
|
|
||||||
if gpUniform1f == 0 {
|
|
||||||
return errors.New("gl: glUniform1f is missing")
|
|
||||||
}
|
|
||||||
gpUniform1i = getProcAddr("glUniform1i")
|
gpUniform1i = getProcAddr("glUniform1i")
|
||||||
if gpUniform1i == 0 {
|
if gpUniform1i == 0 {
|
||||||
return errors.New("gl: glUniform1i is missing")
|
return errors.New("gl: glUniform1i is missing")
|
||||||
|
@ -79,7 +79,6 @@ type gl struct {
|
|||||||
texImage2D js.Value
|
texImage2D js.Value
|
||||||
texSubImage2D js.Value
|
texSubImage2D js.Value
|
||||||
texParameteri js.Value
|
texParameteri js.Value
|
||||||
uniform1f js.Value
|
|
||||||
uniform1fv js.Value
|
uniform1fv js.Value
|
||||||
uniform2fv js.Value
|
uniform2fv js.Value
|
||||||
uniform3fv js.Value
|
uniform3fv js.Value
|
||||||
@ -156,7 +155,6 @@ func (c *context) newGL(v js.Value) *gl {
|
|||||||
texImage2D: v.Get("texImage2D").Call("bind", v),
|
texImage2D: v.Get("texImage2D").Call("bind", v),
|
||||||
texSubImage2D: v.Get("texSubImage2D").Call("bind", v),
|
texSubImage2D: v.Get("texSubImage2D").Call("bind", v),
|
||||||
texParameteri: v.Get("texParameteri").Call("bind", v),
|
texParameteri: v.Get("texParameteri").Call("bind", v),
|
||||||
uniform1f: v.Get("uniform1f").Call("bind", v),
|
|
||||||
uniform1fv: v.Get("uniform1fv").Call("bind", v),
|
uniform1fv: v.Get("uniform1fv").Call("bind", v),
|
||||||
uniform2fv: v.Get("uniform2fv").Call("bind", v),
|
uniform2fv: v.Get("uniform2fv").Call("bind", v),
|
||||||
uniform3fv: v.Get("uniform3fv").Call("bind", v),
|
uniform3fv: v.Get("uniform3fv").Call("bind", v),
|
||||||
|
@ -324,10 +324,6 @@ func (DefaultContext) TexSubImage2D(target uint32, level int32, xoffset int32, y
|
|||||||
C.glTexSubImage2D(C.GLenum(target), C.GLint(level), C.GLint(xoffset), C.GLint(yoffset), C.GLsizei(width), C.GLsizei(height), C.GLenum(format), C.GLenum(xtype), unsafe.Pointer(&pixels[0]))
|
C.glTexSubImage2D(C.GLenum(target), C.GLint(level), C.GLint(xoffset), C.GLint(yoffset), C.GLsizei(width), C.GLsizei(height), C.GLenum(format), C.GLenum(xtype), unsafe.Pointer(&pixels[0]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (DefaultContext) Uniform1f(location int32, v0 float32) {
|
|
||||||
C.glUniform1f(C.GLint(location), C.GLfloat(v0))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (DefaultContext) Uniform1fv(location int32, value []float32) {
|
func (DefaultContext) Uniform1fv(location int32, value []float32) {
|
||||||
C.glUniform1fv(C.GLint(location), C.GLsizei(len(value)), (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
C.glUniform1fv(C.GLint(location), C.GLsizei(len(value)), (*C.GLfloat)(unsafe.Pointer(&value[0])))
|
||||||
}
|
}
|
||||||
|
@ -298,10 +298,6 @@ func (g *GomobileContext) TexSubImage2D(target uint32, level int32, xoffset int3
|
|||||||
g.ctx.TexSubImage2D(gl.Enum(target), int(level), int(xoffset), int(yoffset), int(width), int(height), gl.Enum(format), gl.Enum(xtype), pixels)
|
g.ctx.TexSubImage2D(gl.Enum(target), int(level), int(xoffset), int(yoffset), int(width), int(height), gl.Enum(format), gl.Enum(xtype), pixels)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GomobileContext) Uniform1f(location int32, v0 float32) {
|
|
||||||
g.ctx.Uniform1f(gl.Uniform{Value: location}, v0)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *GomobileContext) Uniform1fv(location int32, value []float32) {
|
func (g *GomobileContext) Uniform1fv(location int32, value []float32) {
|
||||||
g.ctx.Uniform1fv(gl.Uniform{Value: location}, value)
|
g.ctx.Uniform1fv(gl.Uniform{Value: location}, value)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,6 @@ type Context interface {
|
|||||||
TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, format uint32, xtype uint32, pixels []byte)
|
TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, format uint32, xtype uint32, pixels []byte)
|
||||||
TexParameteri(target uint32, pname uint32, param int32)
|
TexParameteri(target uint32, pname uint32, param int32)
|
||||||
TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels []byte)
|
TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels []byte)
|
||||||
Uniform1f(location int32, v0 float32)
|
|
||||||
Uniform1fv(location int32, value []float32)
|
Uniform1fv(location int32, value []float32)
|
||||||
Uniform1i(location int32, v0 int32)
|
Uniform1i(location int32, v0 int32)
|
||||||
Uniform2fv(location int32, value []float32)
|
Uniform2fv(location int32, value []float32)
|
||||||
|
Loading…
Reference in New Issue
Block a user