void
D3DOverdrawWindow::
Reshape(int w, int h)
{
    Superclass::Reshape(w, h);
    SetupViewport();
    PostRedisplay();
}
示例#2
0
/**
 * @brief ParticleSystem Render
 */
bool ParticleSystem::Render(void) {
  viewAspect = wWidth / static_cast<float>(wHeight);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  projMX =
      glm::perspective(static_cast<float>(fovY), viewAspect, 0.01f, 100.0f);

  // --------------------------------------------------
  //  draw to FBO
  // --------------------------------------------------
  enable_renderbuffers();
  drawToFBO();
  disable_renderbuffers();

  // --------------------------------------------------
  //  draw fullscreen quad
  // --------------------------------------------------
  drawQuad();

  PostRedisplay();
  return false;
}
示例#3
0
/**
 * @brief ParticleSystem mouse callback function
 * @param button
 * @param state
 * @param x
 * @param y
 */
bool ParticleSystem::Mouse(int button, int state, int x, int y) {

  PostRedisplay();
  return false;
}
示例#4
0
/**
 * @brief ParticleSystem keyboard callback function
 * @param key
 * @param x
 * @param y
 */
bool ParticleSystem::Keyboard(unsigned char key, int x, int y) {
  PostRedisplay();
  return true;
}
示例#5
0
int animTcl::Command(ClientData clientData, Tcl_Interp *interp, int argc,	char **argv)
{
	if (argc < 2 ) {
		animTcl::OutputMessage("Usage: system|simulator <name> ...")  ;
		return  TCL_ERROR;
	}
	else if( strcmp(argv[0], "system") == 0 )
	{
		
		// get the requested system by name and dispatch the command

		BaseSystem* tempSystem =  
			GlobalResourceManager::use()->getSystem( argv[1] );
			
		if( tempSystem != NULL )
		{
			tempSystem->command( 
			argc - 2, &argv[ 2 ] );

		}
		else
		{

			animTcl::OutputMessage( "system %s was not found", argv[ 1 ] )  ;
			return  TCL_ERROR;

		}

	}
	else if( strcmp(argv[0], "simulator") == 0 )
	{

		// get the requested simulator by name and dispatch the command

		BaseSimulator* tempSimulator = 
			GlobalResourceManager::use()->getSimulator( argv[1] );
			
		if( tempSimulator != NULL )
		{
			tempSimulator->command( 
			argc - 2, &argv[ 2 ] );

		}
		else
		{

			animTcl::OutputMessage("simulator %s was not found", argv[ 1 ] )  ;
			return  TCL_ERROR;

		}

	}
	else if( strcmp(argv[0], "show" ) == 0 )
	{
		if( argc < 2 ) 
		{
			animTcl::OutputMessage("syntax: show system|simulator") ;
			return TCL_OK ;
		}

		if( strcmp(argv[1], "simulator" ) == 0 ) 
		{

			unsigned int index;

			for( index = 0; index < 
				GlobalResourceManager::use()->getNumberOfSimulators(); index++ )
			{

			std::string name;

			GlobalResourceManager::use()->getSimulatorFromIndex( 
				index )->getName( name );

			animTcl::OutputListElement("%s", name.c_str() ) ;

			}

		}
		else if( strcmp(argv[1], "system" ) == 0 ) 
		{

			unsigned int index;

			for( index = 0; index < 
				GlobalResourceManager::use()->getNumberOfSystems(); index++ )
			{

			std::string name;

			GlobalResourceManager::use()->getSystemFromIndex( 
				index )->getName( name );

			animTcl::OutputListElement("%s", name.c_str() ) ;

			}

		}
	}
	else if( strcmp(argv[0], "reset") == 0 )
	{

		GlobalResourceManager::use()->resetAll();

	}

	PostRedisplay();

	return TCL_OK;

}