Skip to content

Commit

Permalink
Print a warning when set_viewport hasn't been initialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed Oct 31, 2024
1 parent 7d07293 commit 983e2df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,9 @@ unsigned video_window_by_platform_id(unsigned platform_id)
/**
* Update the scaled viewport coordinates within the window according to
* the window's scaling ratio, for use in SDL update rectangles or glViewport.
* The viewport is also used to translate mouse coordinates between screen
* and window space.
*
* This should be called by the renderer any time create_window forces the
* window size (SDL window creation functions already handle this).
* This is called automatically between resize_window and resize_callback.
Expand All @@ -1935,6 +1938,7 @@ void video_window_update_viewport(struct video_window *window)
}
else
{
debug("Implement set_viewport!");
window->viewport_x = 0;
window->viewport_y = 0;
window->viewport_width = window->width_px;
Expand Down

0 comments on commit 983e2df

Please sign in to comment.