Brenta Engine 1.1
Loading...
Searching...
No Matches
brenta::gl Class Reference

OpenGL helper functions. More...

#include <gl_helper.hpp>

Static Public Member Functions

static void load_opengl (bool gl_blending=true, bool gl_cull_face=true, bool gl_multisample=true, bool gl_depth_test=true)
 Load OpenGL.
 
static void set_poligon_mode (GLboolean enable)
 Set Poligon Mode.
 
static void set_viewport (int x, int y, int SCR_WIDTH, int SCR_HEIGHT)
 Set Viewport.
 
static void set_color (float r, float g, float b, float a)
 Set Clear Color.
 
static void draw_arrays (GLenum mode, int first, int count)
 Draw Arrays.
 
static void draw_elements (GLenum mode, int count, GLenum type, const void *indices)
 Draw Elements.
 
static void clear ()
 Clear.
 
static void bind_vertex_array (unsigned int n)
 Enable Depth Test.
 
static GLenum check_error_ (const char *file, int line)
 Check OpenGL error.
 

Detailed Description

OpenGL helper functions.

This class contains helper functions to interact with OpenGL.

Definition at line 43 of file gl_helper.hpp.

Member Function Documentation

◆ bind_vertex_array()

void gl::bind_vertex_array ( unsigned int n)
static

Enable Depth Test.

This function enables the depth test.

Definition at line 123 of file gl_helper.cpp.

◆ check_error_()

GLenum gl::check_error_ ( const char * file,
int line )
static

Check OpenGL error.

This function checks if there is an OpenGL error.

Returns
The error code

Definition at line 128 of file gl_helper.cpp.

◆ clear()

void gl::clear ( )
static

Clear.

This function clears the color and depth buffer.

Definition at line 117 of file gl_helper.cpp.

◆ draw_arrays()

void gl::draw_arrays ( GLenum mode,
int first,
int count )
static

Draw Arrays.

This function draws primitives from the array data.

Parameters
modeSpecifies what kind of primitives to render
firstSpecifies the starting index in the enabled arrays
countSpecifies the number of indices to be rendered

Definition at line 107 of file gl_helper.cpp.

◆ draw_elements()

void gl::draw_elements ( GLenum mode,
int count,
GLenum type,
const void * indices )
static

Draw Elements.

This function draws primitives from the array data.

Parameters
modeSpecifies what kind of primitives to render
countSpecifies the number of elements to be rendered
typeSpecifies the type of the values in indices
indicesSpecifies a pointer to the location where the indices are stored

Definition at line 112 of file gl_helper.cpp.

◆ load_opengl()

void gl::load_opengl ( bool gl_blending = true,
bool gl_cull_face = true,
bool gl_multisample = true,
bool gl_depth_test = true )
static

Load OpenGL.

This function loads OpenGL and sets some default values.

Parameters
gl_blendingEnable blending
gl_cull_faceEnable face culling
gl_multisampleEnable multisampling
gl_depth_testEnable depth testing

Definition at line 37 of file gl_helper.cpp.

◆ set_color()

void gl::set_color ( float r,
float g,
float b,
float a )
static

Set Clear Color.

This function sets the clear color of the window.

Parameters
rRed component of the clear color
gGreen component of the clear color
bBlue component of the clear color
aAlpha component of the clear color

Definition at line 102 of file gl_helper.cpp.

◆ set_poligon_mode()

void gl::set_poligon_mode ( GLboolean enable)
static

Set Poligon Mode.

Parameters
enableEnable or disable poligon mode

Definition at line 83 of file gl_helper.cpp.

◆ set_viewport()

void gl::set_viewport ( int x,
int y,
int SCR_WIDTH,
int SCR_HEIGHT )
static

Set Viewport.

This function sets the viewport of the window.

Parameters
xX coordinate of the viewport
yY coordinate of the viewport
SCR_WIDTHWidth of the viewport
SCR_HEIGHTHeight of the viewport

Definition at line 97 of file gl_helper.cpp.


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