Le 22/01/2014 14:13, Flamaros a écrit :
On Wednesday, 22 January 2014 at 02:11:02 UTC, TheFlyingFiddle wrote:
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.
I will try the global VAO.
I already check glError with "checkgl!" function.
I finally found the issue, glDisableVertexAttribArray calls were
missing. I just doesn't understand why it works majority of times and
any openGL debugging tool was able to warm me about that.
Maybe I need try DirectX and see if debugging tools are better.