Esempio n. 1
0
	void	FalagardAnimate::drawSelf(float z)
	{
		if( d_needsRedraw )
		{
			d_renderCache.clearCachedImagery();
			d_needsRedraw = false;
			// normal 状态是作为永远显示模式出现的
			drawNormal( z );
			if (isDisabled(true) )
			{
				drawDisabled(z);
			}
			else
			{
				//If pushed or checked draw "Pushed" Layer
				if (isPushed() ) 
				{
					drawPushed(z);
				}
				//Draw "Hover" Layer
				if (isHovering() )
				{
					drawHover(z);
				}
			}
		}
		Window::drawSelf(z);
	}
Esempio n. 2
0
void display()
{
  static const float ambient [] = {0.5, 0.5, 0.5, 1.0};
  static const float diffuse [] = {1.0, 0.0, 0.0, 1.0};
  static const float specular[] = {1.0, 1.0, 1.0, 1.0};
  static const float lightPos[] = {2.0, 2.0, 2.0, 0.0};
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();

  /* camera transform */
  glTranslatef(0.0, 0.0, -zoom);     /* zoom transform */
  glRotatef(camRotX, 1.0, 0.0, 0.0); /* rotation around x axis */
  glRotatef(camRotY, 0.0, 1.0, 0.0); /* rotation around y axis */

  /* set the light position */
  glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
  glMaterialf(GL_FRONT, GL_SHININESS, shininess);

  /* update uniform variable */
  if (options[OPT_SHADING_TOGG])
      updateShader();

  /* draw the scene */
  drawScene();

  /* draw normals */
  drawNormal();

  /* Render the hud */
  glDisable(GL_DEPTH_TEST);
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  glOrtho(0,1,0,1,-1,1);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();

  if (options[OPT_LIGHTENING])
      glDisable(GL_LIGHTING);
  /* display current setting */
  glTranslatef(0.0, 0.0, -0.5);
  drawHud();

  if (options[OPT_LIGHTENING])
      glEnable(GL_LIGHTING);

  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glEnable(GL_DEPTH_TEST);

  glutSwapBuffers();

  // Check for gl errors.
  checkGLErrors();
}
Esempio n. 3
0
void Cube::draw(){
  switch(drawType){
  case TEXTURE: drawTexture(); break;
  case NOCOLOR: drawNoColor(); break;
  default: drawNormal(); 
    break;
  }
}
Esempio n. 4
0
void Random::test()
{
    init();
    LOGD("uniform test [0,1]");
    std::vector<double> uniform = drawUniform(0, 1, 7);
    LOGD("%lf %lf %lf %lf %lf %lf %lf", uniform[0], uniform[1], uniform[2], uniform[3], uniform[4], uniform[5], uniform[6]);
    LOGD("uniform test mu:0, sigma = 5");
    std::vector<double> normal = drawNormal(0, 5, 7);
    LOGD("%lf %lf %lf %lf %lf %lf %lf", normal[0], normal[1], normal[2], normal[3], normal[4], normal[5], normal[6]);
}
Esempio n. 5
0
void OBEngine::onDrawSelf(FGGraphics &g)
{
	if ( m_uiMode == UI_PLAYBACK )
	{
		drawPlayback(g);
	}
	else
	{
		drawNormal(g);
	}
}
Esempio n. 6
0
void WalkupPlayer::draw() {
    ofSetColor(255,255,255,alpha);
    
    if (isAnimatingIn) {
        drawAnimatingIn();
    } else if (isAnimatingOut) {
        drawAnimatingOut();
    } else if (isTransitioning) {
        drawTransition();
    } else {
        drawNormal();
    }
}
Esempio n. 7
0
	void FalagardRewardItem::drawSelf( float z )
	{
		if (d_needsRedraw  )
		{
			d_renderCache.clearCachedImagery();
			d_needsRedraw = false;

			drawNormal(z);
		}
		
		if (isChecked()) // 如果按下了,就画按下的蒙字
		{
			drawPushed(z);
		}

		Window::drawSelf(z);
	}
Esempio n. 8
0
/*************************************************************************
Draw method
*************************************************************************/
void TabButton::drawSelf(float z)
{
	if (isDisabled())
	{
		drawDisabled(z);
	}
	else if (isHovering())
	{
		drawHover(z);
	}
    else if (d_selected)
    {
        drawPushed(z);
    }
    else
    {
        drawNormal(z);
    }
}
Esempio n. 9
0
/*************************************************************************
	Perform the rendering for this widget.	
*************************************************************************/
void ButtonBase::drawSelf(float z)
{
	if (isHovering())
	{
		drawHover(z);
	}
	else if (isPushed())
	{
		drawPushed(z);
	}
	else if (isDisabled())
	{
		drawDisabled(z);
	}
	else
	{
		drawNormal(z);
	}

}
Esempio n. 10
0
void phaseDiagram(){

  //set-up stuff
  gROOT->Macro("init.C");
  setStyle();  
 
  //draw stuff
  drawCanvas();
  drawTransition();   //also draws critical point
  drawAxis();
  drawLabels();       //draws labels and arrows for phases
  drawExperiments();  //draws where RCIC, LHC etc. lie on curve
  drawNormal();       //draws normal matter

  //save stuff
  if(iSave){
    cPhase->Update();
    cPhase->SaveAs("phaseDiagram5.eps");
  }
}
Esempio n. 11
0
//end
void LayerBase::drawWithOpenGL(const Region& clip) const
{
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    const uint32_t fbHeight = hw.getHeight();
	const uint32_t fbWidth = hw.getWidth();
    const State& s(drawingState());
	const SurfaceFlinger::State& sSF = mFlinger->getDrawingState();

    GLenum src = mPremultipliedAlpha ? GL_ONE : GL_SRC_ALPHA;
    if (UNLIKELY(s.alpha < 0xFF)) {
        const GLfloat alpha = s.alpha * (1.0f/255.0f);
        if (mPremultipliedAlpha) {
            glColor4f(alpha, alpha, alpha, alpha);
        } else {
            glColor4f(1, 1, 1, alpha);
        }
        glEnable(GL_BLEND);
        glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
        glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    } else {
        glColor4f(1, 1, 1, 1);
        glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
        if (!isOpaque()) {
            glEnable(GL_BLEND);
            glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
        } else {
            glDisable(GL_BLEND);
        }
    }  
	//first judge wheather is 3D module 40641
	const uint32_t hw_w_half = hw.getWidth()/2;
	struct TexCoords {
        				GLfloat u;
      					GLfloat v;
   						};			 
	TexCoords texCoords[4];
	//judge if 3D modle
	
					
	switch(sSF.composing3D){
		case eSTEREO_OSD_3D_NONE:			
		{
			drawNormal(clip,fbHeight,mDrawingState.flags);			

			break;
		}
		
		case eSTEREO_OSD_3D_SBSHALFE_PR:
		{
			
			drawSideBySide(clip,hw_w_half,fbHeight,mDrawingState.flags);

			break;
		}
			
		case eSTEREO_OSD_3D_TPANDBT_PR:
		{
			
			drawTopAndBottom(clip,fbHeight,mDrawingState.flags);					

			break;
		}
			
		default:
		break;		
}
	
			
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glDisable(GL_BLEND);
}
Esempio n. 12
0
void Terrain::draw(Matrix4 c)
{
    draw_bezier ? drawNormal(c) : drawBezier(c);
}
Esempio n. 13
0
void FalagardActionButton::drawSelf( float z )
{
    if (d_needsRedraw  )
    {
        d_renderCache.clearCachedImagery();
        d_needsRedraw = false;
        const StateImagery* imagery;
        // get WidgetLookFeel for the assigned look.
        const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName);
        if( wlf.isStateImageryPresent( "BackgroundImage" ) )
        {
            imagery = &wlf.getStateImagery( "BackgroundImage" );
            // peform the rendering operation.
            imagery->render(*this);
        }
        // 画背景

        d_BackImage.draw(d_renderCache);
        //Empty
        if(isEmpty())
        {
            if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom())
            {
                drawHover(z);
            }
        }
        else
        {
            //Draw normal image
            drawNormal(z);

            //Draw percentage Img
            if(isPercentagePresent())
            {
                drawPercentageImg(z);
            }

            //Notin Dragging
            if(d_dragging && !isGloom())
            {
                drawPushed(z);
            }
            else
            {
                //Draw disable mask only when disabled
                if (isDisabled(true) || isGloom() )
                {
                    drawDisabled(z);
                    if (isPushed() || isChecked())
                    {
                        drawPushed(z);
                    }
                    drawAnimate(z);
                }
                else
                {
                    //If pushed or checked draw "Pushed" Layer
                    if (isPushed() || isChecked())
                    {
                        drawPushed(z);
                    }

                    //Draw "Hover" Layer
                    if (isHovering() && !isChecked())
                    {
                        drawHover(z);
                    }

                    drawAnimate(z);
                    // If default
                    if(isDefault())
                    {
                        drawDefault(z);
                    }

                }

                //Draw corner character
                drawCorner(z);
                drawFlash( z );
            }
        }
    }

    Window::drawSelf(z);
}
Esempio n. 14
0
	void FalagardActionButton::drawSelf( float z )
	{
		if (d_needsRedraw  )
		{
			d_renderCache.clearCachedImagery();
			d_needsRedraw = false;
			
			//Empty
			if(isEmpty())
			{
				if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom())
				{
					drawHover(z);
				}
			}
			else
			{
				//Draw normal image
				drawNormal(z);

				//Notin Dragging
				if(d_dragging && !isGloom())
				{
					drawPushed(z);
				}
				else
				{
					//Draw disable mask only when disabled
					if (isDisabled(true) || isGloom() )
					{
						drawDisabled(z);
						if (isPushed() || isChecked()) 
						{
							drawPushed(z);
						}
					}
					else
					{
						//If pushed or checked draw "Pushed" Layer
						if (isPushed() || isChecked()) 
						{
							drawPushed(z);
						}

						//Draw "Hover" Layer
						if (isHovering() && !isChecked())
						{
							drawHover(z);
						}

						drawAnimate(z);
						// If default
						if(isDefault())
						{
							drawDefault(z);
						}
						
					}

					//Draw corner character
					drawCorner(z);
				}
			}
		}

		Window::drawSelf(z);
	}