DubiousEngine  0.2.0
Simple Game Engine
Dubious::Renderer::Open_gl_attributes Class Reference

OpenGLAttributes. More...

#include <Open_gl_attributes.h>

Public Types

enum  Group_bits {
  ENABLE_BIT = GL_ENABLE_BIT, DEPTH_BUFFER_BIT = GL_DEPTH_BUFFER_BIT, COLOR_BUFFER_BIT = GL_COLOR_BUFFER_BIT, STENCIL_BUFFER_BIT = GL_STENCIL_BUFFER_BIT,
  HINT_BIT = GL_HINT_BIT, POLYGON_BIT = GL_POLYGON_BIT, LIGHTING_BIT = GL_LIGHTING_BIT, TEXTURE_BIT = GL_TEXTURE_BIT,
  PIXEL_MODE_BIT = GL_PIXEL_MODE_BIT, ALL_ATTRIB_BITS = GL_ALL_ATTRIB_BITS
}
 GroupBits describe the different grouping of attribute bits. More...
 
enum  Attr_bits {
  TEXTURE_2D = GL_TEXTURE_2D, BLEND = GL_BLEND, LIGHTING = GL_LIGHTING, LIGHT0 = GL_LIGHT0,
  SCISSOR_TEST = GL_SCISSOR_TEST, DEPTH_TEST = GL_DEPTH_TEST, STENCIL_TEST = GL_STENCIL_TEST, LINE_SMOOTH = GL_LINE_SMOOTH,
  CULL_FACE = GL_CULL_FACE, COLOR_MATERIAL = GL_COLOR_MATERIAL
}
 the actual attribute bits More...
 

Public Member Functions

 Open_gl_attributes (int group_bit_field, bool push_stack)
 Constructor. More...
 
 Open_gl_attributes (const Open_gl_attributes &)=delete
 
 ~Open_gl_attributes ()
 Destructor. More...
 
Open_gl_attributesoperator= (const Open_gl_attributes &)=delete
 
void enable (Attr_bits bit_field) const
 glEnable More...
 
void disable (Attr_bits bit_field) const
 glDisable More...
 
void light_position (int light, const Math::Point &position) const
 Sets the light position information. More...
 
void light_color (int light, int type, const Renderer::Color &color) const
 Sets the light color. More...
 

Static Public Member Functions

static void clear (int group_bit_field)
 glClear More...
 
static void depth_func (int func)
 glDepthFunc More...
 
static void blend_func (int s_factor, int d_factor)
 glBlendFunc More...
 
static void stencil_func (int func, int ref, unsigned int mask)
 glStencilFunc More...
 
static void color_mask (bool red, bool green, bool blue, bool alpha)
 glColorMask More...
 
static void depth_mask (bool flag)
 glDepthMask More...
 
static void stencil_op (int fail, int z_fail, int z_pass)
 glStencilOp More...
 

Detailed Description

OpenGLAttributes.

The Attributes object is meant to help make sure that you are correctly setting bits. You can also use it to push and pop the attribute stack. Mostly it's meant to check that you're setting a bit that belongs to the correct group bit.

Member Enumeration Documentation

the actual attribute bits

Enumerator
TEXTURE_2D 
BLEND 
LIGHTING 
LIGHT0 
SCISSOR_TEST 
DEPTH_TEST 
STENCIL_TEST 
LINE_SMOOTH 
CULL_FACE 
COLOR_MATERIAL 

GroupBits describe the different grouping of attribute bits.

Enumerator
ENABLE_BIT 
DEPTH_BUFFER_BIT 
COLOR_BUFFER_BIT 
STENCIL_BUFFER_BIT 
HINT_BIT 
POLYGON_BIT 
LIGHTING_BIT 
TEXTURE_BIT 
PIXEL_MODE_BIT 
ALL_ATTRIB_BITS 

Constructor & Destructor Documentation

Dubious::Renderer::Open_gl_attributes::Open_gl_attributes ( int  group_bit_field,
bool  push_stack 
)

Constructor.

Specify the group bits and whether or not you want to push the attribute stack. If it is pushed then the destructor will pop it.

Parameters
group_bit_field- [in] Group bits describe what kind of bits you will be changing. If you try to change bits that are not part of the GroupBit it will generate an assertion in debug
push_stack- [in] whether or not you want to push
Dubious::Renderer::Open_gl_attributes::Open_gl_attributes ( const Open_gl_attributes )
delete
Dubious::Renderer::Open_gl_attributes::~Open_gl_attributes ( )

Destructor.

If PushStack was specified in the constructor then this will pop the stack

Member Function Documentation

static void Dubious::Renderer::Open_gl_attributes::blend_func ( int  s_factor,
int  d_factor 
)
inlinestatic

glBlendFunc

void Dubious::Renderer::Open_gl_attributes::clear ( int  group_bit_field)
static

glClear

static void Dubious::Renderer::Open_gl_attributes::color_mask ( bool  red,
bool  green,
bool  blue,
bool  alpha 
)
inlinestatic

glColorMask

static void Dubious::Renderer::Open_gl_attributes::depth_func ( int  func)
inlinestatic

glDepthFunc

static void Dubious::Renderer::Open_gl_attributes::depth_mask ( bool  flag)
inlinestatic

glDepthMask

void Dubious::Renderer::Open_gl_attributes::disable ( Attr_bits  bit_field) const

glDisable

void Dubious::Renderer::Open_gl_attributes::enable ( Attr_bits  bit_field) const

glEnable

void Dubious::Renderer::Open_gl_attributes::light_color ( int  light,
int  type,
const Renderer::Color color 
) const

Sets the light color.

Parameters
light- [in] LIGHT0
type- [in] GL_AMBIENT, GL_DIFFUSE, or GL_SPECULAR
color- [in] what color you want it to be
void Dubious::Renderer::Open_gl_attributes::light_position ( int  light,
const Math::Point position 
) const

Sets the light position information.

Parameters
light- [in] LIGHT0
position- [in] For now I only do directional lights.
Open_gl_attributes& Dubious::Renderer::Open_gl_attributes::operator= ( const Open_gl_attributes )
delete
static void Dubious::Renderer::Open_gl_attributes::stencil_func ( int  func,
int  ref,
unsigned int  mask 
)
inlinestatic

glStencilFunc

static void Dubious::Renderer::Open_gl_attributes::stencil_op ( int  fail,
int  z_fail,
int  z_pass 
)
inlinestatic

glStencilOp


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