Brenta Engine 1.0
Loading...
Searching...
No Matches
Brenta::GL Class Reference

OpenGL helper functions. More...

#include <gl_helper.hpp>

Static Public Member Functions

static void LoadOpenGL (bool gl_blending=true, bool gl_cull_face=true, bool gl_multisample=true, bool gl_depth_test=true)
 Load OpenGL.
 
static void SetPoligonMode (GLboolean enable)
 Set Poligon Mode.
 
static void SetViewport (int x, int y, int SCR_WIDTH, int SCR_HEIGHT)
 Set Viewport.
 
static void SetColor (float r, float g, float b, float a)
 Set Clear Color.
 
static void DrawArrays (GLenum mode, int first, int count)
 Draw Arrays.
 
static void DrawElements (GLenum mode, int count, GLenum type, const void *indices)
 Draw Elements.
 
static void Clear ()
 Clear.
 
static void BindVertexArray (unsigned int n)
 Enable Depth Test.
 
static GLenum glCheckError_ (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 45 of file gl_helper.hpp.

Member Function Documentation

◆ BindVertexArray()

void GL::BindVertexArray ( unsigned int n)
static

Enable Depth Test.

This function enables the depth test.

Definition at line 125 of file gl_helper.cpp.

◆ Clear()

void GL::Clear ( )
static

Clear.

This function clears the color and depth buffer.

Definition at line 119 of file gl_helper.cpp.

◆ DrawArrays()

void GL::DrawArrays ( 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 109 of file gl_helper.cpp.

◆ DrawElements()

void GL::DrawElements ( 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 114 of file gl_helper.cpp.

◆ glCheckError_()

GLenum GL::glCheckError_ ( 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 130 of file gl_helper.cpp.

◆ LoadOpenGL()

void GL::LoadOpenGL ( 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 38 of file gl_helper.cpp.

◆ SetColor()

void GL::SetColor ( 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 104 of file gl_helper.cpp.

◆ SetPoligonMode()

void GL::SetPoligonMode ( GLboolean enable)
static

Set Poligon Mode.

Parameters
enableEnable or disable poligon mode

Definition at line 84 of file gl_helper.cpp.

◆ SetViewport()

void GL::SetViewport ( 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 98 of file gl_helper.cpp.


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