MiniEngine/sdl_engine_window.hpp

17 lines
448 B
C++
Raw Normal View History

2017-01-05 13:25:09 +08:00
Window::Window(int winw,int winh)
{
pimpl=new impl;
pimpl->sWnd.reset(SDL_CreateWindow("Engine",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,winw,winh,SDL_WINDOW_SHOWN),SDL_DestroyWindow);
pimpl->rnd.pimpl->sRnd.reset(SDL_CreateRenderer(pimpl->sWnd.get(),-1,SDL_RENDERER_ACCELERATED|SDL_RENDERER_TARGETTEXTURE),SDL_DestroyRenderer);
}
Window::~Window()
{
delete pimpl;
}
Renderer Window::getRenderer()
{
return pimpl->rnd;
}