Skip to content

Commit

Permalink
Merge pull request #2843 from tgfrerer/fix-critical-vbo-attribute-copy
Browse files Browse the repository at this point in the history
fix critical issue w/ ofVbo shallow copies (custom attributes)
  • Loading branch information
arturoc committed Mar 12, 2014
2 parents 450f0f9 + f45736c commit bf4d6bc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions libs/openFrameworks/gl/ofVbo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ ofVbo::ofVbo(const ofVbo & mom){
vaoChanged = mom.vaoChanged;
}

attributeIds = mom.attributeIds;
for (map<int, GLuint>::iterator it = attributeIds.begin(); it != attributeIds.end(); it++){
retain(it->second);
}

attributeNumCoords = mom.attributeNumCoords;
attributeStrides = mom.attributeStrides;
attributeSize = mom.attributeSize;

totalVerts = mom.totalVerts;
totalIndices = mom.totalIndices;
Expand Down Expand Up @@ -230,6 +238,15 @@ ofVbo & ofVbo::operator=(const ofVbo& mom){
vaoChanged = mom.vaoChanged;
}

attributeIds = mom.attributeIds;
for (map<int, GLuint>::iterator it = attributeIds.begin(); it != attributeIds.end(); it++){
retain(it->second);
}

attributeNumCoords = mom.attributeNumCoords;
attributeStrides = mom.attributeStrides;
attributeSize = mom.attributeSize;

totalVerts = mom.totalVerts;
totalIndices = mom.totalIndices;

Expand Down

0 comments on commit bf4d6bc

Please sign in to comment.