-
Notifications
You must be signed in to change notification settings - Fork 0
Home
GLOW is an object wrapper library for OpenGL. The OpenGL API is very powerful, but it's a pain to use, so many functions, global state, and even though there are things like OpenGL objects, the API is not object-oriented at all. The goal of GLOW is to add a thin layer on top of OpenGL to simplify the usage of its APT in an object-oriented manner. However, the goal is not to add an abstraction layer that hides everything (e.g. like OSG does) and robs the user of control. All the OpenGL objects (e.g. textures, buffers, etc.) can be found as real objects in GLOW. Methods are usually named after their OpenGL function counterparts, and the parameters are the same. E.G. glMapBuffer becomes Buffer::map. Sometimes a convenience interface with less parameters is supported as well, but the raw OpenGL versions are always there. GLOW does not try to restrict the power of OpenGL but tries to enhance the experience, by encapsulating the boring trivial tasks without trying to patronize you. It is also possible to intermix GLOW commands and direct OpenGL calls without any trouble.
Let's have a quick look at some code snippets to get a feel of what GLOW does.
glow::Texture* texture = new glow::Texture(GL_TEXTURE_2D);
texture->setParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);
texture->setParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR);
unsigned char* data = ...
texture->image2D(0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glow::Program* program = new glow::Program();
program->attach(
glow::Shader::fromFile(GL_VERTEX_SHADER, "myshader.vert"),
glow::Shader::fromFile(GL_FRAGMENT_SHADER, "myshader.frag")
);
program->addUniform(new glow::Uniform<glm::vec2>(glm::vec2(1.0, 2.0)));
git clone https://github.com/hpicgs/glow.git
cd glow
mkdir build
cd build
cmake .. -DOPTION_BUILD_EXAMPLES=On
make
make install