void Render::drawDebugPrimitives(float avgFPS) { clearScreen(); drawBackGround(); drawPhysicWorld(); drawDebugText(avgFPS); step(); }
void drawHelpText(float startX, float startY) { for (std::vector<std::string>::iterator li = helpText.begin(); li != helpText.end(); li++, startY+=20) { const char *tmp = li->c_str(); drawSentence(tmp, startX, startY); } drawDebugText(); }
void Render::drawDebug(float avgFPS) { clearScreen(); drawBackGround(); drawCharacters(); drawFurnitures(); drawPhysicWorld(); drawDebugText(avgFPS); step(); }
//-------------------------------------------------------------- void testApp::draw() { ofBackgroundGradient(ofColor(10,10,10), ofColor::black, OF_GRADIENT_CIRCULAR); easyCam.begin(); drawFloor(); drawParticles(); easyCam.end(); kinect.drawDepth(0, 0, 160, 120); // background.drawSmoothedBg(0, 130, 160, 120); drawDebugText(); }
void Audio3DTest::render(float elapsedTime) { // Clear the color and depth buffers clear(CLEAR_COLOR_DEPTH, Vector4::zero(), 1.0f, 0); // Visit all the nodes in the scene for drawing _scene->visit(this, &Audio3DTest::drawScene); drawDebugText(0, _font->getSize()); _gamepad->draw(); drawFrameRate(_font, Vector4(0, 0.5f, 1, 1), 5, 1, getFrameRate()); }
//-------------------------------------------------------------- void ballPond::draw(){ ofSetColor(255, 255, 255, 255); background.draw(0, 0); if (bDebug) { if (bShowRGB) { kinect.draw(0, 0, ofGetWidth(), ofGetHeight()); } else if(bShowGray) { grayImage.draw(0, 0, ofGetWidth(), ofGetHeight()); } else if(bShowDepth) { kinect.drawDepth(0, 0, ofGetWidth(), ofGetHeight()); } else if(bShowContour) { contourFinder.draw(0, 0, ofGetWidth(), ofGetHeight()); } } //draw particles ofFill(); ofEnableSmoothing(); for (int i = 0; i < particles.size(); i++) { particles[i].draw(); } ofDisableSmoothing(); ofNoFill(); //draw contour ofSetLineWidth(2); for(int i=0; i<contourFinder.blobs.size(); i++) { ofBeginShape(); //ofCurveVertex(ofMap(v_arr[i][0].x, 0, 640, 0, resX, false), ofMap(v_arr[i][0].y, 0, 480, 0, resY, false)); for(int j = blobPts[i]; j>=0; j--) { //for (int j=0; j<blobPts[i]; j++) { ofSetColor(255, 255, 255); ofPoint p; p.x = v_arr[i][j].x; p.y = v_arr[i][j].y; //ofRect(ofMap(p.x, 0, 640, 0, resX, false)-2, ofMap(p.y, 0, 480, 0, resY, false)-2, 4, 4); ofCurveVertex(ofMap(p.x, 0, 640, 0, resX, false), ofMap(p.y, 0, 480, 0, resY, false)); } ofCurveVertex(ofMap(v_arr[i][blobPts[i]].x, 0, 640, 0, resX, false), ofMap(v_arr[i][blobPts[i]].y, 0, 480, 0, resY, false)); ofCurveVertex(ofMap(v_arr[i][blobPts[i]-1].x, 0, 640, 0, resX, false), ofMap(v_arr[i][blobPts[i]-1].y, 0, 480, 0, resY, false)); ofEndShape(true); } px = mouseX; py = mouseY; // DEBUG if (bDebug) { //drawDebugText(0, 300, 1024, 568); drawDebugText(0, 300, 1280, 568); } screenCapture(); distCapture(); //cout << "--------------" << endl; //cout << "blobPts[]: " << blobPts.size() << endl; //cout << "v_arr[]: " << v_arr.size() << endl; for(int i=0; i<contourFinder.blobs.size(); i++) { //cout << "v_arr[][]: " << v_arr[i].size() << endl; v_arr[i].clear(); //cout << "v_arr[][]: " << v_arr[i].size() << endl; } blobPts.clear(); v_arr.clear(); //cout << "lineStripBlob[]: " << lineStripBlob.size() << endl; //cout << "blobPts[]: " << blobPts.size() << endl; //cout << "v_arr[]: " << v_arr.size() << endl; }
void Client::render(double frameTime) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if (m_world && m_mainPlayer) { m_world->render(); } // only a client-hosted server has a chance of seeing any debug shit if (m_server) { if (!m_physicsDebugRenderer && m_world && m_world->spriteSheetRenderer()) { //FIXME:HACK: m_physicsDebugRenderer = new PhysicsDebugRenderer(m_world->spriteSheetRenderer()->camera()); // physics debug renderer first init... // m_box2DWorld->SetDebugDraw(m_physicsDebugRenderer); } if (m_physicsDebugRenderer) { int rendererFlags = 0; int settingsFlags = Settings::instance()->debugRendererFlags; bool drawingRequired = false; if (settingsFlags & Debug::RenderingDebug::ChipmunkAABBRenderingDebug) { // rendererFlags |= b2Draw::e_aabbBit; drawingRequired = true; } if (settingsFlags & Debug::RenderingDebug::ChipmunkShapeRenderingDebug) { // rendererFlags |= b2Draw::e_shapeBit; drawingRequired = true; } if (settingsFlags & Debug::RenderingDebug::ChipmunkCenterOfMassRenderingDebug) { // rendererFlags |= b2Draw::e_centerOfMassBit; drawingRequired = true; } if (settingsFlags & Debug::RenderingDebug::ChipmunkJointRenderingDebug) { // rendererFlags |= b2Draw::e_jointBit; drawingRequired = true; } if (drawingRequired) { m_physicsDebugRenderer->render(); } } } if (m_renderGUI) { drawDebugText(frameTime); m_gui->render(); } else { static int limiter = 0; ++limiter; if (limiter > 10) { limiter = 0; Debug::log(Debug::ImportantArea) << "FPS: " << (1000.0 / frameTime) << " FrameTime: " << frameTime << " ms"; } } SDL_GL_SwapWindow(m_window); }