Josh's Graphics Library
Josh's Graphics Library

Yet Another C++ Rendering Toolkit

License: Unlicense Static Badge

Features

  • Modern C++ (20).
  • Cross Platform (Linux & Windows 10 1909 or newer).
  • Provides single-function-calls to render various graphics in 2D and 3D.
  • Integrates right into an existing OpenGL rendering system.
  • Quick Rendering of Text, Shapes, Sprites / Textures, etc.
  • High-performance text rendering.
  • Little-to-no overhead.

API Overview

J2D

  • DrawPoint
  • DrawLine / DrawGradientLine
  • DrawSprite / DrawPartialSprite
  • OutlineRect / FillRect / FillGradientRect / FillRoundedRect
  • OutlineCircle / FillCircle
  • OutlineTriangle / FillTriangle
  • DrawString

J3D

  • DrawLine
  • DrawString
  • DrawMatrixGizmo (WIP)
  • DrawAxisAngleGizmo (WIP)
  • DrawQuaternionGizmo (WIP)

Types

  • RenderTarget
  • VRamList
  • Texture
  • Font

Usage

// Makes sure the glViewport will be the correct size.
// Typically done once per frame.
JGL::Update(window_size);
JGL::J2D::FillRect(Colors::Blue, {0,0}, {16,16});
// See the example program in main.cpp for more in-depth usage.
void Begin(RenderTarget *render_target=nullptr, bool clear_buffers=false)
Open a 2-D rendering context with the underlying graphics system (In this case& by default OpenGL).
Definition: JGL.cpp:51
void FillRect(const Color4 &color, const Vector2 &pos, const Vector2 &size)
Draws a filled rectangle on the screen.
Definition: JGL.cpp:245
void End()
Closes a 2-D rendering context with the underlying graphics system (In this case& by default OpenGL).
Definition: JGL.cpp:138
void Update(const Vector2 &window_size)
Definition: JGL.cpp:37

Requirements

An OpenGL 2.1 or newer accelerator that supports the GL_ARB_framebuffer_object extension or an implementation that can provide those features through alternative means (common on ArmSoC and Risc-V).

Compatability

  • AMD ✓
  • NVIDIA ✓
  • Intel ✓
  • Zink (OpenGL-on-Vulkan) ✓
  • GL4ES ✓

Documentation

Documentation is (sic: will be) automatically generated from latest commit and is hosted at https://doc.redacted.cc/jgl .

Contributing

Contributions to JGL are welcome! If you find a bug, have a feature request, or would like to contribute code, please submit an issue or pull request to our repository!

Acknowledgements

JGL is developed and maintained by Josh O'Leary @ Co from Redacted Software and contributors. Special thanks to Redacted.