1
1

init.d 694 B

1234567891011121314151617181920212223242526272829303132333435
  1. module three.init;
  2. import derelict.opengl3.gl3;
  3. import derelict.glfw3.glfw3;
  4. //import derelict.freetype.ft;
  5. import three.glfw.window;
  6. import std.stdio;
  7. import std.conv;
  8. Window initThree() {
  9. DerelictGL3.load();
  10. DerelictGLFW3.load();
  11. //DerelictFT.load();
  12. //~ if(!freeTypeInit()) throw new Exception("FreeType init failed");
  13. if(!glfwInit()) throw new Exception("GLFW init failed");
  14. auto window = new Window("Fray", 1024, 768);
  15. try {
  16. GLVersion glVersion = DerelictGL3.reload();
  17. writeln("Loaded OpenGL Version", to!string(glVersion));
  18. } catch(Exception e) {
  19. writeln("exception: "~ e.msg);
  20. }
  21. return window;
  22. }
  23. void deinitThree() {
  24. glfwTerminate();
  25. //freeTypeDeinit();
  26. }