GLFW.cpp 362 B

123456789101112131415161718
  1. #include <iostream>
  2. #include "rendering/wrapper/GLFW.h"
  3. bool GLFW::init() {
  4. if(glfwInit()) {
  5. std::atexit([]() {
  6. glfwTerminate();
  7. });
  8. return false;
  9. }
  10. std::cout << "could not initialize GLFW\n";
  11. return true;
  12. }
  13. Nanos GLFW::getNanos() {
  14. return glfwGetTimerValue() * (1000000000 / glfwGetTimerFrequency());
  15. }