本文整理汇总了C++中DebugDraw::DrawString方法的典型用法代码示例。如果您正苦于以下问题:C++ DebugDraw::DrawString方法的具体用法?C++ DebugDraw::DrawString怎么用?C++ DebugDraw::DrawString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DebugDraw
的用法示例。
在下文中一共展示了DebugDraw::DrawString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SimulationLoop
//Callback de desenho da GLUT, nela é chamada a rotina que chama o passo da simulação
void SimulationLoop()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//Chama a rotina que chama o passo da simulação
RunBox2D();
//Define a cor dos objetos como vermelha
b2Color color; color.r = 1.0; color.g = 0.0; color.b = 0.0;
//Desenha os objetos
b2Body *b;
for(b = world->GetBodyList(); b; b=b->GetNext())
{
DrawFixture(b->GetFixtureList(),color);
}
color.r = 1.0; color.g = 0.0; color.b = 1.0;
if (distanceJoint)
DrawJoint(distanceJoint,color);
if (revoluteJoint1)
DrawJoint(revoluteJoint1, color);
if (revoluteJoint2)
DrawJoint(revoluteJoint2, color);
if (pJoint)
DrawJoint(pJoint,color);
if (gearJoint)
DrawJoint(gearJoint,color);
if (wheelJoint1)
DrawJoint(wheelJoint1,color);
if (wheelJoint2)
DrawJoint(wheelJoint2,color);
if (pulleyJoint) //Pulley joint
{
b2Vec2 anchor1 = pulleyJoint->GetAnchorA();
b2Vec2 anchor2 = pulleyJoint->GetAnchorB();
b2Vec2 ground1 = pulleyJoint->GetGroundAnchorA();
b2Vec2 ground2 = pulleyJoint->GetGroundAnchorB();
glBegin(GL_LINES);
glVertex2f(anchor1.x,anchor1.y);
glVertex2f(ground1.x,ground1.y);
glVertex2f(anchor2.x,anchor2.y);
glVertex2f(ground2.x,ground2.y);
glVertex2f(ground1.x,ground1.y);
glVertex2f(ground2.x,ground2.y);
glEnd();
}
//Desenha as forças aplicadas
DesenhaForcasAplicadas();
//Desenhando o ponto de picking do mouse
glPointSize(5);
glBegin(GL_POINTS);
glVertex2f(mouseWorld.x,mouseWorld.y);
glEnd();
glPointSize(1);
if(desenhaLinhaGuia == true)
DesenhaLinhaGuia();
ostringstream aux1; //incluir sstream
aux1 << "Comandos: r, R, p, P, g, w, t";
renderer.DrawString(10,20,aux1.str().c_str());
glutSwapBuffers();
}