Ejemplo n.º 1
0
	void DebugCLI::list(const char* line)
	{
		int currentLine = (core->callStack) ? core->callStack->linenum() : 0;
		int linenum = (line) ? atoi(line) : currentLine;
		displayLines(linenum, 10);
	}
Ejemplo n.º 2
0
	void DebugCLI::printIP()
	{
		int line = (core->callStack) ? core->callStack->linenum() : 0;
		displayLines(line, 1);
	}
Ejemplo n.º 3
0
void TriangleWindow::render()
{

    glClear(GL_COLOR_BUFFER_BIT);

    GLfloat LightAmbient[] = { 0.6f, 0.6f, 0.6f, 1.0f };
    GLfloat LightAmbientSummer[] = { 0.6f, 0.6f, 0.3f, 1.0f };
    GLfloat LightDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
    GLfloat LightDiffuseSummer[] = { 0.8f, 0.8f, 0.8f, 1.0f };
    GLfloat LightPosition[] = { 0.4f, 0.4f, 0.4f, 1.0f };
    glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
    glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);
    glLightfv(GL_LIGHT1, GL_POSITION, LightPosition);

    if(allSeasons[currentSeason] == "SUMMER")
    {
        glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbientSummer);
        glLightfv(GL_LIGHT1, GL_AMBIENT, LightDiffuseSummer);
    }

    glEnable( GL_LIGHTING );
    glEnable(GL_LIGHT1);

    glEnable(GL_COLOR_MATERIAL);

    glLoadIdentity();
    glScalef(c->ss,c->ss,c->ss);

    glRotatef(c->rotX,1.0f,0.0f,0.0f);
    if(c->anim == 0.0f)
    {
        glRotatef(c->rotY,0.0f,0.0f,1.0f);
    }
    else
    {
        glRotatef(c->anim,0.0f,0.0f,1.0f);
        if(master)
            c->anim +=0.05f;
    }

    switch(c->etat)
    {
    case 0:
        displayTrianglesTexture();
        if(allSeasons[currentSeason] == "WINTER")
            for(int i = 0; i < nbTree; i++)
                drawModel(winterTree, 0.05, posTrees[i], QColor(255, 255, 255));
        else if(allSeasons[currentSeason] == "SPRING")
            for(int i = 0; i < nbTree; i++)
                drawModel(springTree, 0.05, posTrees[i], QColor(0, 255, 0));
        else if(allSeasons[currentSeason] == "SUMMER")
            for(int i = 0; i < nbTree; i++)
                drawModel(summerTree, 0.05, posTrees[i], QColor(0, 255, 0));
        else if(allSeasons[currentSeason] == "AUTUMN")
            for(int i = 0; i < nbTree; i++)
                drawModel(autumnTree, 0.05, posTrees[i], QColor(0, 255, 0));
        break;
    case 1:
        displayLines();
        break;
    case 2:
        displayPoints();
        break;
    case 3:
        displayTrianglesC();
        break;
    case 4:
        displayTrianglesTexture();
        break;
    case 5:
        displayTriangles();
        displayLines();
        break;
    default:
        displayPoints();
        break;
    }

    drawParticules();
    Point centre;
    centre.x = -0.6;
    centre.y = -0.4;
    centre.z = 0.6;
    glColor3f(1, 1, 0);
    if(allSeasons[currentSeason] == "SUMMER")
        facettisationSphere(0.1, 30, 30, centre);
    ++m_frame;
}