Beispiel #1
0
_String* _HYConsoleWindow::ReadString	 (void)
{
	BringToFront ();
	_String * res = nil;
	
	_HYTextBox * inbox = ((_HYTextBox*)GetObject(1));
	
	inbox->SetText 		  (empty,false);
	
	ProcessEvent (generateKeyboardFocusEvent(inbox->GetID()));

	inputStatus   = 1;
	inputLocation = recentInputs.lLength;
	
	_PaintStatusBar();
	
	inbox->boxFlags |= HY_TB_ARROWS;

	#ifndef __WINDOZE__
		while ((inputStatus != 2)&&(!terminateExecution))
			handleGUI();
	#else
		while ((inputStatus != 2)&&(!terminateExecution)&&(!hyphyExiting))
			handleGUI();
			
		if (hyphyExiting)
			return new _String;
	#endif
		
	inbox->boxFlags -= HY_TB_ARROWS;
	
	inbox->StoreText (res);
	
	inputStatus = 0;
	
	if (res->sLength)
	{
		if (recentInputs.lLength > 100)
			recentInputs.Delete (0);
		recentInputs && res;
	}

	_PaintStatusBar();

	if (echoFileRef && echoStatus == 1)
		fprintf (echoFileRef,"\n>Input:%s",res->sData);

	return res;
}
void MeshDecimationApp::update()
{
    // The full reduction of a mesh is the slowest process and can take a long time on detailed models
    // -> Don't freeze the program and process all models sequentially with a time constraint.
    if (size_t(m_curLoadingMeshIdx) < m_meshes.size() && m_meshes.size() > 0)
        loadCollapsedEdgesCache();

    m_modelCamera.updateViewMatrix();
    updateModelRotation();

    GL::setViewport(m_modelCamera.getViewport());
    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glEnable(GL_DEPTH_TEST);

    if (m_meshSelection >= 0)
    {
        m_shader.bind();
        glm::mat4 pivotTranslation = glm::translate(glm::vec3(-0.5f));
        m_shader.setModel(glm::toMat4(m_modelRotation) * pivotTranslation);
        m_shader.setCamera(m_modelCamera.view(), m_modelCamera.proj());
        m_shader.setColor(glm::vec4(m_meshColor, 1.0f));
        m_activeMesh->bindAndRender();
    }

    handleGUI();
}