On Tuesday, 2 June 2015 at 16:41:38 UTC, Kyoji Klyden wrote:
src:
string source = readText("test.glvert");
const string sources = source.toStringz;
const int len = source.length;
GLuint vertShader = glCreateShader( GL_VERTEX_SHADER );
glShaderSource(vertShader, 1, &sources, &len);
Judging by the docs, you don't need null-terminated strings and
can use native D strings, just pass their lengths:
string source = readText("test.glvert");
const char* sources = source.ptr;
const GLint len = cast(GLint)source.length;
GLuint vertShader = glCreateShader( GL_VERTEX_SHADER );
glShaderSource(vertShader, 1, &sources, &len);