You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree that at least a basic example should be included to help new users since there isn't a ton of projects out there using zgl yet. I managed to brute-force my way to a bit of working code in a few hours. I'm using SDL but the code should be similar with whatever libarary you're using, it just needs a GetProcAddress counterpart:
pubconstc=@cImport({
@cInclude("SDL2/SDL.h");
});
constzgl=@import("zgl");
fngetProcAddressWrapper(comptime_: type, symbolName: [:0]constu8) ?*constanyopaque {
returnc.SDL_GL_GetProcAddress(symbolName);
}
fninit_opengl() {
// Init SDLtryzgl.loadExtensions(void, getProcAddressWrapper);
// Use zgl with zig bindings or C-API bindings
}
This isn't the same exact code I use in my application, but it should get you going with zgl. Feel free to reply if something is not working correctly.
currently this repo is not clear nor informative on how to include and use it.
Things that I think should be specified:
For example on point 1, I'm getting segment fault because probably the function pointers are undefined (point to 0).
The text was updated successfully, but these errors were encountered: