VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Attribute.h
1 /*
2  * Copyright (C) 2014 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ATTRIBUTE_H
18 #define ATTRIBUTE_H
19 
20 #include "RendererCommon.h"
21 #include <string>
22 
31 struct Attribute {
35  std::string name;
39  GLuint size = 0;
43  GLboolean normalized = GL_FALSE;
47  GLuint type = GL_FLOAT;
48 
52  Attribute();
60  Attribute(const std::string& name, GLuint size, GLboolean normalized, GLuint type);
61 
66  int getComponentSize() const {
68  }
69 
75  static int getComponentSizeStatic(GLuint type);
76 };
77 
78 #endif // ATTRIBUTE_H
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
GLboolean normalized
Specifies whether certain types should be normalized before accessed by shaders.
Definition: Attribute.h:43
GLuint type
GL type of each component in the array.
Definition: Attribute.h:47
Attribute()
Constructor creating an empty attribute definition.
static int getComponentSizeStatic(GLuint type)
Computes the number of bytes per component for a given GL type.
GLuint size
Number of components per vertex attribute.
Definition: Attribute.h:39
The definition of a vertex attribute, such as a position vector, or a texture coordinate.
Definition: Attribute.h:31
std::string name
Name of the attribute, as specified in the shader code.
Definition: Attribute.h:35
int getComponentSize() const
Computes the number of bytes per component.
Definition: Attribute.h:66