
Enviado em 18/01/2016 - 18:09h
Boa noite...#include <iostream>
using namespace std;
#include <SDL/SDL.h>
int main(int argc, char **argv){
if(SDL_Init(SDL_INIT_EVERYTHING) < 0){
cout << "Error: failed to init SDL!" << endl;
return 1;
}
atexit(SDL_Quit);
SDL_Rect size;
size.x = 320;
size.y = 200;
SDL_Surface *screen;
SDL_Surface *tux;
screen = SDL_SetVideoMode(640, 400, 8, SDL_HWSURFACE);
tux = SDL_LoadBMP("tux.bmp");
if(screen == NULL){
cout << "Error: failed to create window" << endl;
return 1;
}
SDL_WM_SetCaption("Grand Theft Tux 5", NULL);
SDL_BlitSurface(tux, NULL, screen, &size);
SDL_Flip(screen);
bool running = true;
SDL_Event *e = new SDL_Event();
while(running && e->type != SDL_QUIT){
SDL_PollEvent(e);
switch(e->type){
case SDL_KEYDOWN:
switch(e->key.keysym.sym){
case SDLK_UP:
size.y -= 10;
SDL_Flip(screen);
break;
case SDLK_DOWN:
size.y += 10;
SDL_Flip(screen);
break;
case SDLK_LEFT:
size.x -= 10;
SDL_Flip(screen);
break;
case SDLK_RIGHT:
size.x += 10;
SDL_Flip(screen);
break;
}
}
}
return 0;
}
Gentoo binário em 2026: UEFI, LUKS, Btrfs e Systemd
Trabalhando Nativamente com Logs no Linux
Jogando Daikatana (Steam) com Patch 1.3 via Luxtorpeda no Linux
LazyDocker – Interface de Usuário em Tempo Real para o Docker
Servidor vs Computador Convencional
Como administrar uma rede Linux através da ferramenta Webmin
Como escanear portas de um servidor através da ferramenta Nmap e como alterar a porta do SSH.
Marcando e desmarcando pacotes para atualização, instalação e remoção no Debian e agregados
Internet não funciona corretamente no Linux (4)
Após todos esses anos... youtube! (5)
Pendrive do Ubuntu 24.04 travando ao tentar fazer a instalação dual bo... (4)









