Collection of C++ OpenGL samples and demos
Switch branches/tags
Nothing to show
Clone or download

C++ OpenGL examples and demos

This repository contains sources for assorted OpenGL samples and demos written in C++.

This is a loose collection of OpenGL testing stuff, so no CMake, no cross platform and not much source documentation.

Use at your own risk ;)



SPIR-V shaders

Shows how to load binary SPIR-V Shaders with OpenGL. SPIR-V has initially been introduced as the binary shader format for Vulkan, but is also available on OpenGL via the GL_ARB_gl_spirv extension.

This example loads two basic binary SPIR-V shaders instead of GLSL shaders from text. SPIR-V shaders for OpenGL can be generated using the glslang reference compiler. If you're using Visual Studio, you can use my SPIRV-VSExtension to generate SPIR-V from GLSL directly out of the IDE.

Compute shader particle system

Attraction based compute shader particle system using SSBOs.


Mesh instancing (OpenGL 3.3+) demo. Made to compare against the same Vulkan example.

Ray picking

CPU based ray picking for object selection.

Geometry shader

Very simple geometry shader demo.


Shows how to use EGL for setting up OpenGL ES 2.0 on a windows desktop. Only works for vendors that support EGL on desktop.

Simple STL viewer

A very basic demo for loading and displaying a .stl file.