From 73b0f932ea620699d4db7630628b2090126d2dff Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 28 Sep 2015 20:46:34 +0300 Subject: [PATCH] Initial commit --- .gitignore | 1 + Makefile | 9 +++++++++ main.cpp | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..593993d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +breakout diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..59fa52c --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +CC=clang++ + +all: build run + +build: + $(CC) -lSDL2 main.cpp -o breakout + +run: + ./breakout diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..6ccd814 --- /dev/null +++ b/main.cpp @@ -0,0 +1,22 @@ +#include +#include +#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; +}