Show rectangle when selecting entities
This commit is contained in:
@@ -84,13 +84,21 @@ void Window::DrawSprite(const WindowPos &position, Sprite &s, float scale) {
|
||||
SDL_RenderTexture(m_Renderer.get(), s.GetTexture(), nullptr, &rect);
|
||||
}
|
||||
|
||||
void Window::DrawRect(const WindowPos &position, const WindowSize size, uint8_t R,
|
||||
void Window::DrawFilledRect(const WindowPos &position, const WindowSize size, uint8_t R,
|
||||
uint8_t G, uint8_t B, uint8_t A) {
|
||||
SDL_FRect rect = {position.x(), position.y(), size.x(), size.y()};
|
||||
SDL_SetRenderDrawColor(m_Renderer.get(), R, G, B, A);
|
||||
SDL_RenderFillRect(m_Renderer.get(), &rect);
|
||||
}
|
||||
|
||||
void Window::DrawRect(const WindowPos &position, const WindowSize size, uint8_t R,
|
||||
uint8_t G, uint8_t B, uint8_t fill_alpha) {
|
||||
SDL_FRect rect = {position.x(), position.y(), size.x(), size.y()};
|
||||
SDL_SetRenderDrawColor(m_Renderer.get(), R, G, B, 255);
|
||||
SDL_RenderRect(m_Renderer.get(), &rect);
|
||||
//SDL_RenderFillRect(m_Renderer.get(), &rect);
|
||||
}
|
||||
|
||||
void Window::ClearWindow() {
|
||||
SDL_SetRenderDrawColor(m_Renderer.get(), 50, 50, 50, 255);
|
||||
SDL_RenderClear(m_Renderer.get());
|
||||
|
||||
Reference in New Issue
Block a user