mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-17 03:04:42 -04:00
Implement Renderer::ReadPixels
This commit is contained in:
parent
47625fcd6c
commit
2f91553068
@ -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");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user