Josh's Graphics Library
JGL Namespace Reference

OpenGL Wrapper for rendering 2D & 3D graphics in both a 2D and 3D context. More...

Namespaces

namespace  Detail
 
namespace  J2D
 Drawing functions for primitive 2D Shapes.
 
namespace  J3D
 Drawing functions for primitive 3D Shapes.
 
namespace  Logger
 

Classes

class  Animation
 
class  Bone
 
class  CachedFont
 Represents a Font object as it exists in the font-cache. More...
 
class  CachedGlyph
 Represents a single font-character "glyph", that has been cached in-memory for fast retrieval. More...
 
class  Font
 A Font class implementation. More...
 
class  FontCache
 
class  KeyFrame
 
class  Light
 
class  OmnidirectionalLight2D
 
class  RenderTarget
 
class  SkeletalVertex
 
class  Skeleton
 
class  Texture
 Represents texture data loaded on the GPU. Contains a handle that can be passed to OpenGL draw calls. More...
 
class  VertexArray
 
class  VRamList
 A wrapped for "Vertex Buffer Object" In OpenGL, Store things in VRam. More...
 

Typedefs

typedef Vector3 Vertex
 A point that is part of an object in 3D space. More...
 
typedef Vector3 Normal
 A direction vector which describes which way a triangle is facing. More...
 
typedef Vector2 TextureCoordinate
 2D positions that describe how a texture is to be wrapped around a 3D object. More...
 

Enumerations

enum class  Direction : u8 {
  None = 0 , Vertical = 1 , Horizontal = 2 , Diagonal_NWSE = 3 ,
  Diagonal_SWNE = 4
}
 
enum class  MSAA_SAMPLE_RATE : u8 { MSAA_NONE = 0 , MSAA_2X = 1 , MSAA_4X = 2 , MSAA_8X = 3 }
 
enum class  TextureFilteringMode : u8 {
  NEAREST = 0 , BILINEAR = 1 , MIPMAP_NEAREST = 2 , MIPMAP_BILINEAR = 3 ,
  MIPMAP_TRILINEAR = 4
}
 
enum class  TextureWrappingMode : u8 { REPEAT = 0 , MIRRORED_REPEAT = 1 , CLAMP_TO_EDGE = 2 , CLAMP_TO_BORDER = 3 }
 

Functions

void Update (const Vector2 &window_size)
 
void PurgeFontCache ()
 
std::array< GLfloat, 16 > OpenGLPerspectiveProjectionRH (float fovY, float aspect, float z_near, float z_far)
 
bool MeetsRequirements ()
 Returns true if the graphics driver meets the requirements (GL Version & Extensions). More...
 
Direction operator| (Direction a, Direction b)
 
bool operator& (Direction a, Direction b)
 
bool InitTextEngine ()
 Initializes FreeType engine. Remember to call this during program initialization. More...
 
void DrawGradientLine (const Color4 &color1, const Color4 &color2, float x, float y, float w, float h, float thickness)
 
float ComputeBinomial (int n, int k)
 
CachedFontCacheFont (const Font &font, u32 size)
 

Variables

FontCache fontCache
 
Vector2 wS
 
bool j3d_initialized = false
 
float j3d_far_plane = 0
 
float j3d_fov = 0
 

Detailed Description

OpenGL Wrapper for rendering 2D & 3D graphics in both a 2D and 3D context.

TODO: FontCache mechanism works amazing, but makes no fucking sense Let's document and reorganize it to be a little nicer on the mental :)

Typedef Documentation

◆ Normal

typedef Vector3 JGL::Normal

A direction vector which describes which way a triangle is facing.

◆ TextureCoordinate

typedef Vector2 JGL::TextureCoordinate

2D positions that describe how a texture is to be wrapped around a 3D object.

◆ Vertex

typedef Vector3 JGL::Vertex

A point that is part of an object in 3D space.

Enumeration Type Documentation

◆ Direction

enum class JGL::Direction : u8
strong
Enumerator
None 
Vertical 
Horizontal 
Diagonal_NWSE 
Diagonal_SWNE 

◆ MSAA_SAMPLE_RATE

enum class JGL::MSAA_SAMPLE_RATE : u8
strong
Enumerator
MSAA_NONE 
MSAA_2X 
MSAA_4X 
MSAA_8X 

◆ TextureFilteringMode

enum class JGL::TextureFilteringMode : u8
strong
Enumerator
NEAREST 
BILINEAR 
MIPMAP_NEAREST 
MIPMAP_BILINEAR 
MIPMAP_TRILINEAR 

◆ TextureWrappingMode

enum class JGL::TextureWrappingMode : u8
strong
Enumerator
REPEAT 
MIRRORED_REPEAT 
CLAMP_TO_EDGE 
CLAMP_TO_BORDER 

Function Documentation

◆ CacheFont()

CachedFont * JGL::CacheFont ( const Font font,
u32  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeBinomial()

float JGL::ComputeBinomial ( int  n,
int  k 
)

◆ DrawGradientLine()

void JGL::DrawGradientLine ( const Color4 &  color1,
const Color4 &  color2,
float  x,
float  y,
float  w,
float  h,
float  thickness 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitTextEngine()

bool JGL::InitTextEngine ( )

Initializes FreeType engine. Remember to call this during program initialization.

Here is the call graph for this function:

◆ MeetsRequirements()

bool JGL::MeetsRequirements ( )

Returns true if the graphics driver meets the requirements (GL Version & Extensions).

◆ OpenGLPerspectiveProjectionRH()

std::array< GLfloat, 16 > JGL::OpenGLPerspectiveProjectionRH ( float  fovY,
float  aspect,
float  z_near,
float  z_far 
)
Here is the caller graph for this function:

◆ operator&()

bool JGL::operator& ( Direction  a,
Direction  b 
)
inline

◆ operator|()

Direction JGL::operator| ( Direction  a,
Direction  b 
)
inline

◆ PurgeFontCache()

void JGL::PurgeFontCache ( )
inline
Here is the call graph for this function:

◆ Update()

void JGL::Update ( const Vector2 &  window_size)
Parameters
window_size

Variable Documentation

◆ fontCache

FontCache JGL::fontCache
inline

◆ j3d_far_plane

float JGL::j3d_far_plane = 0

◆ j3d_fov

float JGL::j3d_fov = 0

◆ j3d_initialized

bool JGL::j3d_initialized = false

◆ wS

Vector2 JGL::wS