Advertisement
Guest User

Derelict-SFML2 basic code

a guest
Dec 26th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.67 KB | None | 0 0
  1. import std.stdio;
  2.  
  3. import derelict.sfml2.system;
  4. import derelict.sfml2.window;
  5. import derelict.sfml2.graphics;
  6.  
  7. void main() {
  8.     DerelictSFML2System.load();
  9.     DerelictSFML2Window.load();
  10.     DerelictSFML2Graphics.load();
  11.    
  12.     sfRenderWindow window;
  13.     window.create(sfVideoMode(200, 200), "SFML works !");
  14.     while (window.isOpen())
  15.     {
  16.         sfEvent event;
  17.         while (window.pollEvent(event))
  18.         {
  19.             if (event.type == sfEvtClosed) {
  20.                 writeln("closed !");
  21.                 window.close();
  22.             }
  23.         }
  24.     }
  25.    
  26.     DerelictSFML2System.unload();
  27.     DerelictSFML2Window.unload();
  28.     DerelictSFML2Graphics.unload();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement