Skip to content

Instantly share code, notes, and snippets.

@anlsh
Created June 26, 2015 04:24
Show Gist options
  • Save anlsh/f97dc1244a02485bc04b to your computer and use it in GitHub Desktop.
Save anlsh/f97dc1244a02485bc04b to your computer and use it in GitHub Desktop.
#include "common.h"
int main() {
std::vector<GLfloat> source = {1, 2, 3, 4, 5, 6, 5, 6, 1, 2, 7, 8};
std::vector<GLfloat> * optimized_verts = new std::vector<GLfloat>();
std::vector<GLint> ebo = {};
common::GenOptimizedArrays<GLfloat, GLint>(2, &source, optimized_verts, &ebo);
for (int y = 0; y < optimized_verts->size(); y++) {
std::cout << (*optimized_verts)[y] << " ";
}
std::cout << "\n";
for(int x = 0; x < ebo.size(); x++) {
std::cout << ebo[x] << " ";
}
return 0;
}
/* prints
1 2 3 4 5 6 7 8
0 1 2 2 0 3
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment