internal/graphicsdriver/opengl/gl: remove unused functions

This commit is contained in:
Hajime Hoshi 2022-11-13 02:24:21 +09:00
parent 742b142b31
commit c5fb6fa23f
5 changed files with 152 additions and 328 deletions

View File

@ -129,25 +129,13 @@ package gl
// typedef void (APIENTRYP GPGENFRAMEBUFFERSEXT)(GLsizei n, GLuint * framebuffers); // typedef void (APIENTRYP GPGENFRAMEBUFFERSEXT)(GLsizei n, GLuint * framebuffers);
// typedef void (APIENTRYP GPGENRENDERBUFFERSEXT)(GLsizei n, GLuint * renderbuffers); // typedef void (APIENTRYP GPGENRENDERBUFFERSEXT)(GLsizei n, GLuint * renderbuffers);
// typedef void (APIENTRYP GPGENTEXTURES)(GLsizei n, GLuint * textures); // typedef void (APIENTRYP GPGENTEXTURES)(GLsizei n, GLuint * textures);
// typedef void (APIENTRYP GPGETDOUBLEI_V)(GLenum target, GLuint index, GLdouble * data);
// typedef void (APIENTRYP GPGETDOUBLEI_VEXT)(GLenum pname, GLuint index, GLdouble * params);
// typedef GLenum (APIENTRYP GPGETERROR)(); // typedef GLenum (APIENTRYP GPGETERROR)();
// typedef void (APIENTRYP GPGETFLOATI_V)(GLenum target, GLuint index, GLfloat * data);
// typedef void (APIENTRYP GPGETFLOATI_VEXT)(GLenum pname, GLuint index, GLfloat * params);
// typedef void (APIENTRYP GPGETINTEGERI_V)(GLenum target, GLuint index, GLint * data);
// typedef void (APIENTRYP GPGETINTEGERUI64I_VNV)(GLenum value, GLuint index, GLuint64EXT * result);
// typedef void (APIENTRYP GPGETINTEGERV)(GLenum pname, GLint * data); // typedef void (APIENTRYP GPGETINTEGERV)(GLenum pname, GLint * data);
// typedef void (APIENTRYP GPGETPOINTERI_VEXT)(GLenum pname, GLuint index, void ** params);
// typedef void (APIENTRYP GPGETPROGRAMINFOLOG)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); // typedef void (APIENTRYP GPGETPROGRAMINFOLOG)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
// typedef void (APIENTRYP GPGETPROGRAMIV)(GLuint program, GLenum pname, GLint * params); // typedef void (APIENTRYP GPGETPROGRAMIV)(GLuint program, GLenum pname, GLint * params);
// typedef void (APIENTRYP GPGETSHADERINFOLOG)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); // typedef void (APIENTRYP GPGETSHADERINFOLOG)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
// typedef void (APIENTRYP GPGETSHADERIV)(GLuint shader, GLenum pname, GLint * params); // typedef void (APIENTRYP GPGETSHADERIV)(GLuint shader, GLenum pname, GLint * params);
// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKI64_V)(GLuint xfb, GLenum pname, GLuint index, GLint64 * param);
// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKI_V)(GLuint xfb, GLenum pname, GLuint index, GLint * param);
// typedef GLint (APIENTRYP GPGETUNIFORMLOCATION)(GLuint program, const GLchar * name); // typedef GLint (APIENTRYP GPGETUNIFORMLOCATION)(GLuint program, const GLchar * name);
// typedef void (APIENTRYP GPGETUNSIGNEDBYTEI_VEXT)(GLenum target, GLuint index, GLubyte * data);
// typedef void (APIENTRYP GPGETVERTEXARRAYINTEGERI_VEXT)(GLuint vaobj, GLuint index, GLenum pname, GLint * param);
// typedef void (APIENTRYP GPGETVERTEXARRAYPOINTERI_VEXT)(GLuint vaobj, GLuint index, GLenum pname, void ** param);
// typedef GLboolean (APIENTRYP GPISFRAMEBUFFEREXT)(GLuint framebuffer); // typedef GLboolean (APIENTRYP GPISFRAMEBUFFEREXT)(GLuint framebuffer);
// typedef GLboolean (APIENTRYP GPISPROGRAM)(GLuint program); // typedef GLboolean (APIENTRYP GPISPROGRAM)(GLuint program);
// typedef GLboolean (APIENTRYP GPISRENDERBUFFEREXT)(GLuint renderbuffer); // typedef GLboolean (APIENTRYP GPISRENDERBUFFEREXT)(GLuint renderbuffer);
@ -281,33 +269,12 @@ package gl
// static void glowGenTextures(GPGENTEXTURES fnptr, GLsizei n, GLuint * textures) { // static void glowGenTextures(GPGENTEXTURES fnptr, GLsizei n, GLuint * textures) {
// (*fnptr)(n, textures); // (*fnptr)(n, textures);
// } // }
// static void glowGetDoublei_v(GPGETDOUBLEI_V fnptr, GLenum target, GLuint index, GLdouble * data) {
// (*fnptr)(target, index, data);
// }
// static void glowGetDoublei_vEXT(GPGETDOUBLEI_VEXT fnptr, GLenum pname, GLuint index, GLdouble * params) {
// (*fnptr)(pname, index, params);
// }
// static GLenum glowGetError(GPGETERROR fnptr) { // static GLenum glowGetError(GPGETERROR fnptr) {
// return (*fnptr)(); // return (*fnptr)();
// } // }
// static void glowGetFloati_v(GPGETFLOATI_V fnptr, GLenum target, GLuint index, GLfloat * data) {
// (*fnptr)(target, index, data);
// }
// static void glowGetFloati_vEXT(GPGETFLOATI_VEXT fnptr, GLenum pname, GLuint index, GLfloat * params) {
// (*fnptr)(pname, index, params);
// }
// static void glowGetIntegeri_v(GPGETINTEGERI_V fnptr, GLenum target, GLuint index, GLint * data) {
// (*fnptr)(target, index, data);
// }
// static void glowGetIntegerui64i_vNV(GPGETINTEGERUI64I_VNV fnptr, GLenum value, GLuint index, GLuint64EXT * result) {
// (*fnptr)(value, index, result);
// }
// static void glowGetIntegerv(GPGETINTEGERV fnptr, GLenum pname, GLint * data) { // static void glowGetIntegerv(GPGETINTEGERV fnptr, GLenum pname, GLint * data) {
// (*fnptr)(pname, data); // (*fnptr)(pname, data);
// } // }
// static void glowGetPointeri_vEXT(GPGETPOINTERI_VEXT fnptr, GLenum pname, GLuint index, void ** params) {
// (*fnptr)(pname, index, params);
// }
// static void glowGetProgramInfoLog(GPGETPROGRAMINFOLOG fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) { // static void glowGetProgramInfoLog(GPGETPROGRAMINFOLOG fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
// (*fnptr)(program, bufSize, length, infoLog); // (*fnptr)(program, bufSize, length, infoLog);
// } // }
@ -320,24 +287,9 @@ package gl
// static void glowGetShaderiv(GPGETSHADERIV fnptr, GLuint shader, GLenum pname, GLint * params) { // static void glowGetShaderiv(GPGETSHADERIV fnptr, GLuint shader, GLenum pname, GLint * params) {
// (*fnptr)(shader, pname, params); // (*fnptr)(shader, pname, params);
// } // }
// static void glowGetTransformFeedbacki64_v(GPGETTRANSFORMFEEDBACKI64_V fnptr, GLuint xfb, GLenum pname, GLuint index, GLint64 * param) {
// (*fnptr)(xfb, pname, index, param);
// }
// static void glowGetTransformFeedbacki_v(GPGETTRANSFORMFEEDBACKI_V fnptr, GLuint xfb, GLenum pname, GLuint index, GLint * param) {
// (*fnptr)(xfb, pname, index, param);
// }
// static GLint glowGetUniformLocation(GPGETUNIFORMLOCATION fnptr, GLuint program, const GLchar * name) { // static GLint glowGetUniformLocation(GPGETUNIFORMLOCATION fnptr, GLuint program, const GLchar * name) {
// return (*fnptr)(program, name); // return (*fnptr)(program, name);
// } // }
// static void glowGetUnsignedBytei_vEXT(GPGETUNSIGNEDBYTEI_VEXT fnptr, GLenum target, GLuint index, GLubyte * data) {
// (*fnptr)(target, index, data);
// }
// static void glowGetVertexArrayIntegeri_vEXT(GPGETVERTEXARRAYINTEGERI_VEXT fnptr, GLuint vaobj, GLuint index, GLenum pname, GLint * param) {
// (*fnptr)(vaobj, index, pname, param);
// }
// static void glowGetVertexArrayPointeri_vEXT(GPGETVERTEXARRAYPOINTERI_VEXT fnptr, GLuint vaobj, GLuint index, GLenum pname, void ** param) {
// (*fnptr)(vaobj, index, pname, param);
// }
// static GLboolean glowIsFramebufferEXT(GPISFRAMEBUFFEREXT fnptr, GLuint framebuffer) { // static GLboolean glowIsFramebufferEXT(GPISFRAMEBUFFEREXT fnptr, GLuint framebuffer) {
// return (*fnptr)(framebuffer); // return (*fnptr)(framebuffer);
// } // }
@ -464,25 +416,13 @@ var (
gpGenFramebuffersEXT C.GPGENFRAMEBUFFERSEXT gpGenFramebuffersEXT C.GPGENFRAMEBUFFERSEXT
gpGenRenderbuffersEXT C.GPGENRENDERBUFFERSEXT gpGenRenderbuffersEXT C.GPGENRENDERBUFFERSEXT
gpGenTextures C.GPGENTEXTURES gpGenTextures C.GPGENTEXTURES
gpGetDoublei_v C.GPGETDOUBLEI_V
gpGetDoublei_vEXT C.GPGETDOUBLEI_VEXT
gpGetError C.GPGETERROR gpGetError C.GPGETERROR
gpGetFloati_v C.GPGETFLOATI_V
gpGetFloati_vEXT C.GPGETFLOATI_VEXT
gpGetIntegeri_v C.GPGETINTEGERI_V
gpGetIntegerui64i_vNV C.GPGETINTEGERUI64I_VNV
gpGetIntegerv C.GPGETINTEGERV gpGetIntegerv C.GPGETINTEGERV
gpGetPointeri_vEXT C.GPGETPOINTERI_VEXT
gpGetProgramInfoLog C.GPGETPROGRAMINFOLOG gpGetProgramInfoLog C.GPGETPROGRAMINFOLOG
gpGetProgramiv C.GPGETPROGRAMIV gpGetProgramiv C.GPGETPROGRAMIV
gpGetShaderInfoLog C.GPGETSHADERINFOLOG gpGetShaderInfoLog C.GPGETSHADERINFOLOG
gpGetShaderiv C.GPGETSHADERIV gpGetShaderiv C.GPGETSHADERIV
gpGetTransformFeedbacki64_v C.GPGETTRANSFORMFEEDBACKI64_V
gpGetTransformFeedbacki_v C.GPGETTRANSFORMFEEDBACKI_V
gpGetUniformLocation C.GPGETUNIFORMLOCATION gpGetUniformLocation C.GPGETUNIFORMLOCATION
gpGetUnsignedBytei_vEXT C.GPGETUNSIGNEDBYTEI_VEXT
gpGetVertexArrayIntegeri_vEXT C.GPGETVERTEXARRAYINTEGERI_VEXT
gpGetVertexArrayPointeri_vEXT C.GPGETVERTEXARRAYPOINTERI_VEXT
gpIsFramebufferEXT C.GPISFRAMEBUFFEREXT gpIsFramebufferEXT C.GPISFRAMEBUFFEREXT
gpIsProgram C.GPISPROGRAM gpIsProgram C.GPISPROGRAM
gpIsRenderbufferEXT C.GPISRENDERBUFFEREXT gpIsRenderbufferEXT C.GPISRENDERBUFFEREXT
@ -662,38 +602,15 @@ func GenTextures(n int32, textures *uint32) {
C.glowGenTextures(gpGenTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures))) C.glowGenTextures(gpGenTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)))
} }
func GetDoublei_v(target uint32, index uint32, data *float64) {
C.glowGetDoublei_v(gpGetDoublei_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(data)))
}
func GetDoublei_vEXT(pname uint32, index uint32, params *float64) {
C.glowGetDoublei_vEXT(gpGetDoublei_vEXT, (C.GLenum)(pname), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(params)))
}
func GetError() uint32 { func GetError() uint32 {
ret := C.glowGetError(gpGetError) ret := C.glowGetError(gpGetError)
return (uint32)(ret) return (uint32)(ret)
} }
func GetFloati_v(target uint32, index uint32, data *float32) {
C.glowGetFloati_v(gpGetFloati_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(data)))
}
func GetFloati_vEXT(pname uint32, index uint32, params *float32) {
C.glowGetFloati_vEXT(gpGetFloati_vEXT, (C.GLenum)(pname), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(params)))
}
func GetIntegeri_v(target uint32, index uint32, data *int32) {
C.glowGetIntegeri_v(gpGetIntegeri_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(data)))
}
func GetIntegerui64i_vNV(value uint32, index uint32, result *uint64) {
C.glowGetIntegerui64i_vNV(gpGetIntegerui64i_vNV, (C.GLenum)(value), (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(result)))
}
func GetIntegerv(pname uint32, data *int32) { func GetIntegerv(pname uint32, data *int32) {
C.glowGetIntegerv(gpGetIntegerv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(data))) C.glowGetIntegerv(gpGetIntegerv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(data)))
} }
func GetPointeri_vEXT(pname uint32, index uint32, params *unsafe.Pointer) {
C.glowGetPointeri_vEXT(gpGetPointeri_vEXT, (C.GLenum)(pname), (C.GLuint)(index), params)
}
func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) { func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) {
C.glowGetProgramInfoLog(gpGetProgramInfoLog, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog))) C.glowGetProgramInfoLog(gpGetProgramInfoLog, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
} }
@ -710,28 +627,11 @@ func GetShaderiv(shader uint32, pname uint32, params *int32) {
C.glowGetShaderiv(gpGetShaderiv, (C.GLuint)(shader), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params))) C.glowGetShaderiv(gpGetShaderiv, (C.GLuint)(shader), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
} }
func GetTransformFeedbacki64_v(xfb uint32, pname uint32, index uint32, param *int64) {
C.glowGetTransformFeedbacki64_v(gpGetTransformFeedbacki64_v, (C.GLuint)(xfb), (C.GLenum)(pname), (C.GLuint)(index), (*C.GLint64)(unsafe.Pointer(param)))
}
func GetTransformFeedbacki_v(xfb uint32, pname uint32, index uint32, param *int32) {
C.glowGetTransformFeedbacki_v(gpGetTransformFeedbacki_v, (C.GLuint)(xfb), (C.GLenum)(pname), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(param)))
}
func GetUniformLocation(program uint32, name *uint8) int32 { func GetUniformLocation(program uint32, name *uint8) int32 {
ret := C.glowGetUniformLocation(gpGetUniformLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name))) ret := C.glowGetUniformLocation(gpGetUniformLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name)))
return (int32)(ret) return (int32)(ret)
} }
func GetUnsignedBytei_vEXT(target uint32, index uint32, data *uint8) {
C.glowGetUnsignedBytei_vEXT(gpGetUnsignedBytei_vEXT, (C.GLenum)(target), (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(data)))
}
func GetVertexArrayIntegeri_vEXT(vaobj uint32, index uint32, pname uint32, param *int32) {
C.glowGetVertexArrayIntegeri_vEXT(gpGetVertexArrayIntegeri_vEXT, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
}
func GetVertexArrayPointeri_vEXT(vaobj uint32, index uint32, pname uint32, param *unsafe.Pointer) {
C.glowGetVertexArrayPointeri_vEXT(gpGetVertexArrayPointeri_vEXT, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), param)
}
func IsFramebufferEXT(framebuffer uint32) bool { func IsFramebufferEXT(framebuffer uint32) bool {
ret := C.glowIsFramebufferEXT(gpIsFramebufferEXT, (C.GLuint)(framebuffer)) ret := C.glowIsFramebufferEXT(gpIsFramebufferEXT, (C.GLuint)(framebuffer))
return ret == glconst.TRUE return ret == glconst.TRUE
@ -962,21 +862,14 @@ func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {
if gpGenTextures == nil { if gpGenTextures == nil {
return errors.New("gl: glGenTextures is missing") return errors.New("gl: glGenTextures is missing")
} }
gpGetDoublei_v = (C.GPGETDOUBLEI_V)(getProcAddr("glGetDoublei_v"))
gpGetDoublei_vEXT = (C.GPGETDOUBLEI_VEXT)(getProcAddr("glGetDoublei_vEXT"))
gpGetError = (C.GPGETERROR)(getProcAddr("glGetError")) gpGetError = (C.GPGETERROR)(getProcAddr("glGetError"))
if gpGetError == nil { if gpGetError == nil {
return errors.New("gl: glGetError is missing") return errors.New("gl: glGetError is missing")
} }
gpGetFloati_v = (C.GPGETFLOATI_V)(getProcAddr("glGetFloati_v"))
gpGetFloati_vEXT = (C.GPGETFLOATI_VEXT)(getProcAddr("glGetFloati_vEXT"))
gpGetIntegeri_v = (C.GPGETINTEGERI_V)(getProcAddr("glGetIntegeri_v"))
gpGetIntegerui64i_vNV = (C.GPGETINTEGERUI64I_VNV)(getProcAddr("glGetIntegerui64i_vNV"))
gpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr("glGetIntegerv")) gpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr("glGetIntegerv"))
if gpGetIntegerv == nil { if gpGetIntegerv == nil {
return errors.New("gl: glGetIntegerv is missing") return errors.New("gl: glGetIntegerv is missing")
} }
gpGetPointeri_vEXT = (C.GPGETPOINTERI_VEXT)(getProcAddr("glGetPointeri_vEXT"))
gpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr("glGetProgramInfoLog")) gpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr("glGetProgramInfoLog"))
if gpGetProgramInfoLog == nil { if gpGetProgramInfoLog == nil {
return errors.New("gl: glGetProgramInfoLog is missing") return errors.New("gl: glGetProgramInfoLog is missing")
@ -993,15 +886,10 @@ func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {
if gpGetShaderiv == nil { if gpGetShaderiv == nil {
return errors.New("gl: glGetShaderiv is missing") return errors.New("gl: glGetShaderiv is missing")
} }
gpGetTransformFeedbacki64_v = (C.GPGETTRANSFORMFEEDBACKI64_V)(getProcAddr("glGetTransformFeedbacki64_v"))
gpGetTransformFeedbacki_v = (C.GPGETTRANSFORMFEEDBACKI_V)(getProcAddr("glGetTransformFeedbacki_v"))
gpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr("glGetUniformLocation")) gpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr("glGetUniformLocation"))
if gpGetUniformLocation == nil { if gpGetUniformLocation == nil {
return errors.New("gl: glGetUniformLocation is missing") return errors.New("gl: glGetUniformLocation is missing")
} }
gpGetUnsignedBytei_vEXT = (C.GPGETUNSIGNEDBYTEI_VEXT)(getProcAddr("glGetUnsignedBytei_vEXT"))
gpGetVertexArrayIntegeri_vEXT = (C.GPGETVERTEXARRAYINTEGERI_VEXT)(getProcAddr("glGetVertexArrayIntegeri_vEXT"))
gpGetVertexArrayPointeri_vEXT = (C.GPGETVERTEXARRAYPOINTERI_VEXT)(getProcAddr("glGetVertexArrayPointeri_vEXT"))
gpIsFramebufferEXT = (C.GPISFRAMEBUFFEREXT)(getProcAddr("glIsFramebufferEXT")) gpIsFramebufferEXT = (C.GPISFRAMEBUFFEREXT)(getProcAddr("glIsFramebufferEXT"))
gpIsProgram = (C.GPISPROGRAM)(getProcAddr("glIsProgram")) gpIsProgram = (C.GPISPROGRAM)(getProcAddr("glIsProgram"))
if gpIsProgram == nil { if gpIsProgram == nil {

View File

@ -47,25 +47,13 @@ var (
gpGenFramebuffersEXT uintptr gpGenFramebuffersEXT uintptr
gpGenRenderbuffersEXT uintptr gpGenRenderbuffersEXT uintptr
gpGenTextures uintptr gpGenTextures uintptr
gpGetDoublei_v uintptr
gpGetDoublei_vEXT uintptr
gpGetError uintptr gpGetError uintptr
gpGetFloati_v uintptr
gpGetFloati_vEXT uintptr
gpGetIntegeri_v uintptr
gpGetIntegerui64i_vNV uintptr
gpGetIntegerv uintptr gpGetIntegerv uintptr
gpGetPointeri_vEXT uintptr
gpGetProgramInfoLog uintptr gpGetProgramInfoLog uintptr
gpGetProgramiv uintptr gpGetProgramiv uintptr
gpGetShaderInfoLog uintptr gpGetShaderInfoLog uintptr
gpGetShaderiv uintptr gpGetShaderiv uintptr
gpGetTransformFeedbacki64_v uintptr
gpGetTransformFeedbacki_v uintptr
gpGetUniformLocation uintptr gpGetUniformLocation uintptr
gpGetUnsignedBytei_vEXT uintptr
gpGetVertexArrayIntegeri_vEXT uintptr
gpGetVertexArrayPointeri_vEXT uintptr
gpIsFramebufferEXT uintptr gpIsFramebufferEXT uintptr
gpIsProgram uintptr gpIsProgram uintptr
gpIsRenderbufferEXT uintptr gpIsRenderbufferEXT uintptr
@ -245,38 +233,15 @@ func GenTextures(n int32, textures *uint32) {
purego.SyscallN(gpGenTextures, uintptr(n), uintptr(unsafe.Pointer(textures))) purego.SyscallN(gpGenTextures, uintptr(n), uintptr(unsafe.Pointer(textures)))
} }
func GetDoublei_v(target uint32, index uint32, data *float64) {
purego.SyscallN(gpGetDoublei_v, uintptr(target), uintptr(index), uintptr(unsafe.Pointer(data)))
}
func GetDoublei_vEXT(pname uint32, index uint32, params *float64) {
purego.SyscallN(gpGetDoublei_vEXT, uintptr(pname), uintptr(index), uintptr(unsafe.Pointer(params)))
}
func GetError() uint32 { func GetError() uint32 {
ret, _, _ := purego.SyscallN(gpGetError) ret, _, _ := purego.SyscallN(gpGetError)
return uint32(ret) return uint32(ret)
} }
func GetFloati_v(target uint32, index uint32, data *float32) {
purego.SyscallN(gpGetFloati_v, uintptr(target), uintptr(index), uintptr(unsafe.Pointer(data)))
}
func GetFloati_vEXT(pname uint32, index uint32, params *float32) {
purego.SyscallN(gpGetFloati_vEXT, uintptr(pname), uintptr(index), uintptr(unsafe.Pointer(params)))
}
func GetIntegeri_v(target uint32, index uint32, data *int32) {
purego.SyscallN(gpGetIntegeri_v, uintptr(target), uintptr(index), uintptr(unsafe.Pointer(data)))
}
func GetIntegerui64i_vNV(value uint32, index uint32, result *uint64) {
purego.SyscallN(gpGetIntegerui64i_vNV, uintptr(value), uintptr(index), uintptr(unsafe.Pointer(result)))
}
func GetIntegerv(pname uint32, data *int32) { func GetIntegerv(pname uint32, data *int32) {
purego.SyscallN(gpGetIntegerv, uintptr(pname), uintptr(unsafe.Pointer(data))) purego.SyscallN(gpGetIntegerv, uintptr(pname), uintptr(unsafe.Pointer(data)))
} }
func GetPointeri_vEXT(pname uint32, index uint32, params *unsafe.Pointer) {
purego.SyscallN(gpGetPointeri_vEXT, uintptr(pname), uintptr(index), uintptr(unsafe.Pointer(params)))
}
func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) { func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) {
purego.SyscallN(gpGetProgramInfoLog, uintptr(program), uintptr(bufSize), uintptr(unsafe.Pointer(length)), uintptr(unsafe.Pointer(infoLog))) purego.SyscallN(gpGetProgramInfoLog, uintptr(program), uintptr(bufSize), uintptr(unsafe.Pointer(length)), uintptr(unsafe.Pointer(infoLog)))
} }
@ -293,28 +258,11 @@ func GetShaderiv(shader uint32, pname uint32, params *int32) {
purego.SyscallN(gpGetShaderiv, uintptr(shader), uintptr(pname), uintptr(unsafe.Pointer(params))) purego.SyscallN(gpGetShaderiv, uintptr(shader), uintptr(pname), uintptr(unsafe.Pointer(params)))
} }
func GetTransformFeedbacki64_v(xfb uint32, pname uint32, index uint32, param *int64) {
purego.SyscallN(gpGetTransformFeedbacki64_v, uintptr(xfb), uintptr(pname), uintptr(index), uintptr(unsafe.Pointer(param)))
}
func GetTransformFeedbacki_v(xfb uint32, pname uint32, index uint32, param *int32) {
purego.SyscallN(gpGetTransformFeedbacki_v, uintptr(xfb), uintptr(pname), uintptr(index), uintptr(unsafe.Pointer(param)))
}
func GetUniformLocation(program uint32, name *uint8) int32 { func GetUniformLocation(program uint32, name *uint8) int32 {
ret, _, _ := purego.SyscallN(gpGetUniformLocation, uintptr(program), uintptr(unsafe.Pointer(name))) ret, _, _ := purego.SyscallN(gpGetUniformLocation, uintptr(program), uintptr(unsafe.Pointer(name)))
return int32(ret) return int32(ret)
} }
func GetUnsignedBytei_vEXT(target uint32, index uint32, data *uint8) {
purego.SyscallN(gpGetUnsignedBytei_vEXT, uintptr(target), uintptr(index), uintptr(unsafe.Pointer(data)))
}
func GetVertexArrayIntegeri_vEXT(vaobj uint32, index uint32, pname uint32, param *int32) {
purego.SyscallN(gpGetVertexArrayIntegeri_vEXT, uintptr(vaobj), uintptr(index), uintptr(pname), uintptr(unsafe.Pointer(param)))
}
func GetVertexArrayPointeri_vEXT(vaobj uint32, index uint32, pname uint32, param *unsafe.Pointer) {
purego.SyscallN(gpGetVertexArrayPointeri_vEXT, uintptr(vaobj), uintptr(index), uintptr(pname), uintptr(unsafe.Pointer(param)))
}
func IsFramebufferEXT(framebuffer uint32) bool { func IsFramebufferEXT(framebuffer uint32) bool {
ret, _, _ := purego.SyscallN(gpIsFramebufferEXT, uintptr(framebuffer)) ret, _, _ := purego.SyscallN(gpIsFramebufferEXT, uintptr(framebuffer))
return byte(ret) != 0 return byte(ret) != 0
@ -545,21 +493,14 @@ func InitWithProcAddrFunc(getProcAddr func(name string) uintptr) error {
if gpGenTextures == 0 { if gpGenTextures == 0 {
return errors.New("gl: glGenTextures is missing") return errors.New("gl: glGenTextures is missing")
} }
gpGetDoublei_v = getProcAddr("glGetDoublei_v")
gpGetDoublei_vEXT = getProcAddr("glGetDoublei_vEXT")
gpGetError = getProcAddr("glGetError") gpGetError = getProcAddr("glGetError")
if gpGetError == 0 { if gpGetError == 0 {
return errors.New("gl: glGetError is missing") return errors.New("gl: glGetError is missing")
} }
gpGetFloati_v = getProcAddr("glGetFloati_v")
gpGetFloati_vEXT = getProcAddr("glGetFloati_vEXT")
gpGetIntegeri_v = getProcAddr("glGetIntegeri_v")
gpGetIntegerui64i_vNV = getProcAddr("glGetIntegerui64i_vNV")
gpGetIntegerv = getProcAddr("glGetIntegerv") gpGetIntegerv = getProcAddr("glGetIntegerv")
if gpGetIntegerv == 0 { if gpGetIntegerv == 0 {
return errors.New("gl: glGetIntegerv is missing") return errors.New("gl: glGetIntegerv is missing")
} }
gpGetPointeri_vEXT = getProcAddr("glGetPointeri_vEXT")
gpGetProgramInfoLog = getProcAddr("glGetProgramInfoLog") gpGetProgramInfoLog = getProcAddr("glGetProgramInfoLog")
if gpGetProgramInfoLog == 0 { if gpGetProgramInfoLog == 0 {
return errors.New("gl: glGetProgramInfoLog is missing") return errors.New("gl: glGetProgramInfoLog is missing")
@ -576,15 +517,10 @@ func InitWithProcAddrFunc(getProcAddr func(name string) uintptr) error {
if gpGetShaderiv == 0 { if gpGetShaderiv == 0 {
return errors.New("gl: glGetShaderiv is missing") return errors.New("gl: glGetShaderiv is missing")
} }
gpGetTransformFeedbacki64_v = getProcAddr("glGetTransformFeedbacki64_v")
gpGetTransformFeedbacki_v = getProcAddr("glGetTransformFeedbacki_v")
gpGetUniformLocation = getProcAddr("glGetUniformLocation") gpGetUniformLocation = getProcAddr("glGetUniformLocation")
if gpGetUniformLocation == 0 { if gpGetUniformLocation == 0 {
return errors.New("gl: glGetUniformLocation is missing") return errors.New("gl: glGetUniformLocation is missing")
} }
gpGetUnsignedBytei_vEXT = getProcAddr("glGetUnsignedBytei_vEXT")
gpGetVertexArrayIntegeri_vEXT = getProcAddr("glGetVertexArrayIntegeri_vEXT")
gpGetVertexArrayPointeri_vEXT = getProcAddr("glGetVertexArrayPointeri_vEXT")
gpIsFramebufferEXT = getProcAddr("glIsFramebufferEXT") gpIsFramebufferEXT = getProcAddr("glIsFramebufferEXT")
gpIsProgram = getProcAddr("glIsProgram") gpIsProgram = getProcAddr("glIsProgram")
if gpIsProgram == 0 { if gpIsProgram == 0 {

View File

@ -211,10 +211,6 @@ func (DefaultContext) GetIntegerv(dst []int32, pname uint32) {
C.glGetIntegerv(C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst[0]))) C.glGetIntegerv(C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst[0])))
} }
func (DefaultContext) GetProgramiv(dst []int32, program uint32, pname uint32) {
C.glGetProgramiv(C.GLuint(program), C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst[0])))
}
func (d DefaultContext) GetProgramInfoLog(program uint32) string { func (d DefaultContext) GetProgramInfoLog(program uint32) string {
buflens := make([]int32, 1) buflens := make([]int32, 1)
d.GetProgramiv(buflens, program, glconst.INFO_LOG_LENGTH) d.GetProgramiv(buflens, program, glconst.INFO_LOG_LENGTH)
@ -228,8 +224,8 @@ func (d DefaultContext) GetProgramInfoLog(program uint32) string {
return string(buf[:length]) return string(buf[:length])
} }
func (DefaultContext) GetShaderiv(dst []int32, shader uint32, pname uint32) { func (DefaultContext) GetProgramiv(dst []int32, program uint32, pname uint32) {
C.glGetShaderiv(C.GLuint(shader), C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst[0]))) C.glGetProgramiv(C.GLuint(program), C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst[0])))
} }
func (d DefaultContext) GetShaderInfoLog(shader uint32) string { func (d DefaultContext) GetShaderInfoLog(shader uint32) string {
@ -245,6 +241,10 @@ func (d DefaultContext) GetShaderInfoLog(shader uint32) string {
return string(buf[:length]) return string(buf[:length])
} }
func (DefaultContext) GetShaderiv(dst []int32, shader uint32, pname uint32) {
C.glGetShaderiv(C.GLuint(shader), C.GLenum(pname), (*C.GLint)(unsafe.Pointer(&dst[0])))
}
func (DefaultContext) GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32) (rangeLow, rangeHigh, precision int) { func (DefaultContext) GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32) (rangeLow, rangeHigh, precision int) {
var r [2]int32 var r [2]int32
var p int32 var p int32

View File

@ -214,22 +214,22 @@ func (g *GomobileContext) GetIntegerv(dst []int32, pname uint32) {
g.ctx.GetIntegerv(dst, gl.Enum(pname)) g.ctx.GetIntegerv(dst, gl.Enum(pname))
} }
func (g *GomobileContext) GetProgramiv(dst []int32, program uint32, pname uint32) {
dst[0] = int32(g.ctx.GetProgrami(gmProgram(program), gl.Enum(pname)))
}
func (g *GomobileContext) GetProgramInfoLog(program uint32) string { func (g *GomobileContext) GetProgramInfoLog(program uint32) string {
return g.ctx.GetProgramInfoLog(gmProgram(program)) return g.ctx.GetProgramInfoLog(gmProgram(program))
} }
func (g *GomobileContext) GetShaderiv(dst []int32, shader uint32, pname uint32) { func (g *GomobileContext) GetProgramiv(dst []int32, program uint32, pname uint32) {
dst[0] = int32(g.ctx.GetShaderi(gl.Shader{Value: shader}, gl.Enum(pname))) dst[0] = int32(g.ctx.GetProgrami(gmProgram(program), gl.Enum(pname)))
} }
func (g *GomobileContext) GetShaderInfoLog(shader uint32) string { func (g *GomobileContext) GetShaderInfoLog(shader uint32) string {
return g.ctx.GetShaderInfoLog(gl.Shader{Value: shader}) return g.ctx.GetShaderInfoLog(gl.Shader{Value: shader})
} }
func (g *GomobileContext) GetShaderiv(dst []int32, shader uint32, pname uint32) {
dst[0] = int32(g.ctx.GetShaderi(gl.Shader{Value: shader}, gl.Enum(pname)))
}
func (g *GomobileContext) GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32) (rangeLow, rangeHigh, precision int) { func (g *GomobileContext) GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32) (rangeLow, rangeHigh, precision int) {
return g.ctx.GetShaderPrecisionFormat(gl.Enum(shadertype), gl.Enum(precisiontype)) return g.ctx.GetShaderPrecisionFormat(gl.Enum(shadertype), gl.Enum(precisiontype))
} }

View File

@ -53,10 +53,10 @@ type Context interface {
GenTextures(n int32) []uint32 GenTextures(n int32) []uint32
GetError() uint32 GetError() uint32
GetIntegerv(dst []int32, pname uint32) GetIntegerv(dst []int32, pname uint32)
GetProgramiv(dst []int32, program uint32, pname uint32)
GetProgramInfoLog(program uint32) string GetProgramInfoLog(program uint32) string
GetShaderiv(dst []int32, shader uint32, pname uint32) GetProgramiv(dst []int32, program uint32, pname uint32)
GetShaderInfoLog(shader uint32) string GetShaderInfoLog(shader uint32) string
GetShaderiv(dst []int32, shader uint32, pname uint32)
GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32) (rangeLow, rangeHigh, precision int) GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32) (rangeLow, rangeHigh, precision int)
GetUniformLocation(program uint32, name string) int32 GetUniformLocation(program uint32, name string) int32
IsFramebuffer(framebuffer uint32) bool IsFramebuffer(framebuffer uint32) bool