void Cocos2dRenderManager::draw() { vbo_count = 0; vertex_count = 0; begin(); if (mUpdate) { mUpdate = false; onRenderToTarget(this, true); } else onRenderToTarget(this, false); end(); if (vbo_count > 0) { vbo_pf = vbo_count; vertex_pf = vertex_count; } //CCGLProgram *program = CCShaderCache::sharedShaderCache()->programForKey(kCCShader_Position_uColor); //program->use(); //program->setUniformsForBuiltins(); //static ccColor4F s_tColor = {1.0f,1.0f,1.0f,1.0f}; //program->setUniformLocationWith4fv(1, (GLfloat*) &s_tColor.r, 1); //ccVertex3F vertices[2] = { // {0, 0, -1024}, // {1024, 768, 1024} //}; //ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position ); //glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, vertices); //glDrawArrays(GL_LINES, 0, 2); }
void DummyRenderManager::drawOneFrame() { Gui* gui = Gui::getInstancePtr(); if (gui == nullptr) return; static Timer timer; static unsigned long last_time = timer.getMilliseconds(); unsigned long now_time = timer.getMilliseconds(); unsigned long time = now_time - last_time; onFrameEvent((float)((double)(time) / (double)1000)); last_time = now_time; begin(); onRenderToTarget(this, false); end(); }
void MGUI_RenderSystem::drawOneFrame() { MyGUI::Gui* gui = MyGUI::Gui::getInstancePtr(); if (gui == nullptr) return; RS_RenderEvent(RenderUI); static MGUI_Timer timer; static unsigned long last_time = timer.getMilliseconds(); unsigned long now_time = timer.getMilliseconds(); unsigned long time = now_time - last_time; onFrameEvent((float)((double)(time) / (double)1000)); last_time = now_time; begin(); onRenderToTarget(this, mUpdate); end(); mUpdate = false; }
void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation) { Gui* gui = Gui::getInstancePtr(); if (gui == nullptr) return; if (Ogre::RENDER_QUEUE_OVERLAY != queueGroupId) return; Ogre::Viewport* viewport = mSceneManager->getCurrentViewport(); if (nullptr == viewport || !viewport->getOverlaysEnabled()) return; if (mWindow->getNumViewports() <= mActiveViewport || viewport != mWindow->getViewport(mActiveViewport)) return; mCountBatch = 0; static Timer timer; static unsigned long last_time = timer.getMilliseconds(); unsigned long now_time = timer.getMilliseconds(); unsigned long time = now_time - last_time; onFrameEvent((float)((double)(time) / (double)1000)); last_time = now_time; //begin(); setManualRender(true); onRenderToTarget(this, mUpdate); //end(); // сбрасываем флаг mUpdate = false; }