1#include "AttributesGL20.h"
9 const char * PositionSemantics [] = {
20 const char * NormalSemantics [] = {
31 const char * ColorSemantics [] = {
42 const char * TexCoordSemantics [] = {
53 const char * TangentSemantics [] = {
64 const char * VectorSemantics [] = {
75 const char * MatrixSemantics [] = {
86 const char ** Semantics [] = {
96 STATIC_ASSERT_MAPPING(Semantics, ElementSemantic::Semantic_Size);
101 const char * PositionSemantics [] = {
112 const char * ColorSemantics [] = {
123 const char * NormalSemantics [] = {
134 const char * TexCoordSemantics [] = {
145 const char * TangentSemantics [] = {
156 const char * VectorSemantics [] = {
167 const char * MatrixSemantics [] = {
178 const char ** Semantics [] = {
188 STATIC_ASSERT_MAPPING(Semantics, ElementSemantic::Semantic_Size);
193void Cogs::AttributesGL20::initialize()
195 GLint maxVertexAttribs;
196 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
198 for (
size_t i = 0; i < MaxVertexAttributesGL20; ++i) {
199 const char * name = OpenGL20::GLSL::Semantics[i % NumAttributeSemanticsGL20][i / NumAttributeSemanticsGL20];
201 this->attributeIndexes[std::string(name)] =
static_cast<GLint
>(i);
203 name = OpenGL20::HLSL::Semantics[i % NumAttributeSemanticsGL20][i / NumAttributeSemanticsGL20];
205 this->attributeIndexesHLSL[std::string(name)] =
static_cast<GLint
>(i);
209GLint Cogs::AttributesGL20::getAttributeIndex(
const std::string & name,
bool hlsl)
211 auto & attributes = hlsl ? attributeIndexesHLSL : attributeIndexes;
213 auto it = attributes.find(name);
215 if (it == attributes.end()) {
216 return GL_INVALID_INDEX;
Contains all Cogs related functionality.
@ OpenGL20
Graphics device using OpenGL, supporting at least OpenGL 2.0.