Advertisement
keybode

renderer.hpp

Nov 18th, 2018
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.27 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "../include/auto.hpp"
  4. #include "../include/win32.hpp"
  5.  
  6. #include "../detail/singleton.hpp"
  7.  
  8. #include "../imgui/imgui.hpp"
  9. #include "../imgui/imgui_impl_win32.hpp"
  10. #include "../imgui/imgui_impl_dx9.hpp"
  11.  
  12. namespace horizon::core
  13. {
  14.  
  15. enum TextLayout : std::uint32_t
  16. {
  17.     TextLeft = 0x00,
  18.     TextRight = 0x01,
  19.     TextCenterV = 0x02,
  20.     TextCenterH = 0x04,
  21.     TextCenter = ( TextCenterV | TextCenterH ),
  22. };
  23.  
  24. class Renderer : public detail::Singleton< Renderer >
  25. {
  26. public:
  27.     ~Renderer();
  28.  
  29. public:
  30.     auto Create( IDirect3DDevice9* direct_device ) -> bool;
  31.     auto Destroy() -> void;
  32.  
  33.     auto Begin() -> bool;
  34.     auto End() -> void;
  35.  
  36.     auto Present() -> void;
  37.  
  38.     auto DeviceLost() -> void;
  39.     auto DeviceReset( const HRESULT result ) -> void;
  40.  
  41. public:
  42.     auto DrawQuad( const ImVec2& p0, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImColor& color ) -> void;
  43.     auto DrawRect( const ImVec2& begin, const ImVec2& size, const ImColor& color ) -> void;
  44.     auto DrawLine( const ImVec2& begin, const ImVec2& end, const ImColor& color, float width = 1.f )  -> void;
  45.     auto DrawText( const ImVec2& begin, unsigned align, const ImColor& color, const char* message, ... )  -> void;
  46.     auto GetTextSize( ImVec2& output, const char* message, ... ) -> void;
  47. };
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement