我在 Processing ( www.processing.org) 中编写了这段代码,想知道如何使用 C++ 实现它?
int i = 0;
void setup()
{
size(1000,1000);
}
void draw()
{
// frameRate(120);
PImage slice = get();
set(0,20,slice);
if( i % 2 == 0 ) fill(128); else fill(0);
i++;
rect(0,0,width,20);
}
如您所见,这只是尽可能快地向下滚动交替颜色的矩形。 C++ 实现能这么短吗? OpenGL?
最佳答案
你也可以看看 OpenFrameworks但我怀疑任何 C++ 库都能为您提供如此简短的实现。
关于c++ - 你如何将这段代码从 Processing 翻译成 C++?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/599120/