From d66516e664486d225b1ccc5a59db954ba003fe54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Fri, 2 Jan 2015 11:24:46 -0500 Subject: [PATCH] lib/glesv2: simplify implementation of `GLShader::source=` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/glesv2/glesv2.nit | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -- 1.7.9.5