Giter Site home page Giter Site logo

Comments (4)

MasterQ32 avatar MasterQ32 commented on May 15, 2024

In a similar way to the mach-glfw example, you invoke loadExtensions with SDL_GL_GetProcAddress

from zgl.

mstrng avatar mstrng commented on May 15, 2024

Well, the following seems to compile and run, but I don't know if it's the intended way to do it:

fn glGetProcAddress(p: []const u8, proc: [:0]const u8) ?*const anyopaque {
    _ = p;
    return sdl.c.SDL_GL_GetProcAddress(@ptrCast([*c]const u8, proc));
}
    const proc: []const u8 = undefined;
    try gl.loadExtensions(proc, glGetProcAddress);

from zgl.

MasterQ32 avatar MasterQ32 commented on May 15, 2024

you can just use void for the context parameter:

fn glGetProcAddress(_: void, proc: [:0]const u8) ?*const anyopaque {
    return sdl.c.SDL_GL_GetProcAddress(proc.ptr);
}
try gl.loadExtensions({}, glGetProcAddress);

from zgl.

jblumie avatar jblumie commented on May 15, 2024

I think it would be helpful to explain what the function does and maybe document it in the SDL.zig repo?

from zgl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.