Tag Archives: C++

Loading meshes using Assimp in OpenGL

I have been catching up on OpenGL 4.4 lately and realized that there are few working examples on the newer versions of OpenGL. The following code uses Assimp, GLFW and GLEW to load and render all supported Assimp formats and requires OpenGL 3.0 or above. You will be required to set up an OpenGL context, […]

OpenGL 4.0 wrapper using GLEW and GLFW

So after my post yesterday about the GLSL shader loader, I thought that it might be redundant without the actual wrapper so here we go! GLWrapper.hpp #ifndef GLWRAPPER_HPP #define GLWRAPPER_HPP #define GLFW_DLL #include "GL/glew.h" #include "GL/glfw.h" class GLWrapper { private : int width; int height; char *title; double fps; void (*renderer)(); bool running; public : […]

How to load a GLSL shader in OpenGL using C++

Got asked how to load a GLSL shader today and as I had an OpenGL wrapper containing this code, I thought it would be nice to share it with you. It also includes loading the files as well as debugging info. Enjoy 😉 GLShader.hpp #ifndef GLSHADER_H #define GLSHADER_H #include "GL/glew.h" GLuint LoadShader(const char *vertex_path, const […]

Printing and limiting FPS using GLUT

Here is a very basic example on how to limit and printing the FPS when you are using GLUT. Although GLUT is very outdated (FreeGLUT might still be a viable option though), this will point you in the right way when you are trying to achieve this. The timer function The timer function is what […]

Programming Basics

Just re posting a little rant about programming basics that I thought that you might find interesting. This will give you a basic understanding on what is basic for all programming languages. We will be looking into the purpose of a programming language, what happens under the hood and basic data types. The purpose of […]