mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 11:06:44 +01:00
make depth buffer creation configurable
This commit is contained in:
parent
9611be3267
commit
48189e7715
3 changed files with 7 additions and 2 deletions
|
@ -500,7 +500,9 @@ SYMBOL_INTERNAL void ClearScreen(struct Game* game) {
|
|||
al_set_target_backbuffer(game->display);
|
||||
al_reset_clipping_rectangle();
|
||||
al_clear_to_color(al_map_rgb(0, 0, 0));
|
||||
al_clear_depth_buffer(1.0);
|
||||
if (game->viewport_config.depth_buffer) {
|
||||
al_clear_depth_buffer(1.0);
|
||||
}
|
||||
al_set_clipping_rectangle(game->_priv.clip_rect.x, game->_priv.clip_rect.y, game->_priv.clip_rect.w, game->_priv.clip_rect.h);
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,9 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
|
|||
al_set_new_display_option(ALLEGRO_SUPPORTED_ORIENTATIONS, ALLEGRO_DISPLAY_ORIENTATION_PORTRAIT, ALLEGRO_SUGGEST);
|
||||
#endif
|
||||
|
||||
al_set_new_display_option(ALLEGRO_DEPTH_SIZE, 24, ALLEGRO_SUGGEST);
|
||||
if (viewport.depth_buffer) {
|
||||
al_set_new_display_option(ALLEGRO_DEPTH_SIZE, 24, ALLEGRO_SUGGEST);
|
||||
}
|
||||
|
||||
#ifdef ALLEGRO_WINDOWS
|
||||
al_set_new_window_position(20, 40); // workaround nasty Windows bug with window being created off-screen
|
||||
|
|
|
@ -81,6 +81,7 @@ struct Viewport {
|
|||
float aspect; /*!< When set instead of width/height pair, makes the viewport side fluid; when non-zero, locks its aspect ratio. */
|
||||
bool integer_scaling; /*!< Ensure that the viewport is zoomed only with integer factors. */
|
||||
bool pixel_perfect; /*!< Ensure that the resulting image is really viewport-sized and (potentially) rescaled afterwards, as opposed to default transformation-based scaling. */
|
||||
bool depth_buffer; /*!< Request a depth buffer for the framebuffer's render target. */
|
||||
};
|
||||
|
||||
/*! \brief Main struct of the game. */
|
||||
|
|
Loading…
Reference in a new issue