Created
December 26, 2017 08:21
-
-
Save xreiju/158724b107b0283dbc1169de6915e490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import derelict.sdl2.sdl; | |
void main() | |
{ | |
DerelictSDL2.load(); | |
SDL_Init(SDL_INIT_VIDEO); | |
scope(exit) SDL_Quit(); | |
SDL_Window* window; | |
SDL_Renderer* renderer; | |
SDL_CreateWindowAndRenderer(300, 300, SDL_RENDERER_PRESENTVSYNC, &window, &renderer); | |
bool running = true; | |
while(running) { | |
SDL_Event e; | |
while(SDL_PollEvent(&e)) { | |
if(e.type == SDL_QUIT) { | |
running = false; | |
} | |
//if(e.type == SDL_KEYDOWN) | |
if(e.key.keysym.sym == SDLK_q) running = false; | |
} | |
SDL_SetRenderDrawColor(renderer, 230, 230, 230, 255); | |
SDL_RenderClear(renderer); | |
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); | |
SDL_RenderDrawLine(renderer, 119, 0, 119, 300); | |
SDL_RenderPresent(renderer); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment