Update C sources and add new functions

This commit is contained in:
Milan Nikolic 2018-02-21 21:26:09 +01:00
parent 9784968948
commit 7874621942
24 changed files with 2149 additions and 1316 deletions

View file

@ -40,6 +40,20 @@ func LoadShader(vsFileName string, fsFileName string) Shader {
return v
}
// LoadShaderCode - Load shader from code strings and bind default locations
func LoadShaderCode(vsCode string, fsCode string) Shader {
cvsCode := C.CString(vsCode)
defer C.free(unsafe.Pointer(cvsCode))
cfsCode := C.CString(fsCode)
defer C.free(unsafe.Pointer(cfsCode))
ret := C.LoadShaderCode(cvsCode, cfsCode)
v := newShaderFromPointer(unsafe.Pointer(&ret))
return v
}
// UnloadShader - Unload a custom shader from memory
func UnloadShader(shader Shader) {
cshader := shader.cptr()