An open API service indexing awesome lists of open source software.

https://github.com/nimgl/opengl

Modern OpenGL bindings for Nim
https://github.com/nimgl/opengl

bindings nim nimgl opengl

Last synced: 3 days ago
JSON representation

Modern OpenGL bindings for Nim

Awesome Lists containing this project

README

        

[![docs](https://img.shields.io/badge/docs-passing-4caf50.svg?style=flat-square)](https://nimgl.dev/docs)

# Modern OpenGL Bindings for Nim [![Nimble](https://raw.githubusercontent.com/yglukhov/nimble-tag/master/nimble.png)](https://github.com/nim-lang/nimble)

Separated module from [NimGL](https://nimgl.dev/). In order to mantain small
sized modules to facilitate development and reduce number of required modules.

Some developers do not require the entire bundle of APIs that
[NimGL](https://nimgl.dev/) offer, and so, prefere to only download the required
modules.

## Installation

### Nimble download

You can install this package through the official package manager of Nim.

```bash
$ nimble install https://github.com/nimgl/opengl.git
```

In order to respect already existing libraries in the package registry, and
because [NimGL](https://nimgl.dev/) already exists in there, this package is
only able to be accesible by direct git url.

### Nimble direct install

```bash
$ git clone --recursive -j8 https://github.com/nimgl/opengl.git
$ cd opengl
$ nimble install
```

### NimGL module

```bash
$ nimble install nimgl
```

You can find more information in the [main repo](https://github.com/nimgl/nimgl).

### Development

It is currently being developed and tested on

* Windows 10
* MacOS Mojave
* Linux Ubuntu 18.10

## Contribute

I'm only one person and I use this library almost daily for school and personal
projects. If you are missing some extension, procedures, bindings or anything
related feel free to PR them or open an Issue with the specification and
if you can some examples to have an idea on how to implement it.
Thank you so much :tada:

### This being a separate module behaves slightly diferently.

Please open all issues in the [main repository](https://github.com/nimgl/nimgl).
The PRs and new feature development will occur in each binding's repo.

## Usage

```nim
import opengl

# Create a context (GLFW recommended)

if glInit():
echo "OpenGL loaded correctly."

glClearColor(0.68f, 1f, 0.34f, 1f)
glClear(GL_COLOR_BUFFER_BIT)

# You can load extensions

loadGL_ARB_gl_spirv()
if glSpecializeShaderARB == nil:
echo "Extension not available"
```

Check out the references and doc in order to understand OpenGL usage.

## License

[MIT License](https://github.com/nimgl/nimgl/blob/master/LICENSE)

NimGL is open source and is under the MIT License, we highly encourage every
developer that uses it to make improvements and fork them here.

## Contributors

Thank you to every contributor that has spent their time improving this library.

[List of all contributors.](https://github.com/nimgl/nimgl/graphs/contributors)