私のプログラムが起動したら、背景に円を表示する必要があります。また、表示されているすべての円を制御する必要があります。私はその目的のためにclass VertexController
andを使用します。私にはコンストラクタがありますclass Vertex
:Vertex
Vertex::Vertex(const ci::Vec2f & CurrentLoc){
vColor = Color(Rand::randFloat(123.0f),Rand::randFloat(123.0f),Rand::randFloat(123.0f));
vRadius = Rand::randFloat(23.0f);
vLoc = CurrentLoc;
}
そしてVertexController
私は持っています
VertexController::VertexController()
{
Vertex CenterVertex = Vertex(getWindowCenter());
CenterVertex.draw(); // function-member draw solid circle with random color
}
そしてsetup{}
私が書いた方法で
void TutorialApp::setup(){
gl::clear(Color(255,204,0));
mVertexController=VertexController();
}
残念ながら、私の方法はうまくいきませんでした。背景しか見えません。では主な質問 - CINDER_APP_BASIC では、draw{}、update{}、setup{} でのみ直接描画が可能ですか? はいの場合は、解決策をアドバイスしてください。