The OpenGL 4.6 Rendering Kernel in Ada 2012
Switch branches/tags
Nothing to show
Clone or download
onox Remove useless "use type" clause
Signed-off-by: onox <denkpadje@gmail.com>
Latest commit d1284b9 Sep 17, 2018

README.md

License

Orka

Orka is the OpenGL 4.6 Rendering Kernel in Ada. It is written in Ada 2012 and provides an object-oriented API for modern OpenGL. Orka makes it easy to construct OpenGL programs and meshes and to use them in a scene tree. Orka and the OpenGL bindings require and use OpenGL 4.5's Direct State Access (DSA) extension.

Orka builds upon and provides thick bindings for OpenGL 4.6. These bindings are based on the original OpenGLAda bindings. Bindings for the fixed function functionality have been removed and bindings for various extensions of OpenGL 4.x have been added.

Additionally, it provides bindings for GLFW 3.x. This is a library for creating windows with an OpenGL context on them. It also provides functionality for capturing user input on keyboard, mouse and joystick. Having a window with an OpenGL context is the prerequisite for using any OpenGL functionality.

Orka is supported on Linux and Windows. Support for OS X has been removed due to its very outdated OpenGL drivers (most of the required OpenGL 4.x extensions have not been implemented in their drivers).

Features

  • Thick OpenGL 4.6 bindings
  • Thick GLFW 3 bindings
  • Various x86 SIMD extensions like SSE, SSE2, SSE3, SSE4.1, AVX, and F16C
  • Easy construction of shader programs and meshes
  • Transforms and scene tree (makes use of the x86 SIMD extensions)
  • Game loop
  • Camera's
  • glTF 2.0 loader (uses MDI)
  • KTX loader and writer

Build status

Linux Windows
GNAT GPL 2017 failing failing
GNAT CE 2018 unknown unknown
GNAT FSF 7.3 passing
GNAT FSF 8.2 passing

Dependencies

In order to build Orka you need to have:

  • A GNAT Ada 2012 compiler with GPRBuild (Either GNAT FSF from your Linux distribution or GNAT CE)

  • json-ada

  • OpenGL 4.0 core profile and the following extensions:

    Extension OpenGL Reason
    ARB_shader_draw_parameters 4.6 glTF
    ARB_direct_state_access 4.5
    ARB_clip_control 4.5 Reversed Z
    ARB_buffer_storage 4.4
    KHR_debug 4.3 Debugging
    ARB_multi_draw_indirect 4.3 glTF
    ARB_shader_storage_buffer_object 4.3 glTF
    ARB_program_interface_query 4.3 Subroutines
    ARB_vertex_attrib_binding 4.3
    ARB_texture_storage_multisample 4.3 Textures
    ARB_texture_storage 4.2 Textures
    ARB_separate_shader_objects 4.1
  • An x86-64 CPU with the AVX and F16C extensions

Recommended dependencies:

  • GLFW 3 for the GLFW bindings

Optional dependencies:

  • Ahven 2 if you want to build and run the unit tests

Installing dependencies on Ubuntu 18.04 LTS

Install the dependencies using apt:

$ sudo apt install gnat-7 gprbuild libahven6-dev
$ sudo apt install libglfw3 libglfw3-dev libegl1-mesa-dev

Compile and install json-ada.

Installing dependencies on Arch Linux

Install the dependencies using pacman and makepkg:

$ sudo pacman -S gcc-ada glfw-x11

You also need to compile and install GPRBuild:

$ sudo pacman -S --needed base-devel
$ git clone https://aur.archlinux.org/gprbuild-bootstrap.git
$ git clone https://aur.archlinux.org/xmlada.git
$ git clone https://aur.archlinux.org/gprbuild.git

Go to each folder (gprbuild-bootstrap, then xmlada, then gprbuild), inspect the content of the files and then execute makepkg -si.

Compile and install json-ada.

Compilation

A Makefile is provided to build the source code, examples, and tools. Use make to build the source code:

$ MODE=release make

You can override CFLAGS if desired. The Makefile determines which system-dependent API (EGL, GLX, or WGL) to use for fetching OpenGL function pointers. Adjust the Makefile if necessary.

If you want to check after each call to OpenGL whether an error flag was set and raise a corresponding exception, then use the development mode:

$ MODE=development make

The default mode is development. Both release and development enable general optimizations. To enable OpenGL exceptions, disable optimizations, and include debugging symbols, use the debug mode. See the following table:

Release Development Debug
Optimizations Yes Yes No
Assertions No Yes Yes
OpenGL exceptions No Yes Yes
Debugging symbols No No Yes

Tools

The project provides tools to view glTF models, KTX textures, and to display the OpenGL version and list the available extensions.

$ make tools

You can execute them in the bin directory. Some tools load shader files from the source directory by using relative paths, so they only work with bin as the current directory.

Examples

The project contains some examples that demonstrate the basic usage of the library. Build the example programs as follows:

$ make examples

You can execute them in the bin directory. Some examples load shader files from the source directory by using relative paths, so they only work with bin as the current directory.

Tests

The project contains a set of unit tests. Use make test to build the unit tests:

$ make test

After having build the tests, run the unit tests:

$ make run_unit_tests

Installation

After having compiled the source code, the library can be installed by executing:

$ make PREFIX=/usr install

Change PREFIX to the preferred destination folder.

Using Orka in your project

Specify the dependency in your *.gpr project file:

with "orka-glfw";

If you do not want to use GLFW, refer to orka instead.

License

The OpenGL and GLFW bindings and Orka are distributed under the terms of the Apache License 2.0.