From: Alexis Laferrière Date: Fri, 2 Jan 2015 16:24:46 +0000 (-0500) Subject: lib/glesv2: simplify implementation of `GLShader::source=` X-Git-Tag: v0.7.1~55^2~10 X-Git-Url: http://nitlanguage.org lib/glesv2: simplify implementation of `GLShader::source=` Signed-off-by: Alexis Laferrière --- diff --git a/lib/glesv2/glesv2.nit b/lib/glesv2/glesv2.nit index 8d5ec6a..477fc47 100644 --- a/lib/glesv2/glesv2.nit +++ b/lib/glesv2/glesv2.nit @@ -199,9 +199,8 @@ end # Abstract OpenGL ES shader object, implemented by `GLFragmentShader` and `GLVertexShader` extern class GLShader `{GLuint`} # Set the source of the shader - fun source=(code: String) import String.to_cstring, String.length `{ - GLchar *c_code = String_to_cstring(code); - glShaderSource(recv, 1, (const GLchar * const*)&c_code, NULL); + fun source=(code: NativeString) `{ + glShaderSource(recv, 1, (GLchar const **)&code, NULL); `} # Source of the shader, if available