d'affiche des trucs à l'écran
More...
#include <Screen.h>
|
| Screen () |
| Par défaut, taille 300px dans tous les sens. More...
|
|
| Screen (int x_min, int y_min, int x_max, int y_max) |
|
| Screen (Case min, Case max) |
| Construit un écran vide avec les bordures des cases min et max. More...
|
|
| Screen (const std::list< Case > &l) |
| Construit un écran avec les bordures de la liste. More...
|
|
int | w () const |
|
int | h () const |
|
void | show_case (const Case &c, float rad=1.0, Uint32 color=0x000000) |
|
void | show_case (const std::list< Case > &l, float rad=1.0, Uint32 color=0x000000) |
| Afiche une liste de cases sur un Screen. More...
|
|
void | disc (int x, int y, int radius, Uint32 color=0xFF0000) |
|
void | rect (int x, int y, int w, int h, Uint32 color=0xFF) |
|
void | line (int x0, int y0, int x1, int y1, Uint32 color=0xFF0000) |
|
void | axes (Uint32 color=0x000000) |
|
bool | flip () |
|
bool | inside (int x, int y) |
| Are the coordinates inside the screen ? More...
|
|
void | set_bounds (int x_min, int y_min, int x_max, int y_max) |
| Set screen bounds. More...
|
|
| ~Screen () |
| destructors More...
|
|
|
void | _disc (SDL_Surface *surf, int x_center, int y_center, int radius, Uint32 color) |
|
void | _rect (SDL_Surface *surf, int x_center, int y_center, int w, int h, Uint32 color) |
|
void | _line (SDL_Surface *surf, int x0, int y0, int x1, int y1, Uint32 color) |
|
void | _show_case (SDL_Surface *surf, const Case &c, float rad, Uint32 color) |
|
void | _put_pixel (SDL_Surface *surf, Uint32 color, int x, int y) |
|
void | _put_pixel (SDL_Surface *surf, int x, int y, Uint8 r, Uint8 g, Uint8 b) |
|
d'affiche des trucs à l'écran
Par défaut, taille 300px dans tous les sens.
Screen::Screen |
( |
int |
x_min, |
|
|
int |
y_min, |
|
|
int |
x_max, |
|
|
int |
y_max |
|
) |
| |
|
inline |
Constructor of Screen open a SDL window
- Parameters
-
x_min | x_min of the window (e.g. -400) |
y_min | y_min of the window (e.g. -400) |
x_max | x_max of the window (e.g. 400) |
y_max | y_max of the window (e.g. 400) |
Construit un écran vide avec les bordures des cases min et max.
Screen::Screen |
( |
const std::list< Case > & |
l | ) |
|
|
inline |
Construit un écran avec les bordures de la liste.
void Screen::_disc |
( |
SDL_Surface * |
surf, |
|
|
int |
x_center, |
|
|
int |
y_center, |
|
|
int |
radius, |
|
|
Uint32 |
color |
|
) |
| |
|
protected |
void Screen::_line |
( |
SDL_Surface * |
surf, |
|
|
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
Uint32 |
color |
|
) |
| |
|
protected |
void Screen::_put_pixel |
( |
SDL_Surface * |
surf, |
|
|
Uint32 |
color, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
inlineprotected |
void Screen::_put_pixel |
( |
SDL_Surface * |
surf, |
|
|
int |
x, |
|
|
int |
y, |
|
|
Uint8 |
r, |
|
|
Uint8 |
g, |
|
|
Uint8 |
b |
|
) |
| |
|
inlineprotected |
void Screen::_rect |
( |
SDL_Surface * |
surf, |
|
|
int |
x_center, |
|
|
int |
y_center, |
|
|
int |
w, |
|
|
int |
h, |
|
|
Uint32 |
color |
|
) |
| |
|
protected |
void Screen::_show_case |
( |
SDL_Surface * |
surf, |
|
|
const Case & |
c, |
|
|
float |
rad, |
|
|
Uint32 |
color |
|
) |
| |
|
protected |
void Screen::axes |
( |
Uint32 |
color = 0x000000 | ) |
|
|
inline |
draw axes
- Parameters
-
color | 0xRRGGBBAA (default: black) |
void Screen::disc |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
radius, |
|
|
Uint32 |
color = 0xFF0000 |
|
) |
| |
|
inline |
draw a disc
- Parameters
-
x | x-coordinate of the center (in pixels) |
y | y-coordinate of the center (in pixels) |
radius | (in pixels) |
color | 0xRRGGBBAA (default: red) |
Flip the screen: swap buffer1 and buffer2; in effect, update the screen to take the drawings into account.
- Returns
- faux si on a quitté
- Returns
- the height of the screen
bool Screen::inside |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
Are the coordinates inside the screen ?
void Screen::line |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
Uint32 |
color = 0xFF0000 |
|
) |
| |
|
inline |
draw a line
- Parameters
-
x0 | starting x-coordinate (in pixels) |
y0 | starting y-coordinate (in pixels) |
x1 | ending x-coordinate (in pixels) |
y1 | ending y-coordinate (in pixels) |
color | 0xRRGGBBAA (default: red) |
void Screen::rect |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
Uint32 |
color = 0xFF |
|
) |
| |
|
inline |
draw a filled rectangle
- Parameters
-
x | x-coordinate of the center (in pixels) |
y | y-coordinate of the center (in pixels) |
w | width of the rectangle (in pixels) |
h | height of the rectangle (in pixels) |
color | 0xRRGGBBAA (default: blue) |
void Screen::set_bounds |
( |
int |
x_min, |
|
|
int |
y_min, |
|
|
int |
x_max, |
|
|
int |
y_max |
|
) |
| |
void Screen::show_case |
( |
const Case & |
c, |
|
|
float |
rad = 1.0 , |
|
|
Uint32 |
color = 0x000000 |
|
) |
| |
|
inline |
Dessine une case avec ses coordonnées
- Parameters
-
x | x-coordinate of the center (in pixels) |
y | y-coordinate of the center (in pixels) |
rad | Par quoi le rayon est multiplié |
color | 0xRRGGBBAA (default: black) |
void Screen::show_case |
( |
const std::list< Case > & |
l, |
|
|
float |
rad = 1.0 , |
|
|
Uint32 |
color = 0x000000 |
|
) |
| |
|
inline |
Afiche une liste de cases sur un Screen.
- Returns
- the width of the screen
SDL_Surface* Screen::_screen |
|
protected |
The documentation for this class was generated from the following files: