//-------------------------------------------------------------- // render the world void ChunkWorld::render() { m_chunkLock->lock(); // figure which chunk we are in mgPoint3 eyePt; mgDisplay->getEyePt(eyePt); int viewX = (int) floor(eyePt.x / CHUNK_SIZE); int viewZ = (int) floor(eyePt.z / CHUNK_SIZE); drawHorizon(viewX, viewZ); // render all neighbors in the view list for (int i = m_viewListCount-1; i >= 0; i--) { ChunkOrigin* origin = &m_viewList[i]; int x = CHUNK_SIZE*(viewX + origin->x); int z = CHUNK_SIZE*(viewZ + origin->z); const void* value; if (!m_chunkTable.lookup(x, 0, z, value)) continue; // outside world bounds ChunkObj* chunk = (ChunkObj*) value; // if chunk loaded and within view, render it if (chunk->m_status == CHUNK_INDISPLAY || chunk->m_status == CHUNK_NEEDSUPDATE) { chunk->render(this); } else drawWater(x, z); } m_chunkLock->unlock(); }
//-------------------------------------------------------------- void testApp::draw(){ drawHorizon(); // Structured rectangles ofSetColor(0, 255*meters[0], 255); // ofRect(rectX, rectY, rectSize, rectSize); }
void GimbalWidget::paintEvent(QPaintEvent *event) { QPainter painter(this); drawHorizon(painter); drawPitchMarkers(painter); }