Ejemplo n.º 1
0
void Tela_Carr_DrawScene() {
  int posicao=(260*((quantidade*100)/NUM_LOAD))/100;

  DrawIMG(logo[1],253,437,posicao,14,260-posicao,0);
  DrawIMG(logo[0],0,0,800,600,0,0);
//    DrawText2(250,250,250,0,0,0,"Carregando: %d",quantidade);
}
Ejemplo n.º 2
0
void DrawIMG_RGBA(Textura *textura, int dstX, int dstY, int width, int height, int srcX, int srcY, unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
  glColor4ub(r, g, b, a);

  DrawIMG(textura, dstX,  dstY, width, height, srcX, srcY);

  glColor4ub(255, 255, 255, 255);
}
Ejemplo n.º 3
0
void ReDraw()
{
    for (int i=0; i<WIDTH; i++)
    {
        for(int j=0; j<HEIGHT; j++)
        {
            if(field[i][j].current==true)
            {
                DrawIMG(dot,(i*10)+2,(j*10)+1);
            }
            else
            {
                DrawIMG(background,i*10,j*10,9,9,i*10,j*10);
            }
        }
    }
    SDL_Flip(screen);
}
Ejemplo n.º 4
0
/* ------------------------------------------- */
void DrawScene(){

 redraw= true;


 DrawIMG(back, 0, 0);
 DrawIMG(batA, xpos1 , ypos1);
 DrawIMG(batB, xpos , ypos );
 DrawIMG(ball, xpos2 , ypos2);
 for(int i=0; i<640; i++)
    DrawPixel(screen, i, VG, 0, 0, 0);
  DrawIMG(digit[Win1], 20 , 10);
  DrawIMG(digit[Win2], 600 , 10);

 SDL_Flip(screen);

 redraw= false;

}
Ejemplo n.º 5
0
void aButton::draw()
{
	DrawIMG(label,screen,x,y);
}
Ejemplo n.º 6
0
int main (int argc, char *argv[])
{
    Uint8* mouse;
    bool start=false;
    bool exitstate=false;
    int clickx,clicky;

    ClearField();

    if(SDL_Init(SDL_INIT_VIDEO)<0)
    {
        printf("Unable to init SDL: %s\n",SDL_GetError());
        exit(1);
    }
    atexit(SDL_Quit);

    SDL_WM_SetCaption("Life game","life");
    screen=SDL_SetVideoMode(640,480,32,SDL_HWSURFACE|SDL_DOUBLEBUF);

    if(screen==NULL)
    {
        printf("unable to set 640x480 video %s\n",SDL_GetError());
        exit(1);
    }
    InitImages();
    DrawIMG(background,0,0);
    while(exitstate==false)
    {
        SDL_Event event;
        while(SDL_PollEvent(&event))
        {
            if(event.type==SDL_QUIT)
            {
                exitstate=true;
            }
            if(event.type==SDL_KEYDOWN)
            {
                if(event.key.keysym.sym=SDLK_ESCAPE)
                {
                    exitstate=true;
                }
            }
            if(event.type==SDL_MOUSEBUTTONUP)
            {
                clickx=event.button.x;
                clicky=event.button.y;
                if(clicky>450 && clickx<320)
                {
                    if(start==false)
                    {
                        start=true;
                    }
                    else
                    {
                        start=false;
                    }
                }
                if(clicky>450 && clickx>320)
                {
                    ClearField();
                    start=false;
                }
                if(clicky<450 && start==false)
                {
                    SetPoint(clickx,clicky);
                }

            }
        }
        if(start==true)
        {
            SDL_Delay(500);
            NextGen();
        }
        ReDraw();


    }
    return 0;
}
Ejemplo n.º 7
0
/* ------------------------------------------- */
void DrawBG(){

 DrawIMG(back, 0, 0);

}
// Draw the movie surface to the main screen at x, y
void CSmpeg::Display()
{
	DrawIMG( movieSurface, screen, X, Y );
}
// Draw the movie surface to the main screen at x, y
void CSmpeg::DisplayAt( int x, int y )
{
	DrawIMG( movieSurface, screen, x, y );
}