|
CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
|
#include <th_gfx_sdl.h>
Classes | |
| class | scoped_buffer |
| class | scoped_clip |
| class | scoped_target_texture |
Public Member Functions | |
| render_target (const render_target_creation_params ¶ms) | |
| render_target (const render_target &other)=delete | |
| render_target & | operator= (const render_target &other)=delete |
| ~render_target () | |
| bool | update (const render_target_creation_params ¶ms) |
| Update the parameters for the render target. | |
| const char * | get_last_error () |
| Get the reason for the last operation failing. | |
| bool | start_frame () |
| Begin rendering a new frame. | |
| bool | end_frame () |
| Finish rendering the current frame and present it. | |
| bool | fill_black () |
| Paint the entire render target black. | |
| bool | fill_colour (uint32_t colour) |
| Paint the entire render target with a solid colour. | |
| void | set_blue_filter_active (bool bActivate) |
| Sets a blue filter on the current surface. | |
| bool | fill_rect (uint32_t iColour, int iX, int iY, int iW, int iH) |
| Fill a rectangle of the render target with a solid colour. | |
| int | set_minimum_size (int width, int height) |
| Sets a minimum size for the render target. | |
| void | push_clip_rect (const clip_rect *pRect) |
| Push a new clip rectangle. | |
| void | pop_clip_rect () |
| Restore the previous clip rectangle. | |
| int | get_width () const |
| Get the width of the render target (in pixels) | |
| int | get_height () const |
| Get the height of the render target (in pixels) | |
| void | start_nonoverlapping_draws () |
| Enable optimisations for non-overlapping draws. | |
| void | finish_nonoverlapping_draws () |
| Disable optimisations for non-overlapping draws. | |
| void | set_cursor (cursor *pCursor) |
| Set the cursor to be used. | |
| void | set_cursor_position (int iX, int iY) |
| Update the cursor position (if the cursor is being simulated) | |
| bool | take_screenshot (const char *file_path) const |
| Take a screenshot and save it as a PNG file. | |
| bool | set_scale_factor (double fScale, scaled_items eWhatToScale) |
| Set the amount by which future draw operations are scaled. | |
| void | set_caption (const char *sCaption) |
| Set the window caption. | |
| void | set_window_grab (bool bActivate) |
| Toggle mouse capture on the window. | |
| const char * | get_renderer_details () const |
| Get any user-displayable information to describe the renderer path used. | |
| SDL_Renderer * | get_renderer () const |
| bool | should_scale_bitmaps (double *pFactor) |
| Should bitmaps be scaled? | |
| SDL_Texture * | create_palettized_texture (int iWidth, int iHeight, const uint8_t *pPixels, const ::palette *pPalette, uint32_t iSpriteFlags) const |
| SDL_Texture * | create_texture (int iWidth, int iHeight, const uint32_t *pPixels) const |
| void | draw (SDL_Texture *pTexture, const SDL_Rect *prcSrcRect, const SDL_Rect *prcDstRect, int iFlags) |
| void | draw_line (line_sequence *pLine, int iX, int iY) |
| std::unique_ptr< scoped_buffer > | begin_intermediate_drawing (int iX, int iY, int iWidth, int iHeight) |
Static Public Member Functions | |
| static constexpr uint32_t | map_colour (uint8_t iR, uint8_t iG, uint8_t iB) |
| Encode an RGB triplet for fillRect() | |
Friends | |
| class | scoped_target_texture |
|
explicit |
|
delete |
| render_target::~render_target | ( | ) |
| std::unique_ptr< render_target::scoped_buffer > render_target::begin_intermediate_drawing | ( | int | iX, |
| int | iY, | ||
| int | iWidth, | ||
| int | iHeight | ||
| ) |
Begin drawing to an intermediate unscaled texture targeting the given location and size. The intermediate drawing will be committed once the returned scoped_buffer is destroyed.
| iX | X-coordinate of left side of drawing rectangle. |
| iY | Y-coordinate of top side of drawing rectangle. |
| iWidth | Width of drawing rectangle. |
| iHeight | Height of drawing rectangle. |
| SDL_Texture * render_target::create_palettized_texture | ( | int | iWidth, |
| int | iHeight, | ||
| const uint8_t * | pPixels, | ||
| const ::palette * | pPalette, | ||
| uint32_t | iSpriteFlags | ||
| ) | const |
| SDL_Texture * render_target::create_texture | ( | int | iWidth, |
| int | iHeight, | ||
| const uint32_t * | pPixels | ||
| ) | const |
| void render_target::draw | ( | SDL_Texture * | pTexture, |
| const SDL_Rect * | prcSrcRect, | ||
| const SDL_Rect * | prcDstRect, | ||
| int | iFlags | ||
| ) |
| void render_target::draw_line | ( | line_sequence * | pLine, |
| int | iX, | ||
| int | iY | ||
| ) |
| bool render_target::end_frame | ( | ) |
Finish rendering the current frame and present it.
| bool render_target::fill_black | ( | ) |
Paint the entire render target black.
| bool render_target::fill_colour | ( | uint32_t | colour | ) |
Paint the entire render target with a solid colour.
Fill a rectangle of the render target with a solid colour.
| void render_target::finish_nonoverlapping_draws | ( | ) |
Disable optimisations for non-overlapping draws.
| int render_target::get_height | ( | ) | const |
Get the height of the render target (in pixels)
|
inline |
Get any user-displayable information to describe the renderer path used.
| int render_target::get_width | ( | ) | const |
Get the width of the render target (in pixels)
|
inlinestaticconstexpr |
Encode an RGB triplet for fillRect()
|
delete |
| void render_target::pop_clip_rect | ( | ) |
Restore the previous clip rectangle.
Sets a blue filter on the current surface.
Update the cursor position (if the cursor is being simulated)
Sets a minimum size for the render target.
| bool render_target::set_scale_factor | ( | double | fScale, |
| scaled_items | eWhatToScale | ||
| ) |
Set the amount by which future draw operations are scaled.
| fScale | New scale to use. |
| eWhatToScale | Th kind of items to scale. |
Should bitmaps be scaled?
| [out] | pFactor | If the function returns true, the factor to use for scaling (can be nullptr if not interested in the value). |
| bool render_target::start_frame | ( | ) |
Begin rendering a new frame.
| void render_target::start_nonoverlapping_draws | ( | ) |
Enable optimisations for non-overlapping draws.
Take a screenshot and save it as a PNG file.
| bool render_target::update | ( | const render_target_creation_params & | params | ) |
Update the parameters for the render target.
|
friend |