lib/glesv2: simplify implementation of `GLShader::source=`
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 2 Jan 2015 16:24:46 +0000 (11:24 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 2 Jan 2015 21:19:19 +0000 (16:19 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/glesv2/glesv2.nit

index 8d5ec6a..477fc47 100644 (file)
@@ -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