/** Sample starter gl test program 
 modified from Rajnish-Singh's example code [ref.1]
**/

/** COMPILE NOTES
1. may require additional graphics library install to compile:
    run: 
 sudo apt-get install libc6-dev
 sudo apt-get install freeglut3-dev

2. link to glut when compiling:

 gcc hello-gl.c  -lglut -lGL

**/

/** FURTHER NOTES AND READING:
 http://openglut.sourceforge.net/
 http://opensourceforu.com/2013/04/graphics-programming-in-linux/   [ref.1]
 http://askubuntu.com/questions/525051/how-do-i-use-graphics-h-in-ubuntu

**/


//include<stdlib.h>

#include<GL/glut.h>
#include<GL/gl.h>

void drawChar(char c, float x, float y)
{   glRasterPos3f(x,y,0.5);
    glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, c);
}

void display() {
    glClearColor(.1,.1,.1,0.5);
    glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
    glColor3f(0.5,0.5,.99);
    glRectf(.50,.50,.19,.255);
    glColor3f(0.15,0.95,.09);
    drawChar('Q',.3,.3);
    drawChar('P',-.41,-.99);
    glFlush();
}

void main(int argc, char**argv)
{
    glutInit(&argc, argv);
    glutInitWindowPosition(100,100);
    glutInitWindowSize(800,800);
    glutCreateWindow("Hello World");

    glutDisplayFunc(display);

    glutMainLoop();
}
