gpt4 book ai didi

c++ - 开放框架 : draw function being recalled multiple times

转载 作者:行者123 更新时间:2023-11-28 06:31:25 27 4
gpt4 key购买 nike

我在 C++ 上使用 Openframeworks。我试图使用 openweathermap.org 的 api 在图形上绘制一些点。函数 plotAxes() 和 plotGraph() 被多次调用。谁能推荐我?

void ofApp::draw()
{
ofDrawBitmapString("Current Temperature Graph (openweathermap.org)", 600,50);
ofDrawBitmapString ("X-axis : Temperature in Kelvin-- One division =100K",600,600);
ofDrawBitmapString ("Y-axis : Cities-- One division =100K",600,650);
plotAxes();
plotGraph();
}

最佳答案

在 openframeworks 中调用每一帧的 draw() 方法函数。如果您希望函数 plotAxes() 和 plotGraph() 调用一次,您可以将这些函数放在 setup() 方法中。示例:

void ofApp::setup(){
plotAxes();
plotGraph();
}

关于c++ - 开放框架 : draw function being recalled multiple times,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27460540/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com