コード例 #1
0
ファイル: window_iki.cpp プロジェクト: mekolat/elektrogamesvn
void Windowiki::draw(gcn::Graphics *graphics)
{
    Graphics *g = static_cast<Graphics*>(graphics);

    g->drawImageRect(0, 0, getWidth(), getHeight(), borderiki);

    // Draw title
    if (mShowTitle)
    {
        graphics->setFont(getFont());
        graphics->drawText(getCaption(), 7, 5, gcn::Graphics::LEFT);
    }

    g->drawImage(sagustImage, getWidth() - sagustImage->getWidth(),
            0);
    if (mCloseButton)
    {
        g->drawImage(closeImage,
            getWidth() - closeImage->getWidth(),
            0
        );
    }
    g->drawImage(solustImage, 0,0);

    g->drawImage(sagaltImage, getWidth() - sagaltImage->getWidth(),
            getHeight() - sagaltImage->getHeight());
    g->drawImage(solaltImage, 0,getHeight() - solaltImage->getHeight() );
    drawChildren(graphics);
}
コード例 #2
0
void ConnectionDialog::draw(gcn::Graphics *graphics)
{
    BLOCK_START("ConnectionDialog::draw")
    // Don't draw the window background, only draw the children
    drawChildren(graphics);
    BLOCK_END("ConnectionDialog::draw")
}
コード例 #3
0
ファイル: scrollarea.cpp プロジェクト: bombpersons/Dokuro2
    void ScrollArea::draw(Graphics *graphics)
    {
        drawBackground(graphics);

        if (mVBarVisible)
        {
            drawUpButton(graphics);
            drawDownButton(graphics);
            drawVBar(graphics);
            drawVMarker(graphics);
        }

        if (mHBarVisible)
        {
            drawLeftButton(graphics);
            drawRightButton(graphics);
            drawHBar(graphics);
            drawHMarker(graphics);
        }

        if (mHBarVisible && mVBarVisible)
        {
            graphics->setColor(getBaseColor());
            graphics->fillRectangle(Rectangle(getWidth() - mScrollbarWidth,
                                              getHeight() - mScrollbarWidth,
                                              mScrollbarWidth,
                                              mScrollbarWidth));
        }

        drawChildren(graphics);
    }
コード例 #4
0
ファイル: tabbedarea.cpp プロジェクト: B-Rich/mana
void TabbedArea::draw(gcn::Graphics *graphics)
{
    if (mTabs.empty())
        return;

    drawChildren(graphics);
}
コード例 #5
0
ファイル: uiwidget.cpp プロジェクト: Pucker/otclient
void UIWidget::draw(const Rect& visibleRect, Fw::DrawPane drawPane)
{
    Rect oldClipRect;
    if(m_clipping) {
        oldClipRect = g_painter->getClipRect();
        g_painter->setClipRect(visibleRect);
    }

    if(m_rotation != 0.0f) {
        g_painter->pushTransformMatrix();
        g_painter->rotate(m_rect.center(), m_rotation * (Fw::pi / 180.0));
    }

    drawSelf(drawPane);

    if(m_children.size() > 0) {
        if(m_clipping)
            g_painter->setClipRect(visibleRect.intersection(getPaddingRect()));

        drawChildren(visibleRect, drawPane);
    }

    if(m_rotation != 0.0f)
        g_painter->popTransformMatrix();

    if(m_clipping) {
        g_painter->setClipRect(oldClipRect);
    }
}
コード例 #6
0
void GUIListGadget::draw()
{
    if (!isVisible_ || isValidated_ || !setupClipping())
        return;
    
    GlbRenderSys->draw2DRectangle(Rect_, Color_);
    
    /* Draw all item entries */
    s32 ItemPos = 0;
    for (std::list<GUIListItem*>::iterator it = ItemList_.begin(); it != ItemList_.end(); ++it)
    {
        drawItem(*it, ItemPos);
        ItemPos += (*it)->getItemSize();
    }
    
    /* Draw all column entries */
    s32 ColumnPos = 0;
    for (std::list<GUIListColumn*>::iterator it = ColumnList_.begin(); it != ColumnList_.end(); ++it)
    {
        drawColumn(*it, ColumnPos);
        ColumnPos += (*it)->getColumnSize();
    }
    
    /* Update scrollbar ranges */
    HorzScroll_.setRange(ColumnPos);
    VertScroll_.setRange(ItemPos + COLUMN_HEIGHT);
    
    drawChildren();
    
    GlbRenderSys->setClipping(true, dim::point2di(VisRect_.Left, VisRect_.Top), VisRect_.getSize());
    
    drawFrame(Rect_, 0, false);
}
コード例 #7
0
ファイル: window.cpp プロジェクト: Ablu/invertika
void Window::draw(gcn::Graphics *graphics)
{
    Graphics *g = static_cast<Graphics*>(graphics);

    g->drawImageRect(0, 0, getWidth(), getHeight(), mSkin->getBorder());

    // Draw title
    if (mShowTitle)
    {
        g->setColor(Theme::getThemeColor(Theme::TEXT));
        g->setFont(getFont());
        g->drawText(getCaption(), 7, 5, gcn::Graphics::LEFT);
    }

    // Draw Close Button
    if (mCloseButton)
    {
        g->drawImage(mSkin->getCloseImage(),
            getWidth() - mSkin->getCloseImage()->getWidth() - getPadding(),
            getPadding());
    }

    // Draw Sticky Button
    if (mStickyButton)
    {
        Image *button = mSkin->getStickyImage(mSticky);
        int x = getWidth() - button->getWidth() - getPadding();
        if (mCloseButton)
            x -= mSkin->getCloseImage()->getWidth();

        g->drawImage(button, x, getPadding());
    }

    drawChildren(graphics);
}
コード例 #8
0
ファイル: Container.cpp プロジェクト: danielmorena/ofxmarek
void xmlgui::Container::draw() {
	if(bgImage!=NULL) {
		bgImage->draw(x, y, width, height);

	}
	drawChildren();
}
コード例 #9
0
void NodeControl::drawBody(GlInterface &gl)
{
	drawBackground(gl);

	//Draw connectors underneath selection outline
	drawChildren(gl);

	if(selected)
	{
		Color col = (isInFocus() ? Color(0.3f, 1.0f, 0.3f, 1.0f) : Color(0.1f, 0.75f, 0.75f, 1.0f));

		std::vector<TVertex> points;
		points.reserve(5);

		points.push_back(TVertex(APoint(0, 0), col));
		points.push_back(TVertex(APoint(0, size.y), col));
		points.push_back(TVertex(size, col));
		points.push_back(TVertex(APoint(size.x, 0), col));
		points.push_back(TVertex(APoint(0, 0), col));

		gl.drawShape(GL_LINE_STRIP, points);
	}

	//TODO: rest of body design (title, description, colors, etc)
}
コード例 #10
0
ファイル: scenenode.cpp プロジェクト: Blake-Lead/SFML-Project
void SceneNode::draw(sf::RenderTarget & target, sf::RenderStates states) const
{
	states.transform *= getTransform();

	drawCurrent(target, states);
	drawChildren(target, states);
}
コード例 #11
0
ファイル: tab.cpp プロジェクト: TonyRice/mana
void Tab::draw(gcn::Graphics *graphics)
{
    int mode = TAB_STANDARD;

    // check which type of tab to draw
    if (mTabbedArea)
    {
        mLabel->setForegroundColor(*mTabColor);
        if (mTabbedArea->isTabSelected(this))
        {
            mode = TAB_SELECTED;
            // if tab is selected, it doesnt need to highlight activity
            mFlash = false;
        }
        else if (mHasMouse)
        {
            mode = TAB_HIGHLIGHTED;
        }
        if (mFlash)
        {
            mLabel->setForegroundColor(Theme::getThemeColor(Theme::TAB_FLASH));
        }
    }

    updateAlpha();

    // draw tab
    static_cast<Graphics*>(graphics)->
        drawImageRect(0, 0, getWidth(), getHeight(), tabImg[mode]);

    // draw label
    drawChildren(graphics);
}
コード例 #12
0
void Renderable::render() {
    glPushMatrix();
    setMatrix();
    drawChildren();

    if (vertexColors && colorBuffer != NULL) {
        glEnableClientState(GL_COLOR_ARRAY);
        glColorPointer(4, GL_FLOAT, 0, colorBuffer);
    } else {
        glColor4f(objectColor.r, objectColor.g, objectColor.b, objectColor.a);
    }
    if (nFaces > 0) {
//		__android_log_print(ANDROID_LOG_DEBUG,"Renderable","rendering self. nFaces = %d", nFaces);
        glEnableClientState(GL_VERTEX_ARRAY);
        glVertexPointer(3, GL_FLOAT, 0, vertexBuffer);
        if (vertexNormalBuffer != NULL) {
//			__android_log_print(ANDROID_LOG_DEBUG,"Renderable","vertexNormal enabled");
            glEnableClientState(GL_NORMAL_ARRAY);
            glNormalPointer(GL_FLOAT, 0, vertexNormalBuffer);
        }
        glDrawElements(GL_TRIANGLES, nFaces, GL_UNSIGNED_SHORT, faceBuffer);
        glDisableClientState(GL_VERTEX_ARRAY);
        glDisableClientState(GL_NORMAL_ARRAY);
    }
    if (vertexColors) {
        glDisableClientState(GL_COLOR_ARRAY);
    }
    glPopMatrix();
//	__android_log_print(ANDROID_LOG_DEBUG,"Renderable","rendering finished");
}
コード例 #13
0
ファイル: ministatuswindow.cpp プロジェクト: jurkan/mana
void MiniStatusWindow::draw(gcn::Graphics *graphics)
{
    Graphics *g = static_cast<Graphics*>(graphics);

    drawChildren(graphics);
    drawIcons(g);
}
コード例 #14
0
ファイル: Widgets.cpp プロジェクト: juilyoon/OcherBook
void Canvas::draw()
{
    g_fb->setFg(128, 128, 128);
    g_fb->fillRect(&m_rect);
    drawChildren();
    g_fb->update(&m_rect, false);
}
コード例 #15
0
void DecoratedContainer::draw(gcn::Graphics* graphics)
{
    if (isOpaque())
    {
        graphics->setColor(getBackgroundColor());
        graphics->fillRectangle(gcn::Rectangle(2, 2, getWidth() - 4, getHeight() - 4));
    }

    int i;
    for (i = 5; i < getHeight()-10; i+=5)
    {
	    graphics->drawImage(mVertical, 0, i);
	    graphics->drawImage(mVertical, getWidth()-4, i);
    }
    graphics->drawImage(mVertical, 0, 0, 0, i, 4, getHeight()-5-i);
    graphics->drawImage(mVertical, 0, 0, getWidth()-4, i, 4, getHeight()-5-i);

    for (i = 5; i < getWidth()-10; i+=5)
    {
	    graphics->drawImage(mHorizontal, i, 0);
	    graphics->drawImage(mHorizontal, i, getHeight()-4);
    }
    graphics->drawImage(mHorizontal, 0, 0, i, 0, getWidth()-5-i, 4);
    graphics->drawImage(mHorizontal, 0, 0, i, getHeight()-4, getWidth()-5-i, 4);

    graphics->drawImage(mCornerUL, 0, 0);
    graphics->drawImage(mCornerUR, getWidth()-5, 0);
    graphics->drawImage(mCornerDL, 0, getHeight()-5);
    graphics->drawImage(mCornerDR, getWidth()-5, getHeight()-5);

    drawChildren(graphics);
}
コード例 #16
0
void phdGuiVerSlider::draw(float _x, float _y) {

	if(!isVisible() || getManager() == NULL) return;

	ofPushStyle();
	ofPushMatrix();
	ofTranslate(getScreenX(), getScreenY(), 0);

	ofColor _border = getManager()->getBorderColor(this);

	drawFilledBorderRectangle(0,0,getWidth(),getHeight(), getManager()->getFillColor(this), _border);

	float _pos = (1.0-value) * getHeight();
	ofLine(0.0, _pos, getWidth(), _pos); 
	drawFilledBorderRectangle(0.0, _pos, getWidth(), getHeight()-_pos, _border, _border);

	ofSetColor(getManager()->getTextColor(this));
	//ofDrawBitmapString(caption, (getWidth()-(caption.size()*8.0))/2.0, getHeight() / 2.0 + 4.0);
	//ofDrawBitmapString(caption, (getWidth()-(caption.size()*8.0))/2.0, 12.0);

	string _str = "";
	for(int i = 0; i < caption.size(); i++) _str += caption.substr(i,1) + "\n";
	ofDrawBitmapString(_str, (getWidth()-(8.0))/2.0, 12.0);

	ofPopMatrix();
	ofPopStyle();

	drawChildren(_x, _y);
}
コード例 #17
0
ファイル: billboarditem3d.cpp プロジェクト: Distrotech/qt3d
/*!
    \internal
    This replaces the standard draw() as used in Item3D.  In this instance all drawing
    carried out using \a painter follows the standard sequence.  However, after the
    transforms for the item have been applied, a QGraphicsBillboardTransform is applied
    to the model-view matrix.

    After the current item is drawn the model-view matrix from immediately before the
    billboard transform being applied will be restored so child items are not affected by it.
*/
void BillboardItem3D::draw(QGLPainter *painter)
{
    // Bail out if this item and its children have been disabled.
    if (!isEnabled())
        return;
    if (!isInitialized())
        initialize(painter);

    if (!m_bConnectedToOpenGLContextSignal) {
        QOpenGLContext* pOpenGLContext = QOpenGLContext::currentContext();
        if (pOpenGLContext) {
            bool Ok = QObject::connect(pOpenGLContext, SIGNAL(aboutToBeDestroyed()), this, SLOT(handleOpenglContextIsAboutToBeDestroyed()), Qt::DirectConnection);
            Q_UNUSED(Ok);  // quell compiler warning
            Q_ASSERT(Ok);
            m_bConnectedToOpenGLContextSignal = true;
        }
    }

    //Setup picking
    int prevId = painter->objectPickId();
    painter->setObjectPickId(objectPickId());

    //Setup effect (lighting, culling, effects etc)
    const QGLLightParameters *currentLight = 0;
    QMatrix4x4 currentLightTransform;
    drawLightingSetup(painter, currentLight, currentLightTransform);
    bool viewportBlend, effectBlend;
    drawEffectSetup(painter, viewportBlend, effectBlend);
    drawCullSetup();

    //Local and Global transforms
    drawTransformSetup(painter);

    //After all of the other transforms, apply the billboard transform to
    //ensure forward facing.
    painter->modelViewMatrix().push();
    QGraphicsBillboardTransform bill;
    bill.setPreserveUpVector(m_preserveUpVector);
    bill.applyTo(const_cast<QMatrix4x4 *>(&painter->modelViewMatrix().top()));

    //Drawing
    drawItem(painter);

    //Pop the billboard transform from the model-view matrix stack so that it
    //is not applied to child items.
    painter->modelViewMatrix().pop();

    //Draw children
    drawChildren(painter);

    //Cleanup
    drawTransformCleanup(painter);
    drawLightingCleanup(painter, currentLight, currentLightTransform);
    drawEffectCleanup(painter, viewportBlend, effectBlend);
    drawCullCleanup();

    //Reset pick id.
    painter->setObjectPickId(prevId);
}
コード例 #18
0
void BasicScreenObject::draw() {

  // int elapsed = 0;

  if ((isvisible && _isParentTreeVisible && _isAddedToRenderer) || ismask) {

    glPushMatrix();
    glMultMatrixf(getLocalTransformMatrix().getPtr());

    if (hasmask)
      setupMask();

    glBlendFunc(sfactor, dfactor);

    lightingbefore = glIsEnabled(GL_LIGHTING);
    depthtestbefore = glIsEnabled(GL_DEPTH_TEST);

    if (depthtestenabled && !depthtestbefore)
      glEnable(GL_DEPTH_TEST);
    if (!depthtestenabled && depthtestbefore)
      glDisable(GL_DEPTH_TEST);

    if (lightingenabled && !lightingbefore)
      glEnable(GL_LIGHTING);
    if (!lightingenabled && lightingbefore)
      glDisable(GL_LIGHTING);

    ofPushMatrix();
    ofPushStyle();
    ofSetColor(color.r, color.g, color.b, getCombinedAlpha());
    _draw();
    ofPopStyle();
    ofPopMatrix();

    ofPushMatrix();
    drawChildren();
    ofPopMatrix();
    ofPushMatrix();
    _drawAfterChildren();
    ofPopMatrix();

    // lighting out
    if (lightingenabled && !lightingbefore)
      glDisable(GL_LIGHTING);
    if (!lightingenabled && lightingbefore)
      glEnable(GL_LIGHTING);

    // Depthtest out
    if (depthtestenabled && !depthtestbefore)
      glDisable(GL_DEPTH_TEST);
    if (!depthtestenabled && depthtestbefore)
      glEnable(GL_DEPTH_TEST);

    if (hasmask)
      restoreMask();

    glPopMatrix();
  }
}
コード例 #19
0
void
CharCreateDialog::draw(gcn::Graphics *graphics)
{
    Graphics *g = static_cast<Graphics*>(graphics);
    g->drawImage(mBackGround,0,0);

    drawChildren(graphics);
}
コード例 #20
0
ファイル: wellcome.cpp プロジェクト: mekolat/elektrogamesvn
void
Wellcome::draw(gcn::Graphics* graphics)
{
    Window::draw(graphics);
    Graphics *g = static_cast<Graphics*>(graphics);
    g->drawImage(mSlide,10,20);
    drawChildren(graphics);
}
コード例 #21
0
void SceneNode::draw(sf::RenderTarget& target, sf::RenderStates states) const {
	//two transforms chained, one after the other.
	//Combines the parent's absolute transform with the current node's relative one
	//the result is the absolute transform of the CURRENT node 
	states.transform *= getTransform(); //now, states.transform contains the absolute world transform

	drawCurrent(target, states); //draw's the CURRENT node (ie the parent)
	drawChildren(target, states); //recursively calls draw until all the children nodes are drawn
}
コード例 #22
0
ファイル: panel.cpp プロジェクト: bobke/Critterding
void Panel::draw()
{
	if (active)
	{
		drawBackground();
		drawBorders();
		drawChildren();
	}
}
コード例 #23
0
ファイル: ofxFlashStage.cpp プロジェクト: zmax/ofxFlash
void ofxFlashStage :: draw ()
{
	drawChildren( this, children );
	
	if( bShowRedrawRegions )
	{
		drawChildrenDebug( this, children );
	}
}
コード例 #24
0
ファイル: button.cpp プロジェクト: bobke/Critterding
void Button::draw()
{
	if (active)
	{
		drawBackground();
		drawBorders();
		drawChildren();
	}
}
コード例 #25
0
ファイル: vmain.cpp プロジェクト: DakaraOnline/AONX
void vmain::draw (gcn::Graphics *graphics){
	if(!img){
		std::stringstream imgPath(std::string(""));
		imgPath << ConfigData::GetPath("gui") << "main_menu/main.png";
		img = gcn::Image::load(imgPath.str());
	}
	graphics->drawImage(img,0,0);
	drawChildren(graphics);
}
コード例 #26
0
ファイル: SceneNode.cpp プロジェクト: aytona/GAME2002
void SceneNode::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
	// Apply transform of current node
	states.transform *= getTransform();

	// Draw node and children with changed transform
	drawCurrent(target, states);
	drawChildren(target, states);
}
コード例 #27
0
ファイル: Label.cpp プロジェクト: mattbucci/destruct-o
void Label::Draw(GL2DProgram * shaders) {
	//Draw text in black
	drawBackground(shaders);

	//Draw text
	text.Draw(shaders);

	drawChildren(shaders);
}
コード例 #28
0
ファイル: container.cpp プロジェクト: IamusNavarathna/lv3proj
    void Container::draw(Graphics* graphics)
    {
        if (isOpaque())
        {
            graphics->setColor(getBaseColor());
            graphics->fillRectangle(Rectangle(0, 0, getWidth(), getHeight()));
        }

        drawChildren(graphics);
    }
コード例 #29
0
ファイル: MenuBar.cpp プロジェクト: skothr/SoundSandbox
void MenuBar::draw(GlInterface &gl)
{
	if(isolateViewport(gl, false))	//Dont clamp children
	{
		drawBackground(gl);
		drawChildren(gl);

		restoreViewport(gl);
	}
}
コード例 #30
0
void SceneNode::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
	states.transform *= getTransform();

	drawCurrent(target, states);
	drawChildren(target, states);

	//if(isSelected())
	//	drawBoundingRect(target, states);
}