Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/preview' into gfx-rdp
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Nov 18, 2024
2 parents 5c2517d + 253dbc9 commit a98242b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ float display_get_delta_time(void);
*/
void display_set_fps_limit(float fps);

/**
* @brief Returns a surface that points to the framebuffer currently being shown on screen.
*/
surface_t display_get_current_framebuffer(void);

/** @cond */
__attribute__((deprecated("use display_get or display_try_get instead")))
static inline surface_t* display_lock(void) {
Expand Down
9 changes: 9 additions & 0 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,13 @@ void display_set_fps_limit(float fps)
enable_interrupts();
}

surface_t display_get_current_framebuffer(void)
{
return surface_make_linear(
VirtualUncachedAddr(*VI_ORIGIN),
display_get_bitdepth() == 2 ? FMT_RGBA16 : FMT_RGBA32,
display_get_width(),
display_get_height());
}

extern inline void vi_write_config(const vi_config_t* config);

0 comments on commit a98242b

Please sign in to comment.