Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
32
Task/Window-creation/D/window-creation-2.d
Normal file
32
Task/Window-creation/D/window-creation-2.d
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import derelict.sdl.sdl;
|
||||
|
||||
int main(char[][] args)
|
||||
{
|
||||
DerelictSDL.load();
|
||||
|
||||
SDL_Event event;
|
||||
auto done = false;
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
scope(exit) SDL_Quit();
|
||||
|
||||
SDL_SetVideoMode(1024, 768, 0, SDL_OPENGL);
|
||||
SDL_WM_SetCaption("My first Window", "SDL test");
|
||||
|
||||
while (!done)
|
||||
{
|
||||
if (SDL_PollEvent(&event) == 1)
|
||||
{
|
||||
switch (event.type)
|
||||
{
|
||||
case SDL_QUIT:
|
||||
done = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue