window.h 761 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <glad/glad.h> //so we don't have conflicts
  3. #include <GLFW/glfw3.h>
  4. #include <pikaContext.h>
  5. #include "input.h"
  6. #include <chrono>
  7. namespace pika
  8. {
  9. struct WindowState
  10. {
  11. int w = 0;
  12. int h = 0;
  13. bool hasFocus = 0;
  14. };
  15. //this is not intended to have multiple instances in the program
  16. struct PikaWindow
  17. {
  18. pika::PikaContext context = {};
  19. //this is made to be passed to the user code
  20. //on live code editing this will be recorded every frame
  21. Input input = {};
  22. WindowState windowState = {};
  23. //this doesn't return error codes because it will do the asserts for you
  24. void create();
  25. void saveWindowPositions();
  26. bool shouldClose();
  27. void update();
  28. std::chrono::steady_clock::time_point timer = {};
  29. };
  30. }