Multisampling – Hacking FreeGLUT’s default sample count

Both FreeGLUT and GLUT allow us to define an OpenGL context with multisampling. However the number of samples is fixed (4) and I’ve not found a way to change it using the API.

In here we’re going to see how to hack FreeGLUT so that we can change the default number of samples. This can be achieved either by changing the default value, or by adding a new function to set this value.

Note: This hack should be used only for testing purposes, not for redistribution, as FreeGLUT has a large base of users which already have the official version installed.

Read more

OpenGL Framebuffer Objects Tutorial

OpenGL renders to framebuffers. By default OpenGL renders to screen, the default framebuffer that commonly contains a color and a depth buffer. This is great for many purposes where a pipeline consists of a single pass, a pass being a sequence of shaders. For instance a simple pass can have only a vertex and a … Read more

Update on GLSL Core Tutorial

The Lighthouse3D GLSL Core Tutorial has been updated with a few sections, namely how to check the result of the compilation and linking operations, freeing up resources, and how do shaders communicate between themselves on modern OpenGL. The shader interfaces are presented and discussed, with examples and a comparison between the several mechanisms OpenGL provides.

OpenGL Insights

 Patrick Cozzy, Christophe Riccio (eds) Since I’m one of the authors of a couple of chapters in this book I’ll refrain from commenting on it. Check out the companion site, it is full of information, includes 5 sample chapters and all the companion source code. More information about this title at Amazon.com or Amazon.co.uk

Working with Core OpenGL in WX Wigets

I’ve been working for some time with wxWidgets. The only thing I’ve missed, regarding OpenGL, is the ability to define my own OpenGL context, in particular Core profile and Debug contexts.

To be able to set a context we, or the toolkit we’re using, must use the wglCreateContextAttribsARB function, as defined in the WGL_ARB_create_context extension. As it happens, wxWidgets uses wglCreateContext, hence no OpenGL context can be explicitly defined using the provided source code for the current release (2.9.4).

As OpenGL context setting is not yet in the roadmap for future releases of wxWidgets, nor is it in its Todo List, I’m sharing a solution for this issue.

The solution is for the Windows platform, but other platforms should be as easy to change as well.

Note: I make no claim regarding the quality of the solution, it worked for me, and that’s all I claim. If anyone knows of a better way of doing this comments are most welcome, as they may prove useful for other readers (and me as well 🙂 ).

Read more

Setting up Dev C++ for OpenGL

Bloodshed Dev-C++ is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as it’s compiler. Dev-C++ can also be used in combination with Cygwin or any other GCC based compiler. Here is a short tutorial that was pointed to me to setup Dev C++ … Read more

GLSL Core Tutorial

The updated version of GLSL tutorial. Only the core version will be dealt in this tutorial. The tutorial is, and will be in the near future, in construction. I don’t plan to close it, at least in the near future, unless a new version of OpenGL changes everything again. I’ll be adding content from time … Read more

VSMathLib update

VSMathLib, a part of the Very Simple Libraries framework, has suffered a minor update. The modelview matrix has been split into two matrices: model and view. The modelview matrix is still available, but now it is a computed matrix. The programmer should use the two individual matrices, model and view, and the lib will compute … Read more

AMD Bugs – Update for version 12.1

One of the bugs reported in here has been corrected. The uniform buffer data size is now reported correctly. The other two bugs remain, unfortunately. Querying the primitive counter still gives zero, and glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) still crashes the application.