|
| void | create (const char *title, int width, int height) |
| | Create the window and the renderer. More...
|
| |
| void | draw_buffer (Uint32 *buffer) |
| | Draws a buffer of pixel colours to the screen. More...
|
| |
| SDL_Texture * | load_texture (const char *file_path) |
| |
| void | render (int x, int y, float scale_factor, SDL_Texture *texture) |
| | Render an SDL_Texture to the renderer. More...
|
| |
| void | render (int x, int y, float scale_factor, std::string text, TTF_Font *font, SDL_Colour text_colour) |
| | Render string text to the renderer with an SDL_Colour for text colour. More...
|
| |
|
void | redraw () |
| | Draws the renderer to the window.
|
| |
| bool | done (bool quit_if_esc=true, bool delay=true) |
| | Used in while loops to tell if the window has been closed or not. More...
|
| |
| const Uint8 * | readKeys () |
| | Get the current held down keys. More...
|
| |
| bool | keyDown (const Uint8 *inkeys, int key) |
| | If the key is held down. More...
|
| |
◆ create()
| void RenderWindow::create |
( |
const char * |
title, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Create the window and the renderer.
- Parameters
-
| title | The window title |
| width | The window width |
| height | The window height |
◆ done()
| bool RenderWindow::done |
( |
bool |
quit_if_esc = true, |
|
|
bool |
delay = true |
|
) |
| |
Used in while loops to tell if the window has been closed or not.
- Parameters
-
| quit_if_esc | Quit the program is the ESC key is pressed |
| delay | Delay per frame to save computation power |
- Returns
- true The window has been closed
-
false The window is still open
◆ draw_buffer()
| void RenderWindow::draw_buffer |
( |
Uint32 * |
buffer | ) |
|
Draws a buffer of pixel colours to the screen.
- Parameters
-
| buffer | Buffer of pixel colours |
◆ keyDown()
| bool RenderWindow::keyDown |
( |
const Uint8 * |
inkeys, |
|
|
int |
key |
|
) |
| |
If the key is held down.
- Parameters
-
| inkeys | Uint8 of the keys on the keyboard which are held down |
| key | Key to test |
- Returns
- true Key is held down
-
false Key is now held down
◆ load_texture()
| SDL_Texture * RenderWindow::load_texture |
( |
const char * |
file_path | ) |
|
- Parameters
-
| file_path | Path to the file |
- Returns
- SDL_Texture*
◆ readKeys()
| const Uint8 * RenderWindow::readKeys |
( |
| ) |
|
Get the current held down keys.
- Returns
- const Uint8*
◆ render() [1/2]
| void RenderWindow::render |
( |
int |
x, |
|
|
int |
y, |
|
|
float |
scale_factor, |
|
|
SDL_Texture * |
texture |
|
) |
| |
Render an SDL_Texture to the renderer.
- Parameters
-
| x | Top left coordinate |
| y | Top left coordinate |
| scale_factor | How much to scale the image by, 1 is normal size |
| texture | SDL_Texture to render |
◆ render() [2/2]
| void RenderWindow::render |
( |
int |
x, |
|
|
int |
y, |
|
|
float |
scale_factor, |
|
|
std::string |
text, |
|
|
TTF_Font * |
font, |
|
|
SDL_Colour |
text_colour |
|
) |
| |
Render string text to the renderer with an SDL_Colour for text colour.
- Parameters
-
| x | Top left coordinate |
| y | Top left coordinate |
| scale_factor | How much to scale the image by, 1 is normal size |
| text | Text to render |
| font | Font to render the text in |
| text_colour | Colour to render the text in |
The documentation for this class was generated from the following files: