All Projects → mackron → Glbind

mackron / Glbind

Single file OpenGL API loader.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Glbind

Vkbind
Single file Vulkan API loader.
Stars: ✭ 110 (+378.26%)
Mutual labels:  public-domain, win32, binding, loader
Mgs Machinery
Unity plugin for binding machinery joint in scene.
Stars: ✭ 164 (+613.04%)
Mutual labels:  binding, loader
Ava
A tiny unlicensed 3D game engine in C; with C++ and Lua interfaces. Written in 32 random ̷d̷a̷y̷s̷ m̷o̷n̷t̷h̷s̷ years.
Stars: ✭ 287 (+1147.83%)
Mutual labels:  opengl, public-domain
Runpe In Memory
Run a Exe File (PE Module) in memory (like an Application Loader)
Stars: ✭ 249 (+982.61%)
Mutual labels:  win32, loader
Raylib Lua
A simple and easy-to-use Lua library to enjoy videogames programming
Stars: ✭ 80 (+247.83%)
Mutual labels:  opengl, binding
Pangolin
Python binding of 3D visualization library Pangolin
Stars: ✭ 157 (+582.61%)
Mutual labels:  opengl, binding
Flextgl
OpenGL and Vulkan header and loader generator.
Stars: ✭ 180 (+682.61%)
Mutual labels:  opengl, loader
luacc
Lua Code Combine
Stars: ✭ 36 (+56.52%)
Mutual labels:  binding, loader
Tinygizmo
📐 An immediate mode 3D gimzo (translation, rotation, scale for scene editing) in ~1200 LoC
Stars: ✭ 321 (+1295.65%)
Mutual labels:  opengl, public-domain
Bonzomatic
Live shader coding tool and Shader Showdown workhorse
Stars: ✭ 829 (+3504.35%)
Mutual labels:  opengl
Gleri
Network protocol, service, and API for using OpenGL remotely.
Stars: ✭ 16 (-30.43%)
Mutual labels:  opengl
Esl
enterprise standard loader
Stars: ✭ 821 (+3469.57%)
Mutual labels:  loader
Opengl Sdl Tutorial
A tutorial for using the modern shader pipeline of OpenGL with SDL 2 in Haskell
Stars: ✭ 6 (-73.91%)
Mutual labels:  opengl
Fpv vr
deprecated. Check out fpv_vr_2018
Stars: ✭ 17 (-26.09%)
Mutual labels:  opengl
Sfml
Simple and Fast Multimedia Library
Stars: ✭ 7,316 (+31708.7%)
Mutual labels:  opengl
Nau
Nau - OpenGL + Optix 3D Engine
Stars: ✭ 18 (-21.74%)
Mutual labels:  opengl
Asyncrat C Sharp
Open-Source Remote Administration Tool For Windows C# (RAT)
Stars: ✭ 819 (+3460.87%)
Mutual labels:  loader
Android Opengl Canvas
An Android library that provides views using openGL canvas to draw things on SurfaceView or TextureView.
Stars: ✭ 815 (+3443.48%)
Mutual labels:  opengl
Swiftyform
iOS framework for creating forms
Stars: ✭ 907 (+3843.48%)
Mutual labels:  binding
Fortran Sdl2
Fortran 2008 interface bindings to SDL 2.0
Stars: ✭ 18 (-21.74%)
Mutual labels:  opengl

A single file OpenGL header and API loader.

discord twitter

glbind includes a full implementation of the OpenGL headers (auto-generated from the OpenGL spec) so there's no need for the offical headers or SDK. Unlike the official headers, the platform-specific sections are all contained within the same file.

Usage

glbind is a single file library with no dependencies. There's no need to link to any libraries, nor do you need to include any other headers. Everything you need is included in glbind.h.

#define GLBIND_IMPLEMENTATION
#include "glbind.h"

int main()
{
    GLenum result = glbInit(NULL, NULL);
    if (result != GL_NO_ERROR) {
        printf("Failed to initialize glbind.");
        return -1;
    }
    
    ...
    
    glClearColor(0, 0, 0, 0);
    glClear(GL_COLOR_BUFFER_BIT);

    ...

    glbUninit();
    return 0;
}

The example above binds everything to global scope and uses default settings for the internal rendering context. You can also initialize glbind like the code below.

GLBapi gl;
GLBconfig config = glbConfigInit();
config.singleBuffered = GL_TRUE;    /* Don't use double-buffering on the internal rendering context. */
GLenum result = glbInit(&gl, &config);
if (result != GL_NO_ERROR) {
    ... error initializing glbind ...
}

#if defined(GLBIND_WGL)
HGLRC hRC = glbGetRC();
... do something with hRC ...
#endif

#if defined(GLBIND_GLX)
GLXContext rc = glbGetRC();
... do something with rc ...
#endif

/* Draw something using local function pointers in the "gl" object instead of global scope. */
gl.glClearColor(0, 0, 0, 0);
gl.glClear(GL_COLOR_BUFFER_BIT);

Since OpenGL requires a rendering context in order to retrieve function pointers, it makes sense to give the client access to it so they can avoid wasting time and memory creating their own rendering context unnecessarily. Therefore, glbind allows you to configure the internal rendering context and retrieve a handle to it so the application can make use of it.

You can also initialize a GLBapi object against the current context (previously set with wglMakeCurrent or glXMakeCurrent) using glbInitContextAPI() or glbInitCurrentContextAPI(). Note, however, that before calling these functions you must have previously called glbInit(). These also do not automatically bind anything to global scope.

You can explicitly bind the function pointers in a GLBapi object to global scope by using glbBindAPI().

License

Public domain or MIT-0 (No Attribution). Choose whichever you prefer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].