1
0
Fork 0

Initial commit

This commit is contained in:
Gregory Eremin 2015-09-28 20:46:34 +03:00
commit 73b0f932ea
No known key found for this signature in database
GPG Key ID: 5EFA427EEC26E86C
3 changed files with 32 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
breakout

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
CC=clang++
all: build run
build:
$(CC) -lSDL2 main.cpp -o breakout
run:
./breakout

22
main.cpp Normal file
View File

@ -0,0 +1,22 @@
#include <iostream>
#include <unistd.h>
#include "SDL2/SDL.h"
int main(int argc, char const *argv[])
{
if (SDL_Init(SDL_INIT_VIDEO) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}
SDL_Window *win = SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
if (win == nullptr) {
std::cout << "SDL_CreateWindow Error: " << SDL_GetError() << std::endl;
SDL_Quit();
return 1;
}
usleep(10000000);
return 0;
}