renderstack::attribute_bindings Class Reference

attribute_binding collection

#include <attribute_bindings.hpp>

Public Member Functions

void add (unsigned int index, int size, int type, unsigned char normalized, int stride, void const *pointer)
void apply (bool enable)

Detailed Description

Definition at line 122 of file attribute_bindings.hpp.


Member Function Documentation

void renderstack::attribute_bindings::add ( unsigned int  index,
int  size,
int  type,
unsigned char  normalized,
int  stride,
void const *  pointer 
) [inline]

Definition at line 125 of file attribute_bindings.hpp.

00133     {
00134         attribute_binding binding(index, size, type, normalized, stride, pointer);
00135         m_bindings.push_back(binding);
00136     }

void renderstack::attribute_bindings::apply ( bool  enable  )  [inline]

Definition at line 138 of file attribute_bindings.hpp.

00139     {
00140         for(
00141             std::vector<attribute_binding>::const_iterator i = m_bindings.begin();
00142             i != m_bindings.end();
00143             ++i
00144         )
00145         {
00146             attribute_binding const &binding = *i;
00147 
00148             if(enable == true)
00149             {
00150                 if(
00151                     (binding.type == GL_UNSIGNED_SHORT) ||
00152                     (binding.type == GL_UNSIGNED_INT)   
00153                 )
00154                 {
00155                     ::rs_gl_vertex_attrib_i_pointer(
00156                         binding.index,
00157                         binding.size,
00158                         binding.type,
00159                         binding.stride,
00160                         binding.pointer
00161                     );
00162                 }
00163                 else
00164                 {
00165                     ::rs_gl_vertex_attrib_pointer(
00166                         binding.index,
00167                         binding.size,
00168                         binding.type,
00169                         binding.normalized,
00170                         binding.stride,
00171                         binding.pointer
00172                     );
00173                 }
00174                 ::rs_gl_enable_vertex_attrib_array(binding.index);
00175             }
00176             else
00177             {
00178                 ::rs_gl_disable_vertex_attrib_array(binding.index);
00179             }
00180         }
00181     }


The documentation for this class was generated from the following file:
Generated on Sun Apr 11 12:23:11 2010 for RenderStack by  doxygen 1.6.3