#define GL_GLEXT_PROTOTYPES

#include <iostream>
#include "GL/freeglut.h"
#include "GL/gl.h"
#include "GL/glext.h"

using std::cout;
using std::endl;

void renderFunction()
{
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 1.0);
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
    glBegin(GL_POLYGON);
        glVertex2f(-0.5, -0.5);
        glVertex2f(-0.5, 0.5);
        glVertex2f(0.5, 0.5);
        glVertex2f(0.5, -0.5);
    glEnd();
    glFlush();
    GLuint handle;
    for(int i = 0; i < 5; i++)
    {
        glGenBuffers(1, &handle);
        cout << "Buffer Generated: " << handle << endl;
        glDeleteBuffers(1, &handle);
    }
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE);
    glutInitWindowSize(500,500);
    glutInitWindowPosition(100,100);
    glutCreateWindow("Test glDeleteBuffer");
    glutDisplayFunc(renderFunction);
    glutMainLoop();    
    return 0;
}
