Implement Renderer::ReadPixels

This commit is contained in:
Dmitry Marakasov 2014-02-11 07:39:06 +04:00
parent 47625fcd6c
commit 2f91553068
2 changed files with 7 additions and 0 deletions

View File

@ -209,4 +209,9 @@ void Renderer::FillRects(const Rect* rects, int count) {
throw Exception("SDL_RenderFillRects failed"); throw Exception("SDL_RenderFillRects failed");
} }
void Renderer::ReadPixels(const Rect& rect, Uint32 format, void* pixels, int pitch) {
if (SDL_RenderReadPixels(renderer_, rect.Get(), format, pixels, pitch) != 0)
throw Exception("SDL_RenderReadPixels failed");
}
} }

View File

@ -85,6 +85,8 @@ public:
void FillRect(const Point& p1, const Point& p2); void FillRect(const Point& p1, const Point& p2);
void FillRect(const Rect& r); void FillRect(const Rect& r);
void FillRects(const Rect* rects, int count); void FillRects(const Rect* rects, int count);
void ReadPixels(const Rect& rect, Uint32 format, void* pixels, int pitch);
}; };
} }