Hi everyone. I have just learnt how to include headers and links to other class files and am trying to rewrite this program I am working on using OpenGL and GLUT but it doesn't seem to be working. Take a lot at the code:
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
usingnamespace std;
#include "drawBackground.h"
void compileScene() {
DrawBackground drawBackgroundObject;
drawBackgroundObject.backgroundLines();
}
int main (int argc, char **argv){
glutInit(&argc, argv); // Initialize GLUT
glutInitDisplayMode (GLUT_SINGLE); // Set up a basic display buffer (only single buffered for now)
glutInitWindowSize (800, 800); // Set the width and height of the window
glutInitWindowPosition (0, 0); // Set the position of the window
glutCreateWindow ("Box Express"); // Set the title for the window
glutDisplayFunc(compileScene); // Tell GLUT to use the method "display" for rendering
glutMainLoop(); // Enter GLUT's main loop
}
(Also a blank window pops up without the lines being drawn)
I don't know what is going wrong. It worked fine when I made a simple program not using OpenGL but not it doesn't seem to be working. Can anyone help? Thanks!