I setup my OpenGL environment, and tested the Hello world code to make sure everything is working correctly, and they were until...
I wrote this code:
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <stdlib.h>
#include <iostream>
using namespace std;
//window size and frame rate (60fps)
int width = 600;
int height = 300;
int interval = 1000 / 60;
//Program entry point
int _tmain(int argc, char** argv) {
//initialize openGL (via glut)
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(width, height);
glutCreateWindow("My First Video Game (Mushref)");
//Start the whole thing
glutMainLoop();
return 0;
}
After writing this code, I ran the application and it brought this error:
C:\Program Files (x86)\CodeBlocks\MinGW\lib\libmingw32.a(main.o):main.c:(.text.startup+0xa7)||undefined reference to `WinMain@16'|
According to people and other forums, they said "your app should be a console application to run, try changing that", and I have. But it didn't work either on Console or GUI.
What I am trying to do is: program a simple Pong game.
May you please help?