Example #1
0
void setup()
{
	// Set window size and smooth drawing
	size(800, 800);
	smooth();
    
    setLogLevel(LOG_TRIVIAL);

	// Set OpenCV 2D renderer as the default
	enableOpenCVRenderer2D();
}
Example #2
0
/**
 * @internal
 * @brief Initializes the class so it becomes valid.
 *
 * @param userApp if received, this is the pointer to the user application. If not recive, the user is using global functions (processing style)
 * for the application flow
 * @return true if the initialization was ok | false otherwise
 */
bool Application::initApp( UserApplicationBase* userApp /*= NULL*/ )
{
	// Check if the class is already initialized
	if ( isValid() )
		return true;

    // Store pointer to the user app
    m_userApp = userApp;
    
	// Init random number generator seed
	setRandomSeed( time(NULL) );

	// First, init the subsystems needed by any user call (the rest will be init in the initSubSystems method
	// called when the user calls the size function

	// Init the resource manager
	ResourceManager::getSingleton().init();

	// Init the log manager
	// Note: If the log manager is initalized before the Resource Manager, Ogre.log file won't be created
	LogManager::getSingleton().init();
	
    // TODO: this is a temporary 2d renderer (opencv) until Cing's core has the necessary features to not need it
    enableOpenCVRenderer2D();
    
	// Init user application
    if ( m_userApp )
        m_userApp->setup();
    else
        setup();

	// Check subsystems init ok
	checkSubsystemsInit();

	// Reset timer
	m_timer.reset();
	m_absTimer.reset();

	// Set frameCount to zero
	m_frameCount = 0;

	return true;

}