• Stars
    star
    410
  • Rank 105,468 (Top 3 %)
  • Language
    C
  • License
    Boost Software Li...
  • Created over 12 years ago
  • Updated 9 months ago

Reviews

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

Repository Details

Object-oriented C++ wrapper for OpenGL.

OOGL

OOGL (Object-oriented OpenGL) is a C++ library that wraps the functionality of the OpenGL API in a more object-oriented package. It additionally includes various classes and functions for 3D math, loading models and textures and creating a window and OpenGL context.

Quick start

To start using this library, all you need is Windows or a Linux distro and a working OpenGL driver that supports at the least OpenGL 3.2. Any libraries that OOGL depends on are included in the source, so building is as simple as

git clone git://github.com/Overv/OOGL.git
cd OOGL
make

or pressing F7 after loading the project in Visual Studio on Windows. To find out how to get started, have a look at the wiki.

Sample

To get an idea of what this library is like using in practice, have a look at the simple example below.

#include <GL/OOGL.hpp>
	 
int main()
{
	GL::Window window(800, 600, "OpenGL Window", GL::WindowStyle::Close);
	GL::Context& gl = window.GetContext();

	GL::Shader vert(GL::ShaderType::Vertex, "#version 150\nin vec2 position; void main() { gl_Position = vec4(position, 0.0, 1.0); }");
	GL::Shader frag(GL::ShaderType::Fragment, "#version 150\nout vec4 outColor; void main() { outColor = vec4(1.0, 0.0, 0.0, 1.0); }");
	GL::Program program(vert, frag);

	float vertices[] = {
		-0.5f,  0.5f,
		 0.5f,  0.5f,
		 0.5f, -0.5f
	};
	GL::VertexBuffer vbo(vertices, sizeof(vertices), GL::BufferUsage::StaticDraw);
		
	GL::VertexArray vao;
	vao.BindAttribute(program.GetAttribute("position"), vbo, GL::Type::Float, 2, 0, 0);

	GL::Event ev;
	while (window.IsOpen())
	{
		while (window.GetEvent(ev));

		gl.Clear();

		gl.DrawArrays(vao, GL::Primitive::Triangle, 0, 3);

		window.Present();
	}

	return 0;
}

The sample above makes use of a lot of the abstraction OOGL offers, but it is always possible to fall back to the raw OpenGL calls.

License

Copyright (C) 2012 Alexander Overvoorde

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This project is licensed under the Boost software license, of which the terms are outlined above.

More Repositories

1

outrun

Execute a local command using the processing power of another Linux machine.
Python
3,118
star
2

VulkanTutorial

Tutorial for the Vulkan graphics and compute API
C++
3,095
star
3

vramfs

VRAM based file system for Linux
C++
1,249
star
4

openstreetmap-tile-server

Docker file for a minimal effort OpenStreetMap tile server
Shell
1,220
star
5

Open.GL

The source code and content of Open.GL.
PHP
1,066
star
6

MineAssemble

A tiny bootable Minecraft clone written partly in x86 assembly
Assembly
1,036
star
7

WebCraft

Minecraft clone written in Javascript.
JavaScript
385
star
8

SteamWebAPI

Library for C# giving access to the functionality of the Steam Web API.
C#
173
star
9

MantleHelloTriangle

An implementation of Hello Triangle using the Mantle API on Windows
C
91
star
10

TheWitnessSolver

Solver for The Witness puzzles
JavaScript
73
star
11

JSGL

A software implementation of OpenGL 1.1 for Javascript.
JavaScript
70
star
12

ColorScatterPlot

Visualization of colors in an image through a 3D scatterplot
HTML
60
star
13

bf

Brainfuck interpreter in Rust
Rust
34
star
14

lambda

Compile anonymous functions based on C# lambda expressions at runtime.
C
25
star
15

raycraft

Minecraft clone using ray tracing for rendering.
C++
17
star
16

TrayLightControl

Windows tray application for controlling Milight/LimitlessLED LED lamps (currently bridge v5 only!)
C#
15
star
17

gitlabfs

Mount all projects in a company's GitLab instance as a file system.
Python
15
star
18

Raytracer

Very basic raytracer to experiment with
C++
11
star
19

pqpp

Simple PostgreSQL bindings for modern C++
C++
11
star
20

BFC

Standalone brainfuck compiler
Python
5
star
21

rest.d

A lightweight web framework for RESTful web applications written in D
D
5
star
22

BoggleSaga

A Java implementation of the Boggle game.
Java
3
star
23

CalculateExactly

University assignment about implementing arbitrary precision arithmetic in Java.
Java
2
star