• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    C++
  • License
    Boost Software Li...
  • Created over 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Header-only C++17 wrapper for OpenGL 4.6 Core Profile.

GL

Complete C++17 wrapper for OpenGL 4.6 Core Profile.


Dependencies

  • OpenGL
  • GLEW
  • CUDA (optional, for interoperation support)

Building

  • Follow the cmake build process for locating the dependencies.
  • Toggle CUDA_INTEROP_SUPPORT for CUDA interoperation support. Note that the build will ask for the location of Cuda upon enabling this option.

Getting Started

Creating and uploading data to buffers:

#include <gl/all.hpp>

void buffer_example()
{
  gl::buffer buffer;
  
  std::vector<float> vertices(32);
  buffer.set_data(sizeof(float) * vertices.size(), vertices.data());
}

Creating and uploading data to textures:

#include <gl/all.hpp>

void texture_example()
{
  gl::texture_1d texture_1d;
  texture_1d.set_min_filter(GL_LINEAR);
  texture_1d.set_mag_filter(GL_LINEAR);
  texture_1d.set_wrap_s    (GL_CLAMP );
  
  std::array<float, 32> scalars;
  texture_1d.set_storage   (0, GL_RGBA, sizeof(float) * scalars.size());
  texture_1d.set_sub_image (0, 0, scalars.size(), GL_RGBA, GL_FLOAT, scalars.data());
}

Creating shaders and attaching them to programs:

#include <gl/all.hpp>

void shader_program_example()
{
  gl::shader vert_shader(GL_VERTEX_SHADER);
  vert_shader.load_source("vert_example.glsl");

  gl::shader frag_shader(GL_FRAGMENT_SHADER);
  frag_shader.load_source("frag_example.glsl");

  gl::program program;
  program.attach_shader(vert_shader);
  program.attach_shader(frag_shader);
  program.link();
  program.use();
  program.set_uniform(program.uniform_location("example_uniform"), 42);
  program.unuse();
}

Extensions

For adding GLM support to type-inferring uniform variable setters of the shader program, simply #include <gl/auxiliary/glm_uniforms.hpp>.

More Repositories

1

fg

Rendering abstraction which describes a frame as a directed acyclic graph of render tasks and resources.
C++
490
star
2

cmake_templates

Concise CMake templates for creating C++ libraries or executables.
C++
123
star
3

mpi

Header-only C++20 wrapper for MPI 4.0.
C++
39
star
4

acd

Single file utilities for C++.
C++
30
star
5

rational

Implementation of the std::experimental::rational proposal.
C++
9
star
6

ode

Header-only ordinary differential equation solvers in C++20.
C++
8
star
7

uci

Single header implementation of the Universal Chess Interface (UCI) protocol.
C++
7
star
8

vcv_plugin_template

A concise template for creating VCV rack plugins.
Shell
6
star
9

ec

Data-driven entity-component-system built on top of boost mp11.
C++
5
star
10

monte_carlo

Single header Monte Carlo simulator.
C++
4
star
11

hdf

Header-only C++20 wrapper for HDF5. [WIP]
C++
4
star
12

vulkan_sdl

Create a Vulkan surface from an SDL window. Deprecated: SDL now provides identical functionality natively.
C++
4
star
13

magpie

A minimalistic rendering engine based on ImGui and Im3d.
C++
4
star
14

fd

Generic finite differences in C++20.
C++
3
star
15

bm

Single header micro- and macro-benchmarking library.
C++
3
star
16

multi

Standard-like multidimensional arrays and vectors built on top of mdspan.
C++
3
star
17

hid.hpp

Single header C++23 wrapper for libusb/hidapi.
C++
3
star
18

map_reduce

Single header Map-Reduce built on top of Intel TBB.
CMake
3
star
19

ra

Generic resource abstraction for game/rendering engines.
C++
3
star
20

dpa

Distributed particle advector based on TBB and MPI.
C++
2
star
21

mcmc

Header-only library containing generic implementations of common Markov Chain Monte Carlo methods.
C++
2
star
22

ecs

A naive implementation of the entity-component-system model.
C++
2
star
23

di

Display and input abstraction built on top of SDL2 and OpenVR.
C++
2
star
24

pars

Source code of the paper Parallel Particle Advection and Lagrangian Analysis for 3D-PLI Fiber Orientation Maps.
C++
2
star
25

optix_cmake

An unofficial CMakeLists.txt for OptiX that exports the OptiX::OptiX target.
CMake
1
star
26

croupier

A generic poker engine capable of evaluating any variant of poker. Includes default rulesets for Texas and Omaha Hold'em, 5-Card, 7-Card and more. Intended for training poker bots.
C++
1
star
27

dayz_mod_template

A template for creating DayZ Standalone mods.
C++
1
star
28

type_trait_concepts

Concept equivalents of <type_traits>.
C++
1
star
29

csgo_map_templates

Collection of CS:GO map templates.
1
star
30

cs_server

A minimal CS 1.6 server with Metamod, AMX Mod X and Yet Another POD Bot (YAPB).
Batchfile
1
star
31

gh_bf4

Wallhack + aimbot for Battlefield 4.
C++
1
star
32

cs_removed_maps

This repository brings all maps that have been removed from beta 1.0 up until release 1.5 back into 1.6.
1
star
33

astray

A performance-portable geodesic ray tracer. Archived. See https://github.com/vrgrouprwth/astray instead.
C++
1
star
34

concepts.hpp

Concept equivalents of every boolean in <type_traits>.
C++
1
star
35

makina-old

Makina is a research engine focusing on computer graphics and virtual reality. [ARCHIVED]
C++
1
star
36

lorenz

Numerical integration of the Lorenz system in Three.js.
JavaScript
1
star
37

cush

Cuda Spherical Harmonics library.
C++
1
star
38

vcpkg_overlay_ports

Unofficial, useful vcpkg ports.
CMake
1
star
39

d3_template

Template for creating D3.js charts.
HTML
1
star
40

unity_data_binding

A general data and event binding plugin to compensate for the lack of these features in Unity 4.6.
C#
1
star
41

solidity_template

A concise solidity smart contract template.
JavaScript
1
star
42

dayz_server_template

A template for creating DayZ servers which automatically update the app and mods at each restart.
Batchfile
1
star
43

dayz_vanilla_server

A minimal server configuration for DayZ.
Batchfile
1
star
44

eigen

Personal fork of Eigen 3.
C++
1
star
45

tbtivh

Turkiye Bedelsiz Tasit Ithalati Vergi Hesaplayicisi (TBTIVH) / Turkish Private Vehicle Import Tax Calculator (TPVITC).
Python
1
star
46

cs_community_maps

This repository archives community-made maps that are important to the history of Counter-Strike.
1
star
47

r_portable

Portable version of R 4.2.1 for 64-bit Windows systems.
R
1
star
48

csgo_server

A minimalist CS:GO server.
Batchfile
1
star
49

makina-old-example

Makina example project.
C++
1
star
50

continuum_vst3

VST3 plugin simulating the Continuum Fingerboard through split channel pitch bends. Outputs MIDI Polyphonic Expression (MPE) data.
C++
1
star
51

hexagonal_keyboard_vst3

VST3 plugin for visualizing and outputting MIDI from various hexagonal keyboards, including the harmonic table and the Wicki-Hayden layout.
C++
1
star
52

fi

C++11 wrapper for FreeImage 3.17.0.
C++
1
star
53

astrid

A relativistic ray tracing server and end-user application built on Astray. Archived. See https://github.com/vrgrouprwth/astrid instead.
Cuda
1
star
54

makina

Makina C++ libraries.
1
star
55

jupyter_server

A minimal Jupyter notebook installation with Julia, Python and R.
Shell
1
star
56

arp

An arpeggiator VST3 plugin.
C++
1
star