raylib_editor.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "lumacs/ui_interface.hpp"
  3. #include <memory>
  4. #include <raylib.h>
  5. namespace lumacs {
  6. class Window;
  7. struct LayoutNode;
  8. class RaylibEditor : public IEditorView {
  9. public:
  10. RaylibEditor();
  11. ~RaylibEditor() override;
  12. void init() override;
  13. void run() override;
  14. void handle_editor_event(EditorEvent event) override;
  15. void set_core(EditorCore* core) override;
  16. private:
  17. void update();
  18. void render();
  19. // Input handling helpers
  20. void process_input();
  21. // Rendering helpers
  22. void draw_layout(LayoutNode* node, Rectangle area);
  23. void draw_window(Window& window, Rectangle area);
  24. void draw_modeline(Window& window, Rectangle area);
  25. void draw_minibuffer(Rectangle area);
  26. EditorCore* core_ = nullptr;
  27. bool should_close_ = false;
  28. // Graphics Resources
  29. Font font_;
  30. int font_size_ = 20;
  31. int char_width_ = 10;
  32. int line_height_ = 20;
  33. };
  34. std::unique_ptr<IEditorView> create_raylib_editor();
  35. } // namespace lumacs