Documentation work
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 4m51s
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 4m51s
This commit is contained in:
@@ -32,6 +32,8 @@ namespace JGL {
|
||||
using namespace J3ML::LinearAlgebra;
|
||||
using namespace J3ML::Geometry;
|
||||
|
||||
|
||||
/// @param window_size
|
||||
void Update(const Vector2& window_size);
|
||||
inline void PurgeFontCache() { fontCache.purgeCache(); }
|
||||
std::array<GLfloat, 16> OpenGLPerspectiveProjectionRH(float fovY, float aspect, float z_near, float z_far);
|
||||
@@ -43,6 +45,8 @@ namespace JGL {
|
||||
/// @note This call may not strictly be necessary on some setups, but is provided to keep the API constant.
|
||||
/// It is recommended to always open a JGL 2D context to render your content, then close when completed.
|
||||
/// This keeps our code from, say, clobbering the OpenGL rendering context driving 3D content in between our calls.
|
||||
/// @param render_target
|
||||
/// @param clear_buffers
|
||||
void Begin(RenderTarget* render_target = nullptr, bool clear_buffers = false);
|
||||
/// Closes a 2-D rendering context with the underlying graphics system (In this case& by default OpenGL).
|
||||
/// @see Begin().
|
||||
@@ -55,9 +59,15 @@ namespace JGL {
|
||||
/// Plots a single pixel on the screen.
|
||||
/// @param color A 3-or-4 channel color value. @see class Color3, class Color4
|
||||
/// @param coordinates The pixel-point on-screen at which to plot the pixel.
|
||||
/// @param radius The size of the point to plot. By default, a single pixel.
|
||||
void DrawPoint(const Color4& color, const Vector2& coordinates, float radius = 1.f);
|
||||
void DrawPoint(const Color4& color, float x, float y, float radius = 1.f);
|
||||
|
||||
/// Plots a series of pixel-points on the screen, in a batch.
|
||||
/// @note This is more performant for multiple points than plotting them individually.
|
||||
/// @param color
|
||||
/// @param points
|
||||
/// @param radius
|
||||
void DrawPoints(const Color4& color, const std::vector<Vector2>& points, float radius = 1.f);
|
||||
|
||||
/// Plots a line (segment) on the screen.
|
||||
@@ -68,29 +78,65 @@ namespace JGL {
|
||||
void DrawLine(const Color4& color, const Vector2& A, const Vector2& B, float thickness = 1);
|
||||
void DrawLine(const Color4& color, float x1, float y1, float x2, float y2, float thickness = 1);
|
||||
|
||||
///Draws a line with a gradient that transitions across it.
|
||||
/// Draws a line with a gradient that transitions across it.
|
||||
/// @param color_a
|
||||
/// @param color_b
|
||||
/// @param A
|
||||
/// @param B
|
||||
/// @param thickness
|
||||
void DrawGradientLine(const Color4& color_a, const Color4& color_b, const Vector2& A, const Vector2& B, float thickness = 1);
|
||||
void DrawGradientLine(const Color4& color_a, const Color4& color_b, float x, float y, float w, float h, float thickness = 1);
|
||||
|
||||
/// Draws an outline of a rectangle on the screen.
|
||||
/// @param color
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @param thickness
|
||||
void OutlineRect(const Color4& color, const Vector2& pos, const Vector2& size, float thickness = 1);
|
||||
|
||||
/// Draws an outline of a rectangle with rounded corners onto the screen.
|
||||
/// @param color
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @param radius
|
||||
/// @param thickness
|
||||
void OutlineRoundedRect(const Color4& color, const Vector2& pos, const Vector2& size, float radius = 5, float thickness = 1);
|
||||
|
||||
/// Draws an outline of a rectangle with chamfered corners onto the screen.
|
||||
/// @param color
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @param radius
|
||||
/// @param thickness
|
||||
void OutlineChamferRect(const Color4& color, const Vector2& pos, const Vector2& size, float radius = 5, float thickness = 1);
|
||||
|
||||
/// Draws a filled rectangle on the screen.
|
||||
/// @param color
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @see FillRoundedRect, FillGradientRect, FillChamferRect.
|
||||
void FillRect(const Color4& color, const Vector2& pos, const Vector2& size);
|
||||
|
||||
/// Draws a filled rectangle where the color transitions across it.
|
||||
/// @param color1
|
||||
/// @param color2
|
||||
/// @param gradient
|
||||
/// @param pos
|
||||
/// @param size
|
||||
void FillGradientRect(const Color4& color1, const Color4& color2, const Direction& gradient, const Vector2& pos, const Vector2& size);
|
||||
|
||||
/// Draws a filled rectangle with rounded corners on the screen.
|
||||
/// @param color
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @param radius
|
||||
/// @param subdivisions
|
||||
void FillRoundedRect(const Color4& color, const Vector2& pos, const Vector2& size, float radius = 5, unsigned int subdivisions = 8);
|
||||
|
||||
/// Draws a filled rectangle with chamfered (beveled) corners on the screen.
|
||||
void FillChamferRect(const Color4& color, const Vector2& pos, const Vector2& size, float radius = 5);
|
||||
|
||||
/// Draws an outline of a rectangle with rounded corners onto the screen.
|
||||
void OutlineRoundedRect(const Color4& color, const Vector2& pos, const Vector2& size, float radius = 5, float thickness = 1);
|
||||
|
||||
void OutlineChamferRect(const Color4& color, const Vector2& pos, const Vector2& size, float radius = 5, float thickness = 1);
|
||||
|
||||
/// Draws a render target to the screen.
|
||||
void DrawRenderTarget(const RenderTarget& render_target, const Vector2& position, float rad_rotation = 0, const Vector2& origin = Vector2(0 , 0),
|
||||
@@ -177,6 +223,7 @@ namespace JGL {
|
||||
|
||||
void FillTexturedTriangle();
|
||||
|
||||
/// Draws an Arc (section of a circle) to the screen.
|
||||
void DrawArc(const Color4 &color, const Vector2 ¢er, float radius, float arc_begin, float arc_end,
|
||||
unsigned int subdivisions, float thickness);
|
||||
}
|
||||
|
Reference in New Issue
Block a user