window.h 740 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. };
  14. //this is not intended to have multiple instances in the program
  15. struct PikaWindow
  16. {
  17. pika::PikaContext context = {};
  18. //this is made to be passed to the user code
  19. //on live code editing this will be recorded every frame
  20. Input input = {};
  21. WindowState windowState = {};
  22. //this doesn't return error codes because it will do the asserts for you
  23. void create();
  24. void saveWindowPositions();
  25. bool shouldClose();
  26. void update();
  27. std::chrono::steady_clock::time_point timer = {};
  28. };
  29. }