Deep Learning Visualizer
Interactive visualization of basic applications of deep learning
Loading...
Searching...
No Matches
engine::graphics::renderer Class Reference

OpenGL renderer that uses batch rendering. More...

#include <renderer.h>

Public Member Functions

 renderer ()
 Constructs the renderer; reserves memory in the vertices vector.
 
 ~renderer ()
 Destructor that cleans up the VAO and VBO.
 
 renderer (const renderer &)=delete
 
renderer & operator= (const renderer &)=delete
 
 renderer (renderer &&)=delete
 
renderer & operator= (renderer &&)=delete
 
void begin_frame ()
 Begins a frame by clearing the vertices buffer.
 
void end_frame ()
 Ends a frame by clearing what is currently drawn and drawing the vertices.
 
void set_color (const Eigen::Vector3f &color)
 Sets the current color used when buffering shapes to be drawn.
 
void draw_triangle (const Eigen::Vector2f &p1, const Eigen::Vector2f &p2, const Eigen::Vector2f &p3)
 Buffers a triangle to be drawn when the frame ends.
 
void draw_quad (const Eigen::Vector2f &p1, const Eigen::Vector2f &p2, const Eigen::Vector2f &p3, const Eigen::Vector2f &p4)
 Buffers a quad to be drawn when the frame ends.
 
void draw_line (const Eigen::Vector2f &p1, const Eigen::Vector2f &p2, float thickness)
 Buffers a line to be drawn when the frame ends.
 
void draw_text (const Eigen::Vector2f &position, const std::string &text)
 Buffers text to be drawn when the frame ends.
 

Detailed Description

OpenGL renderer that uses batch rendering.

Member Function Documentation

◆ begin_frame()

void engine::graphics::renderer::begin_frame ( )

Begins a frame by clearing the vertices buffer.

Should be called before submitting shapes to the renderer.

◆ draw_line()

void engine::graphics::renderer::draw_line ( const Eigen::Vector2f &  p1,
const Eigen::Vector2f &  p2,
float  thickness 
)

Buffers a line to be drawn when the frame ends.

Parameters
p1The first point of the line.
p2The second point of the line.
thicknessThe thickness of the line.

◆ draw_quad()

void engine::graphics::renderer::draw_quad ( const Eigen::Vector2f &  p1,
const Eigen::Vector2f &  p2,
const Eigen::Vector2f &  p3,
const Eigen::Vector2f &  p4 
)

Buffers a quad to be drawn when the frame ends.

Parameters
p1The first point of the quad.
p2The second point of the quad.
p3The third point of the quad.
p4The fourth point of the quad.

◆ draw_text()

void engine::graphics::renderer::draw_text ( const Eigen::Vector2f &  position,
const std::string &  text 
)

Buffers text to be drawn when the frame ends.

TODO: function is not implemented yet

◆ draw_triangle()

void engine::graphics::renderer::draw_triangle ( const Eigen::Vector2f &  p1,
const Eigen::Vector2f &  p2,
const Eigen::Vector2f &  p3 
)

Buffers a triangle to be drawn when the frame ends.

Parameters
p1The first point of the triangle.
p2The second point of the triangle.
p3The third point of the triangle.

◆ set_color()

void engine::graphics::renderer::set_color ( const Eigen::Vector3f &  color)
inline

Sets the current color used when buffering shapes to be drawn.

Parameters
colorA RGB color vector.

The documentation for this class was generated from the following files: