Beispiel #1
0
void desenha_balcao(float size){
	glPushMatrix();
	glScalef(size,size,size); 
	balcao();
	glPopMatrix();
}
int main(int argc, char **argv) {
    
    // inicializaçao
	dragging = false;
	dragx = 0; dragy = 0;
	camx = 1;
	camy = 5;
	
	glutInit(&argc, argv);
	ilInit();
	
	glutInitDisplayMode(GLUT_DEPTH|GLUT_DOUBLE|GLUT_RGBA);
	glutInitWindowPosition(0,100);
	glutInitWindowSize(1280,800);
	glutCreateWindow("Rock Bar UM");
    
    // registo de funçoes
	glutDisplayFunc(renderScene);
	glutIdleFunc(renderScene);
	glutReshapeFunc(changeSize);
    
    // por aqui registo da funções do teclado e rato
    glutIgnoreKeyRepeat(1);
	glutKeyboardFunc(processNormalKeys);
	glutSpecialFunc(pressKeySpecial);
	glutSpecialUpFunc(releaseKeySpecial);
	glutKeyboardUpFunc(releaseKeyNormal);
    
    // por aqui a criaçao do menu    
    
	
    glewInit();
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_CULL_FACE);
    glEnable(GL_TEXTURE_2D);
    glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_NORMAL_ARRAY);
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    
	//Texturas
	genTextureMadeira();
    genTextureMadeira2();
	genTextureMesa();
	genTextureMetal();
	genTextureVidro();
    genTextureChao();
    genTextureParede();
    genTextureTeto();
    genPoster1();
    genPoster2();
    genPoster3();
    genPoster4();
    genPoster5();
    genPoster6();
    genTextureBook();
    genPoster7();
    genSink();
    
    //Objectos
    mesa();
	cadeira();
	candeeirodemesa();
	candeeirodetecto();
	candeeirodeparede();
	mesalta();
	cadeiralta();
	cup();
	copoalto();
    chao();
    paredes();
    palco();
    balcao();
    armario();
    posters();
    bookshelf();
    
    
    // entrar no ciclo do GLUT
	glutMainLoop();
	
	return 1;
}