Lines Matching defs:attrib

124     const VertexAttrib& attrib = iter->second;
125 if (attrib.owned_data)
126 delete[] attrib.owned_data;
955 VertexAttrib attrib;
956 attrib.is_const = false;
957 attrib.index = var;
958 attrib.components = components;
959 attrib.normalized = normalize;
960 attrib.stride = stride;
961 attrib.type = type;
962 attrib.vbo = vbo->GetVboId();
963 attrib.offset = offset;
965 return StoreAttribute(attrib);
981 VertexAttrib attrib;
982 attrib.is_const = false;
983 attrib.index = var;
984 attrib.components = components;
985 attrib.normalized = normalize;
986 attrib.stride = stride;
987 attrib.type = type;
988 attrib.values = data + offset;
990 return StoreAttribute(attrib);
1021 VertexAttrib attrib;
1022 attrib.is_const = false;
1023 attrib.index = var;
1024 attrib.components = components;
1025 attrib.normalized = false;
1026 attrib.stride = components * sizeof(float);
1027 attrib.type = GL_FLOAT;
1028 attrib.values = data_cpy;
1029 attrib.owned_data = data_cpy; // Marks this for deletion later on
1031 if (StoreAttribute(attrib))
1038 bool ShaderProgram::StoreAttribute(VertexAttrib attrib) {
1039 if (attrib.index >= 0) {
1040 attrib_values_[attrib.index] = attrib;
1050 const VertexAttrib& attrib = iter->second;
1052 if (attrib.is_const) {
1054 if (!attrib.values)
1057 const float* values = reinterpret_cast<const float*>(attrib.values);
1058 switch (attrib.components) {
1059 case 1: glVertexAttrib1fv(attrib.index, values); break;
1060 case 2: glVertexAttrib2fv(attrib.index, values); break;
1061 case 3: glVertexAttrib3fv(attrib.index, values); break;
1062 case 4: glVertexAttrib4fv(attrib.index, values); break;
1065 glDisableVertexAttribArray(attrib.index);
1068 if (attrib.values) {
1072 glVertexAttribPointer(attrib.index,
1073 attrib.components,
1074 attrib.type,
1075 attrib.normalized,
1076 attrib.stride,
1077 attrib.values);
1078 } else if (attrib.vbo) {
1080 glBindBuffer(GL_ARRAY_BUFFER, attrib.vbo);
1082 glVertexAttribPointer(attrib.index,
1083 attrib.components,
1084 attrib.type,
1085 attrib.normalized,
1086 attrib.stride,
1087 reinterpret_cast<const void*>(attrib.offset));
1091 glEnableVertexAttribArray(attrib.index);