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);

pt.d(26): Error: cannot implicitly convert expression (toStringz(source)) of type immutable(char)* to const(string)

pt.d(34): Error: function pointer glShaderSource (uint, int, const(char*)*, const(int)*) is not callable using argument types (uint, int, const(string)*, const(int)*)

-

I also tried passing the char array instead but no go.. What am I missing? :\

Oops, do `const immutable(char)* sources = source.toStringz` (or just use `auto sources = ...`).

Reply via email to