Tags » OpenGL

Pitfalls and Errors When Using AVAssetWriter to Save the OpenGL Backbuffer Into a Video.

For my current game I need to record the OpenGL back buffer of GLKView into a video using AVAssetWriter.

I will not go over all the code to do this(which is not that much). 486 more words

Opengl Glut Walking Scene (FPS like)

As I’m currently on vacation i thought why not write a small programm in Opengl and Glut to walk around a little szene, just to see how this stuff works. 1,125 more words


OpenGL - Recipes

1. Image Rendering
// Create a device context.
HDC hDC = CreateCompatibleDC(0);

// Create an empty bitmap
memset(&oInfo, 0, sizeof(oInfo));
const int nColorBits = 24;
oInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
oInfo.bmiHeader.biWidth = nWidth;
oInfo.bmiHeader.biHeight = nHeight;
oInfo.bmiHeader.biPlanes = 1;
oInfo.bmiHeader.biBitCount = nColorBits;
oInfo.bmiHeader.biCompression = BI_RGB;

// Create a device independent bitmap object
GLubyte * pvBits = 0; // bitmap buffer
HBITMAP hBitmap = ::CreateDIBSection(hDC, &oInfo, DIB_RGB_COLORS, (void**)&pvBits, NULL, 0);

// Select the bitmap object into the current device context 
HGDIOBJ hOldBitmap = SelectObject(hDC, hBitmap);

// Set drawing format for the current device context
    sizeof(PIXELFORMATDESCRIPTOR),  // size info
    1,                              // version number
    PFD_TYPE_RGBA,      // RGBA type
    nColorBits,         // color depth
    8, 0, 8, 0, 8, 0,   // ignore color bits
    0,                  // no alpha buffer
    0,                  // shift bit ignored
    0,                  // no accumulation buffer
    0, 0, 0, 0,         // accumulation bits ignored
    32,                 // 32-bit z-buffer
    0,                  // no stencil buffer
    0,                  // no auxiliary buffer
    PFD_MAIN_PLANE,     // main layer
    0,                  // reserved
    0, 0, 0             // layer masks ignored
int nPixelFormat = ::ChoosePixelFormat(hDC, &pfd);
::SetPixelFormat(hDC, nPixelFormat, &pfd);

// Create and bind rendering context for the current device context
HGLRC hRC = ::wglCreateContext(hDC);
VERIFY(::wglMakeCurrent(hDC, hRC));

// Draw using OpenGL
::glClearColor(1.0, 1.0, 1.0, 0.0);
... 78 more words

Got Mandelbrot? A Mandelbrot set test pattern for the GStreamer OpenGL Plugins

I wanted to introduce you into the next station in my Mandelbrot world domination tour. Using C and GLSL this Mandelbrot set visualization can be rendered to a video file. 58 more words

GSoC 2014 Final Summary

GSoC has finally come to an end. It was an awesome experience and I would like to thank the amazing vispy developers – Luke, Eric, Almar, Cyrille and Nicolas for their guidance without which this wouldn’t have been possible. 215 more words

Computer Graphics

GameTutorials.com is now free


GameTutorials.com homepage
GameTutorials.com tutorials list
 GameTutorials Youtube channel

GameTutorials.com recently got a major redesign, and with it, relaunched as a free service rather than a $75 one.   52 more words


OpenTK and C#

I’ve dabbled in the past with C++ and OpenGL but always found myself spending more time creating code to support what I wanted to do, rather than actually building it. 97 more words