GithubHelp home page GithubHelp logo

derelictgl3's Introduction

DerelictGL3

A dynamic binding to OpenGL for the D Programming Language.

Please see the sections on Compiling and Linking in the Derelict documentation for information on how to build DerelictGL3. DerelictGL3 differs from the other Derelict packages in that there is a two-step load process which is used to mask some platform differences in how the graphics drivers are managed. Everything in the section The Derelict Loader in the Derelict documentation still applies. The difference is that DerelictGL3.load(), unlike its behavior in the other bindings, does not load the entire library; it only loads the functions for OpenGL versions 1.0 and 1.1. Once a context has been created, DerelictGL3.reload() should be called. This will load all available versions 1.2+ and all supported ARB and EXT extensions. reload should also be called any time the OpenGL context is switched. The load method can be called before or after creating a context, but should always be called before the first call to reload and does not need to be called on a context switch.

By default, the DerelictGL3 loader will only load core OpenGL functions and will not load any of the deprecated API or extensions. Here's some sample code.

// For core API functions.
import derelict.opengl;

void main() {
    // Load OpenGL versions 1.0 and 1.1.
    DerelictGL3.load();

    // Create an OpenGL context with another library (like SDL 2 or GLFW 3)
    ...

    // Load versions 1.2+ and all supported ARB and EXT extensions.
    DerelictGL3.reload();

    // Now OpenGL functions can be called.
    ...
}

DerelictGL3 supports a compile-time configurable API. It can be used to restrict compiled OpenGL symbols to a specific version. For example, the above snippet compiles all supported core OpenGL symbols up to version 4.5 into the binary and the loader will attempt to load them all, but with the compile-time configuration options can be restricted to OpenGL 2.1, or 3.3, or any other supported version. It is also the only way to make deprecated symbols and extensions available. See the DerelictGL3 documentation for details.

derelictgl3's People

Contributors

mdparker avatar mathstuf avatar bazhenovc avatar chris0210 avatar bbasile avatar brad-anderson avatar coldencullen avatar aposteriorist avatar tofuninja avatar ryan-scott-dev avatar s-ludwig avatar p0nce avatar

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.