Hello all I started toying around with some tutorials using opengl and glutt but i encountered a problem using MVC++ IDE. The problem is that it says "initrendering" identifier not found and drawscene says undeclared identifier.
the code is
#include <iostream>
#include <stdlib.h>
#include <StdAfx.h>
#include <GL/glut.h>
using namespace std;
void handleKeypress(unsigned char key,
int x, int y) {
switch (key){
case 27: // ESC KEY
exit(0);
}
}
void initRenderind() {
glEnable(GL_DEPTH_TEST);
}
void handleResize(int w, int h) {
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0,
(double)w/ (double)h,
1.0,
200.0);
}
void drawscene() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glBegin(GL_QUADS);
glVertex3f(-0.7f,-1.5f,-5.0f);
glVertex3f(0.7f,1.5f,5.0f);
glVertex3f(0.4f,-0.5f,-5.0f);
glVertex3f(-0.4f,-0.5f,-5.0f);
glEnd();
glutSwapBuffers();
}
int main(int argc, char** argv) {
//initialize GLUT
glutInit (&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(400,400);
glutCreateWindow("Quads");
initRendering();
glutDisplayFunc(drawScene);
glutKeyboardFunc(handleKeypress);
glutReshapeFunc(handleResize);
glutMainLoop();
return 0;//ill never reach this line
}
any help will be greatly apreciated