diff --git a/SDLWrapper/Renderer.h b/SDLWrapper/Renderer.h index d048d72..202c1c0 100644 --- a/SDLWrapper/Renderer.h +++ b/SDLWrapper/Renderer.h @@ -14,7 +14,7 @@ class Renderer public: Renderer() = default; /// Create a Renderer associated with Window - Renderer(Window& wnd,std::initializer_list RendererFlags = { RendererType::Accelerated,RendererType::TargetTexture }); + Renderer(class Window& wnd,std::initializer_list RendererFlags = { RendererType::Accelerated,RendererType::TargetTexture }); /// Create a software Renderer Renderer(Surface& surf); ~Renderer() = default; @@ -148,7 +148,8 @@ private: void _clear(); SDL_Renderer* _get() const; + friend class Window; friend class _internal::Plugin; }; -} /// End of namespace MiniEngine +} /// End of namespace MiniEngine diff --git a/SDLWrapper/Window.cpp b/SDLWrapper/Window.cpp index babd6e0..6b294c5 100644 --- a/SDLWrapper/Window.cpp +++ b/SDLWrapper/Window.cpp @@ -108,6 +108,13 @@ float Window::getOpacity() const } #endif /// End of SDL2 2.0.5 Require. +Renderer Window::getRenderer() +{ + Renderer nrnd; + nrnd._set(SDL_GetRenderer(_get())); + return nrnd; +} + /// FIXME: Not Implemented. void Window::setResizable(bool resizable) { @@ -248,5 +255,5 @@ bool Window::isScreenKeyboardShown() { return SDL_IsScreenKeyboardShown(_get())==SDL_TRUE; } -} /// End of namespace MiniEngine +} /// End of namespace MiniEngine diff --git a/SDLWrapper/Window.h b/SDLWrapper/Window.h index 6d7f74b..b7d9a5a 100644 --- a/SDLWrapper/Window.h +++ b/SDLWrapper/Window.h @@ -6,6 +6,8 @@ #include "MessageBox.h" #include "Surface.h" #include "__Plugin.h" +#include "Renderer.h" + namespace MiniEngine { class Window @@ -36,6 +38,8 @@ public: float getOpacity() const; #endif + class Renderer getRenderer(); + /// FIXME: Not Implemented. void setResizable(bool resizable); @@ -66,5 +70,5 @@ private: friend class Renderer; friend class _internal::Plugin; }; -} /// End of namespace MiniEngine +} /// End of namespace MiniEngine