void RenderablePath::update(const UpdateData& data) { if (data.isTimeJump) _needsSweep = true; if (_needsSweep) { calculatePath(_observer); sendToGPU(); _needsSweep = false; } if (_programObject->isDirty()) _programObject->rebuildFromFile(); }
Geometry::Geometry(int n_vertex, std::vector<int> attributes, const float* data) : n_vertex(n_vertex), attributes(attributes) { // save to RAM raw_data.reserve(n_vertex * getColumns()); for(int i = 0; i < n_vertex * getColumns(); i++) { raw_data.push_back(data[i]); } glGenVertexArrays(1, &vertex_array); glGenBuffers(1, &vertex_buffer); sendToGPU(); }
void Geometry::notifyDataChange() { sendToGPU(); }