GLchar** problem

Saaa empty at needmail.com
Thu Oct 30 12:44:06 PDT 2008


glshaderSource needs a GLchar** and all I get from cast(char[]) 
read(filename) is a single *

How do I get this extra pointer ? :D

The C code is:

char *file;
shader = glCreateShader(GL_FRAGMENT_SHADER);
file = textFileRead("program.frag");
const char * filep = file;
glShaderSource(f, 1, &filep,NULL);
free(filep);

my D attempt:

char[] file;
GLuint shader;
shader=glCreateShader(GL_FRAGMENT_SHADER);
file=cast(char[])read(`program.frag`);
glShaderSource(f, 1, cast(char **) toStringz(file),null);
//let gc collect file

Error: Access Violation :)




More information about the Digitalmars-d-learn mailing list