 |
Simple Game Graphics Library
1.0
|
Go to the documentation of this file.
4 #include <sgg/scancodes.h>
18 CANVAS_SCALE_WINDOW = 0,
552 void drawRect(
float center_x,
float center_y,
float width,
float height,
const Brush & brush);
611 void drawSector(
float cx,
float cy,
float radius1,
float radius2,
float start_angle,
float end_angle,
const Brush & brush);
651 void drawText(
float pos_x,
float pos_y,
float size,
const std::string & text,
const Brush & brush);
764 void playSound(std::string soundfile,
float volume,
bool looping =
false);
787 void playMusic(std::string soundfile,
float volume,
bool looping =
true,
int fade_time = 0);
float fill_secondary_color[3]
Definition: graphics.h:37
void drawRect(float center_x, float center_y, float width, float height, const Brush &brush)
int cur_pos_x
The current x position in pixel units of the pointing device.
Definition: graphics.h:119
bool button_left_released
The left button went from an "pressed" state to a "released" one during the last poll cycle.
Definition: graphics.h:112
void setCanvasSize(float w, float h)
bool gradient
Definition: graphics.h:79
bool button_right_down
The right button is currently held down.
Definition: graphics.h:117
bool button_middle_down
The middle button is currently held down.
Definition: graphics.h:116
float outline_width
Definition: graphics.h:54
float gradient_dir_u
Definition: graphics.h:82
float windowToCanvasX(float x, bool clamped=true)
void setFullScreen(bool fs)
void setWindowBackground(Brush style)
void setResizeFunction(std::function< void(int, int)> resize)
float fill_secondary_opacity
Definition: graphics.h:44
bool button_left_pressed
The left button went from an "depressed" state to a "pressed" one during the last poll cycle.
Definition: graphics.h:109
Definition: graphics.h:33
float fill_opacity
Definition: graphics.h:40
bool button_right_pressed
The right went from an "depressed" state to a "pressed" one during the last poll cycle.
Definition: graphics.h:111
int cur_pos_y
The current y position in pixel units of the pointing device.
Definition: graphics.h:120
bool button_left_down
The left button is currently held down.
Definition: graphics.h:115
void drawText(float pos_x, float pos_y, float size, const std::string &text, const Brush &brush)
void drawDisk(float cx, float cy, float radius, const Brush &brush)
Definition: graphics.h:108
void playMusic(std::string soundfile, float volume, bool looping=true, int fade_time=0)
void setCanvasScaleMode(scale_mode_t sm)
int prev_pos_x
The x position in pixel units of the pointing device in the previous update cycle.
Definition: graphics.h:121
void drawSector(float cx, float cy, float radius1, float radius2, float start_angle, float end_angle, const Brush &brush)
float outline_color[3]
Definition: graphics.h:47
void setUpdateFunction(std::function< void(float)> update)
std::vector< std::string > preloadBitmaps(std::string dir)
void setOrientation(float angle)
float gradient_dir_v
Definition: graphics.h:90
scancode_t
Definition: scancodes.h:12
bool dragging
The left button is currently held down and the cursor is moving.
Definition: graphics.h:118
void setUserData(const void *user_data)
bool button_right_released
The right button went from an "pressed" state to a "released" one during the last poll cycle.
Definition: graphics.h:114
void drawLine(float x1, float y1, float x2, float y2, const Brush &brush)
bool button_middle_pressed
The middle button went from an "depressed" state to a "pressed" one during the last poll cycle.
Definition: graphics.h:110
void setScale(float sx, float sy)
bool setFont(std::string fontname)
void getMouseState(MouseState &ms)
bool button_middle_released
The middle button went from an "pressed" state to a "released" one during the last poll cycle.
Definition: graphics.h:113
void stopMusic(int fade_time=0)
bool getKeyState(scancode_t key)
void createWindow(int width, int height, std::string title)
void setDrawFunction(std::function< void()> draw)
float fill_color[3]
Definition: graphics.h:34
void playSound(std::string soundfile, float volume, bool looping=false)
int prev_pos_y
The y position in pixel units of the pointing device in the previous update cycle.
Definition: graphics.h:122
float windowToCanvasY(float y, bool clamped=true)
scale_mode_t
Definition: graphics.h:17
float outline_opacity
Definition: graphics.h:51
std::string texture
Definition: graphics.h:57