On Sunday, 18 January 2015 at 19:42:33 UTC, WhatMeWorry wrote:
I've got a OpenGL function returning a pointer
// const GLubyte *version = glGetString(GL_VERSION); // C++
and openLG code
// the following compiles with no errors or warnings
char openglVersion[100] = fromStringz(glGetString(GL_VERSION));
// ABENDS HERE!
// documentation from std.string shows
// pure @system inout(char)[] fromStringz(inout(char)* cString);
// Seems pretty innocuous to me.
Debugger returns:
Unhandled exception at 0x76AC2F71 (KernelBase.dll) in
WhatVersionOfOpenGL.exe
// Got it to work with
writeln(fromStringz(glGetString(GL_VERSION)));
But shouldn't I have been able to grabbed a copy of the string
and put it in the openglVersion fixed size char array? Maybe
string, or dynamic array?