Initial commit
This commit is contained in:
		
						commit
						73b0f932ea
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | breakout | ||||||
							
								
								
									
										9
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | |||||||
|  | CC=clang++ | ||||||
|  | 
 | ||||||
|  | all: build run | ||||||
|  | 
 | ||||||
|  | build: | ||||||
|  | 	$(CC) -lSDL2 main.cpp -o breakout | ||||||
|  | 
 | ||||||
|  | run: | ||||||
|  | 	./breakout | ||||||
							
								
								
									
										22
									
								
								main.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								main.cpp
									
									
									
									
									
										Normal 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; | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user