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

Recommended Answers

All 2 Replies

Check your spelling of initRendering function.
Also, the drawscene function is spelled with a lower-case s while you try to call it with an upper-case S

thank you very much for you fast reply i checked and yes the initRendering was spelled wrong as drawscene too i changed it but i get the following errors:

1>------ Build started: Project: Triangle, Configuration: Debug Win32 ------
1> Triangle.cpp
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Documents and Settings\Aramis\my documents\visual studio 2010\Projects\Triangle\Debug\Triangle.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

any ideas?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.