Hi guys, thanks for the help;
If you are using the default renderer it will use opengl2.
ooh i don’t know which renderer i am using; i have not specified. i should look into that.
check that you are running on release and not using a debug build
I am running latest release build 0.11.0
if you post your code
The code is below. I’ve removed tons of extra code to hopefully improve readability.
in summary of what’s happening in the code below: I have a “draw strategy” which is an interface whose implementers decide what shape to draw and how (circle, square, etc.). (for now i am only looking at drawing a circle.) Each shape is drawn inside of a “cell”. (Hence the following draw call found below)
drawManifestoPanel.getDrawStrategy().drawCell(cells[i_th_cell], drawManifestoGlobal, &drawManifestoPanel);
So, given this setup - is this too inefficient to draw up to 20,000 circles? (It’s possible that I am adding unintential bottlenecks elsewhere with all my function calls to pass objects around here and there, 20,000 times per draw call…)
ofApp:
void ofApp::draw(){
ofSetBackgroundColor(canvas.getDrawManifestoGlobal().getBackgroundColour());
canvas.getCamera().begin();
// center everything
ofTranslate(-Constants::DEFAULT_SCREEN_WIDTH/2, -Constants::DEFAULT_SCREEN_HEIGHT/2);
canvas.draw();
canvas.getCamera().end();
}
Canvas.draw()
void Canvas::draw() {
for (int i_th_cell = 0; i_th_cell < cells.size(); i_th_cell++) {
ofRotateXDeg(xRotateAmount);
ofRotateYDeg(yRotateAmount);
ofRotateZDeg(zRotateAmount);
// Main draw call (....drawCell(...))
drawManifestoPanel.getDrawStrategy().drawCell(cells[i_th_cell], drawManifestoGlobal, &drawManifestoPanel);
}
}
drawManifestoPanel.getDrawStrategy()
IVectorShapeBehavior &DrawManifestoPanel::getDrawStrategy() {
IVectorShapeBehavior * drawStrategy = vectorShapesStrategies[drawStrategyIndex];
return *drawStrategy;
}
…drawCell(…)
void VectorShapeCircleClassic::drawCell(Cell & _cell, DrawManifestoGlobal * drawManifestoGlobal, DrawManifestoPanel * _drawManifestoPanel) const {
// ... float x = ...
ofPushMatrix();
// ... ofTranslate ...
ofDrawCircle(
x,
y,
z,
size
);
ofPopMatrix();
}
}