Shader API and Java String

Started by Tomas, June 15, 2010, 19:50:18

Previous topic - Next topic

Tomas

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

spasi

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 for details.