[Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

TheFlyingFiddle kurtyan at student.chalmers.se
Tue Jan 21 18:11:01 PST 2014


On Saturday, 18 January 2014 at 19:40:38 UTC, Xavier Bigand wrote:
> I am not sure the issue come really from my code, cause it just 
> works fine on ATI cards, I do something Nvidia drivers dislike.
>
> I tried to replace GL_LINE_LOOP by triangles, increase buffer 
> size, put the GL_ELEMENT_ARRAY_BUFFER buffer type bind right 
> before glDrawElements without success.
>
> Crash only append when I fill text mesh before those ones. So I 
> need dig more.

 From what i saw in your code you are not using Vertex Array 
Objects. I have had similar problems that code ran fine on ATI 
but crashed on nvidia. The problem went away for me when i just 
created and bound a global VAO just after context creation.

Also i would recommend calling glGetError after every call, it 
helps finding errors. Here is a simple trick to do this 
automatically.

static gl
{

   static ref auto opDispatch(string name, Args...)(Args args)
   {
     enum glName = "gl" ~ name[0].toUpper.to!string ~ name[1 .. $];

     debug scope(exit) checkGLError(); //Do glGetError and log it 
or something.
     mixin("return " ~ glName ~ "(args);");
   }
}


After this simply change all glFunctionName(args) to 
gl.functionName or gl.functionName.


More information about the Digitalmars-d-learn mailing list