LWJGL Forum

Programming => OpenGL => Topic started by: Tomas on June 15, 2010, 19:50:18

Title: Shader API and Java String
Post by: Tomas on June 15, 2010, 19:50:18
Hi,

I was playing with some glsl coding and to my suprise I found that the LWJGL implementation of some function don't use java Strings ?

  glBindAttribLocation(int program, int index, ByteBuffer name);
  glShaderSource(int shader, ByterBuffer string);

Why don't these functions use regular Java String as the last argument ? Is there a good reason or am I missing something. It feels kind of counter productive to push and pop strings in and out of bytebuffers.

Cheers
// Tomas
Title: Re: Shader API and Java String
Post by: spasi on June 15, 2010, 23:50:46
The latest LWJGL version provides alternate versions for both of these methods, with CharSequence arguments (String implements CharSequence). Many other alternate methods are supported, see this thread (http://lwjgl.org/forum/index.php/topic,3248.0.html) for details.
Title: Re: Shader API and Java String
Post by: Tomas on June 16, 2010, 00:31:43
Sweet :D