59 static bool m_lbutton_down;
60 static vfloat2_t m_lbutton_down_mouse_pos;
63 TRASE_BACKEND_VISITABLE()
91 static void set_mouse_down(
const vfloat2_t &mouse_pos);
92 static void set_mouse_up();
114 void rotate(
const float angle);
172 void text(
const vfloat2_t &x,
const char *
string,
const char *end);
196 NVGcontext *init_nanovg(
const vint2_t &pixels);
197 GLFWwindow *create_window(
const vint2_t &pixels,
const char *name);
202 #endif // BACKENDGL_H_ a base class for all the backends that support drawing a single frame
Definition: Backend.hpp:50
void font_size(float size)
Sets the current font height in pixels.
Definition: BackendGL.cpp:153
void stroke_color(const RGBA &color)
Set the current stroke color.
Definition: BackendGL.cpp:146
void reset_scissor()
Remove a previously call to scissor()
Definition: BackendGL.cpp:114
void rounded_rect(const bfloat2_t &x, const float r)
Draw a rectangle with rounded corners.
Definition: BackendGL.cpp:123
void fill_color(const RGBA &color)
Set the current fill color.
Definition: BackendGL.cpp:169
void text(const vfloat2_t &x, const char *string, const char *end)
Draw the given text to the screen.
Definition: BackendGL.cpp:173
float get_time()
Get the current time.
Definition: BackendGL.cpp:79
void rect(const bfloat2_t &x)
Draw a rectangle.
Definition: BackendGL.cpp:130
void move_to(const vfloat2_t &x)
Extends the current path.
Definition: BackendGL.cpp:144
bool mouse_dragging()
Returns true if the mouse button is clicked and the mouse is dragging.
Definition: BackendGL.cpp:93
void mouse_drag_reset_delta()
Reset drag delta to zero.
Definition: BackendGL.cpp:104
An N-dimensional vector class.
Definition: Vector.hpp:59
void scissor(const bfloat2_t &x)
All subsequent drawing calls will be masked to only show within the bounding box x.
Definition: BackendGL.cpp:108
void line_to(const vfloat2_t &x)
Extends the current path.
Definition: BackendGL.cpp:145
void rotate(const float angle)
Apply a rotation of angle to the current drawing transform.
Definition: BackendGL.cpp:116
Definition: BackendGL.hpp:55
void stroke()
Draw a line along the completed path.
Definition: BackendGL.cpp:151
bool is_interactive()
Return true if this backend has mouse interaction.
Definition: BackendGL.cpp:77
vfloat2_t mouse_drag_delta()
Current delta position of the dragging mouse.
Definition: BackendGL.cpp:97
void end_frame()
End the current frame.
Definition: BackendGL.cpp:225
Colour class with red, green, blue and alpha in range 0 to 255.
Definition: Colors.hpp:48
void stroke_width(const float lw)
Set the current stroke width.
Definition: BackendGL.cpp:150
Definition: Backend.hpp:171
void begin_path()
Begin a path.
Definition: BackendGL.cpp:122
void translate(const vfloat2_t &v)
Apply a translation of v to the current drawing transform.
Definition: BackendGL.cpp:117
void circle(const vfloat2_t ¢re, float radius)
Draw a circle with a given centre and radius.
Definition: BackendGL.cpp:138
void text_align(const int align)
Sets the alignment of the text to its position.
Definition: BackendGL.cpp:168
bfloat2_t text_bounds(const vfloat2_t &x, const char *string)
Returns the bounding box covering the given text.
Definition: BackendGL.cpp:177
void font_blur(const float blur)
Sets the amount of blur to apply to the drawn text.
Definition: BackendGL.cpp:167
void reset_transform()
Reset the drawing transform to the identity matrix.
Definition: BackendGL.cpp:120
bool should_close()
Returns true if the current window should close (e.g.
Definition: BackendGL.cpp:188
void font_face(const char *face)
Sets the current font name.
Definition: BackendGL.cpp:154
void finalise()
Finalise this backend. Call after all drawing finished.
Definition: BackendGL.cpp:192
Definition: Backend.cpp:39
vfloat2_t get_mouse_pos()
Get the current position of the mouse in pixel units.
Definition: BackendGL.cpp:87
vfloat2_t begin_frame()
Begin a new frame.
Definition: BackendGL.cpp:200
void init(const vfloat2_t &pixels, const char *name)
Initialise this backend.
Definition: BackendGL.cpp:70
void fill()
Draw a line along the completed path and fill it in.
Definition: BackendGL.cpp:152