SDLWindow.h 594 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * SDLWindow.h
  3. *
  4. * Created on: 17 déc. 2023
  5. * Author: fanch
  6. */
  7. #ifndef SRC_PLUGINS_SDLWINDOW_H_
  8. #define SRC_PLUGINS_SDLWINDOW_H_
  9. #include <SDL2/SDL.h>
  10. struct NoteValue;
  11. class SDLWindow {
  12. public:
  13. SDLWindow(int w=1920, int h=1080);
  14. void update();
  15. virtual ~SDLWindow();
  16. void set_value(float* value, int size, float ratio=1);
  17. void set_value(const NoteValue* value, float ratio=1);
  18. static void init();
  19. protected:
  20. SDL_Window* m_window;
  21. int m_w;
  22. int m_h;
  23. SDL_Renderer* m_renderer;
  24. SDL_Texture* m_texture;
  25. uint32_t* m_pixels;
  26. };
  27. #endif /* SRC_PLUGINS_SDLWINDOW_H_ */