예제 #1
0
파일: alphabets.cpp 프로젝트: crg91/Tetris
void display()
{
   glClear(GL_COLOR_BUFFER_BIT);
   glColor3f(1.0, 1.0, 1.0);

   drawZ(1.0, 0.0, 0.0, 1.0);
   glFlush();
}
예제 #2
0
파일: boundingbox.cpp 프로젝트: nci/drishti
void
BoundingBox::draw()
{
  if (m_emitUpdate)
    {
      bool ok = true;
      for (int i=0; i<6; i++)
	{      
	  if (m_bounds[i].grabsMouse())
	    {
	      ok = false;
	      break;
	    }
	}
      if (ok)
	{
	  emit updated();
	  m_emitUpdate = false;
	}
    }

  Vec bmin, bmax;  

  bounds(bmin, bmax);

  Vec lineColor = defaultColor;
  lineColor = Vec(0.8f, 0.8f, 0.6f);

  glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
  glColor4f(boxColor.x, boxColor.y, boxColor.z, 0.9f);
  StaticFunctions::drawEnclosingCube(bmin,
				     bmax);
  glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);

  for (int i=0; i<6; i++)
    {      
      if (m_bounds[i].grabsMouse())
	{
	  glLineWidth(2);
	  switch(i)
	    {
	    case 0 :
	      drawX(bmin.x, bmin, bmax, selectColor);
	      break;
	    case 1 :
	      drawX(bmax.x, bmin, bmax, selectColor);
	      break;	     
	    case 2 :
	      drawY(bmin.y, bmin, bmax, selectColor);
	      break;	      
	    case 3 :
	      drawY(bmax.y, bmin, bmax, selectColor);
	      break;	      
	    case 4 :
	      drawZ(bmin.z, bmin, bmax, selectColor);
	      break;	      
	    case 5 :
	      drawZ(bmax.z, bmin, bmax, selectColor);
	      break;
	    }
	}
      else
	{
	  glLineWidth(1);
	  switch(i)
	    {
	    case 0 :
	      drawX(bmin.x, bmin, bmax, lineColor);
	      break;
	    case 1 :
	      drawX(bmax.x, bmin, bmax, lineColor);
	      break;	     
	    case 2 :
	      drawY(bmin.y, bmin, bmax, lineColor);
	      break;	      
	    case 3 :
	      drawY(bmax.y, bmin, bmax, lineColor);
	      break;	      
	    case 4 :
	      drawZ(bmin.z, bmin, bmax, lineColor);
	      break;	      
	    case 5 :
	      drawZ(bmax.z, bmin, bmax, lineColor);
	      break;
	    }
	}
    }

  glLineWidth(1);
}
예제 #3
0
void ofxInkSim::draw()
{
    string whatdraw = "";
    if (drawMode == INKFIX)
    {
        whatdraw = "INKFIX";
        drawXYZ(fixInk.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    else if (drawMode == INKSURF)
    {
        whatdraw = "INKSURF";
        drawXYZ(surfInk.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    else if (drawMode == INKFLOW)
    {
        whatdraw = "INKFLOW";
        drawXYZ(flowInk.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    else if (drawMode == WATERFLOW)
    {
        whatdraw = "WATERFLOW";
        drawZ(velDen.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    
    if (bDebug)
    {
        int w = width/8;
        int h = height/8;
        
        drawXYZ(surfInk.getOldTex()->getTextureReference(), 0, 0, w, h);
        drawXYZ(misc.getOldTex()->getTextureReference(), w*1, 0, w, h);
        drawXYZ(velDen.getOldTex()->getTextureReference(), w*2, 0, w, h);
        drawXYZ(flowInk.getOldTex()->getTextureReference(), w*3, 0, w, h);
        drawXYZ(fixInk.getOldTex()->getTextureReference(), w*4, 0, w, h);
        drawXYZ(dist1.getOldTex()->getTextureReference(), w*5, 0, w, h);
        drawXYZ(dist2.getOldTex()->getTextureReference(), w*6, 0, w, h);
        drawXYZ(sinkInk.getOldTex()->getTextureReference(), w*7, 0, w, h);
        
        ofDrawBitmapStringHighlight("SurfInk OLD", 0, 15);
        ofDrawBitmapStringHighlight("Misc OLD", w*1, 15);
        ofDrawBitmapStringHighlight("VelDen OLD", w*2, 15);
        ofDrawBitmapStringHighlight("FlowInk OLD", w*3, 15);
        ofDrawBitmapStringHighlight("FixInk OLD", w*4, 15);
        ofDrawBitmapStringHighlight("Dist1 OLD", w*5, 15);
        ofDrawBitmapStringHighlight("Dist2 OLD", w*6, 15);
        ofDrawBitmapStringHighlight("SinkInk OLD", w*7, 15);
        
        depositionBuffer.draw(0, h, w, h);
        grain.draw(w*1, h, w, h);
        alum.draw(w*2, h, w, h);
        pinning.draw(w*3, h, w, h);
        drawXYZ(disorder.getTextureReference(), w*4, h, w, h);
        
        drawXYZ(surfInk.getNewTex()->getTextureReference(), 0, height - h, w, h);
        drawXYZ(misc.getNewTex()->getTextureReference(), w*1, height - h, w, h);
        drawXYZ(velDen.getNewTex()->getTextureReference(), w*2, height - h, w, h);
        drawXYZ(flowInk.getNewTex()->getTextureReference(), w*3, height - h, w, h);
        drawXYZ(fixInk.getNewTex()->getTextureReference(), w*4, height - h, w, h);
        drawXYZ(dist1.getNewTex()->getTextureReference(), w*5, height - h, w, h);
        drawXYZ(dist2.getNewTex()->getTextureReference(), w*6, height - h, w, h);
        drawXYZ(sinkInk.getNewTex()->getTextureReference(), w*7, height - h, w, h);
        
        ofDrawBitmapStringHighlight("SurfInk NEW", 0, height - h);
        ofDrawBitmapStringHighlight("Misc NEW", w*1, height - h);
        ofDrawBitmapStringHighlight("VelDen NEW", w*2, height - h);
        ofDrawBitmapStringHighlight("FlowInk NEW", w*3, height - h);
        ofDrawBitmapStringHighlight("FixInk NEW", w*4, height - h);
        ofDrawBitmapStringHighlight("Dist1 NEW", w*5, height - h);
        ofDrawBitmapStringHighlight("Dist2 NEW", w*6, height - h);
        ofDrawBitmapStringHighlight("SinkInk NEW", w*7, height - h);
        
        ofDrawBitmapStringHighlight(whatdraw, 0, height - h - 50);
        ofDrawBitmapStringHighlight("fps:" + ofToString(ofGetFrameRate()), 0, height - h - 30);
    }
}