main(int argc, char** argv)
{
    glutInit(&argc, argv);
/* need both double buffering and z buffer */

    char *title = "Scott Wilson Park";

    if(argc > 1)
    {
      title = *(argv + 1);
    }

    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowPosition(250,50);
    glutInitWindowSize(600, 600);
    glutCreateWindow(title);
    initDisplayLists();
    init();
    glutDisplayFunc(display);
    glutReshapeFunc(reshape);
    glutIdleFunc(swingAnim);
    glutKeyboardFunc(keyboard);
    	   glEnable(GL_DEPTH_TEST); /* Enable hidden--surface--removal */
    glutMainLoop();
}
예제 #2
0
void Light::setAttenuation(float c, float l, float q)
{
	constAtt = c;
	linAtt = l;
	quadAtt = q;
	initDisplayLists();
}
예제 #3
0
void Light::setSpecular(float r, float g, float b)
{
	specular[0] = r;
	specular[1] = g;
	specular[2] = b;
	initDisplayLists();
}
예제 #4
0
void Light::setDiffuse(float r, float g, float b)
{
	diffuse[0] = r;
	diffuse[1] = g;
	diffuse[2] = b;
	initDisplayLists();
}
예제 #5
0
void Light::setAmbient(float r, float g, float b)
{
	ambient[0] = r;
	ambient[1] = g;
	ambient[2] = b;
	initDisplayLists();
}
예제 #6
0
파일: View.cpp 프로젝트: ggobbe/pacman-3d
// Implémentation classique du pattern singleton
View::View()
{
	model = Model::getInstance();
	glClearColor(0.0,0.0,0.0,0); // Définit la couleur à utiliser lors des appels à glClear(...)

	initDisplayLists(); // initialisation des display lists
}
예제 #7
0
Light::Light(int name)
{
	this->name = name;
	ambient[0]=1.0;
	ambient[1]=1.0;
	ambient[2]=1.0;
	ambient[3]=1.0;
	diffuse[0]=1.0;
	diffuse[1]=1.0;
	diffuse[2]=1.0;
	diffuse[3]=1.0;
	specular[0]=1.0;
	specular[1]=1.0;
	specular[2]=1.0;
	specular[3]=1.0;
	constAtt = 1.0;
	linAtt = 0.0;
	quadAtt = 0.0;
	initDisplayLists();
}
예제 #8
0
파일: tetris.c 프로젝트: vichou/tetris
int main (int argc, char **argv)
{
    glutInit (&argc, argv);
    glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);
    if (isGameMode)
    {
        glutGameModeString ("1024x768:32");
        if (glutGameModeGet (GLUT_GAME_MODE_POSSIBLE))
        glutEnterGameMode ();
        else
        isGameMode = 0;
    }
    if (!isGameMode)
    {
        glutInitWindowSize (1024, 768);
        glutCreateWindow ("tetris");
    }
    initWindow ();
    initDisplayLists ();
    glutMainLoop ();
    return 0;
}