I'm working a library with DerelictGL3.
using branch 2.0

import derelict.opengl;
import std.stdio : writeln;

struct VertexBuffer
{
    GLuint vbo;
    GLsizei count;

    this(GLsizei n)
    {
        writeln("creating vbo");
        glGenBuffers(n, &vbo);
        writeln("created vbo");
        count = n;
        writeln("exiting vbo");
    }

    // more code
}

When I import my library into my program.
glGenBuffers segmentation fault.

When I copy VertexBuffer into main code. It works fine.
Why am I getting segmentation fault from library ?

Reply via email to