Esempio n. 1
0
NS_CC_BEGIN

void CCShapeNode::draw(void)
{
    beforeDraw();
    drawProc();
    afterDraw();
}
Esempio n. 2
0
void StApplication::processEvents() {
    if(myWindow.isNull() || !myIsOpened) {
        return; // nothing to do
    }

    if(myToQuit) {
        // force Render to quit
        myWindow->beforeClose();
        myWindow->close();
        myIsOpened = false;
        myToQuit   = false;
        return;
    }

    // common callback call
    myWindow->processEvents();

    // application-specific queued events
    myEventsBuffer->swapBuffers();
    for(size_t anEventIter = 0; anEventIter < myEventsBuffer->getSize(); ++anEventIter) {
        StEvent& anEvent = myEventsBuffer->changeEvent(anEventIter);
        if(anEvent.Type == stEvent_Action) {
            doAction(anEvent.Action);
        }
    }

    // draw iteration
    beforeDraw();
    myWindow->stglDraw();

    const StString aDevice = myWindow->getDeviceId();
    const int32_t  aDevNum = params.ActiveDevice->getValue();
    if(!mySwitchTo.isNull()) {
        if(!resetDevice()) {
            myToQuit = true;
        }
        mySwitchTo.nullify();
    } else if(myWindow->isLostDevice()) {
        mySwitchTo = myWindow;
        if(!resetDevice()) {
            myToQuit = true;
        }
        mySwitchTo.nullify();
    } else if(aDevNum >= 0
           && size_t(aDevNum) < myDevices.size()
           && aDevice != myDevices[aDevNum]->DeviceId) {
        // device was changed by renderer itself - synchronize value
        const StString aPlugin = myWindow->getRendererId();
        for(size_t aDevIter = 0; aDevIter < myDevices.size(); ++aDevIter) {
            const StHandle<StOutDevice>& anOutDev = myDevices[aDevIter];
            if(aPlugin == anOutDev->PluginId
            && aDevice == anOutDev->DeviceId) {
                params.ActiveDevice->setValue((int32_t )aDevIter);
                break;
            }
        }
    }
}
Esempio n. 3
0
File: Node.cpp Progetto: crvv/simple
void Node::draw(Renderer *renderer) {
    if (drawable) {
        beforeDraw(renderer);
        drawGeometry();
        afterDraw(renderer);
    }
    for (auto &node : children) {
        node->draw(renderer);
    }
}
Esempio n. 4
0
void MyWidget::connectSignalSlot() {
    connect(newAct, SIGNAL(triggered()), this, SLOT(newChart()));
    connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
    connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
    connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
    connect(exitAct, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(addRow, SIGNAL(clicked()), this, SLOT(add()));
    connect(removeRow, SIGNAL(clicked()), this, SLOT(remove()));
    connect(draw, SIGNAL(clicked()), this, SLOT(beforeDraw()));
}
void PostProcessingPass::apply(FrameBuffer& frameBuffer, const RenderMetaData& metadata) {
    if (!m_enabled) {
        return;
    }
    if (!m_program) {
        initialize();
    }

    beforeDraw(frameBuffer);

    m_program->use();
    m_quad->draw();
    m_program->release();
}
Esempio n. 6
0
void ClippingArea::visit()
{
    //判断是否需要裁剪
    if (!isVisible() || !isClipping() || !m_Stencil)
    {
        //不需要裁剪的话直接执行CCNode的visit函数
        return CCNode::visit();
    }

    //裁减开始
    beforeDraw();

    //执行CCNode
    CCNode::visit();
    
    //裁减结束
    afterDraw();
}
Esempio n. 7
0
//todo: clean this
void Train::draw(bool shadows)
{
	if(!visible)
		return;
	for(int i = 0; i < bogeys; ++i ){
		if(quant)
			World::track.getQPoint(positionOnTrack-i*5,*this);
		else
			World::track.getPoint(positionOnTrack-i*5,*this);
		beforeDraw();
		glTranslatef(0,2.0f,0);
		if(shadows)
			glColor3ub(0,0,0);
		else if(i == 0)
			glColor3ub(255,0,0);
		else
			glColor3ub(255,255,255);
		body.draw();
		afterDraw();
	}
}
Esempio n. 8
0
void ModelCube::Draw() {
	beforeDraw();
	mesh->DrawSubset(0);
	afterDraw();
}
Esempio n. 9
0
void ModelTeapot::Draw() {
	beforeDraw();
	mesh->DrawSubset(0);
	afterDraw();
}