/// <summary> /// Arranca a ejecutar un ejemplo. /// Para el ejemplo anterior, si hay alguno. /// </summary> /// <param name="example"></param> internal void executeExample(TgcExample example) { stopCurrentExample(); userVars.clearVars(); modifiers.clear(); resetDefaultConfig(); fpsCamera.resetValues(); rotCamera.resetValues(); thirdPersonCamera.resetValues(); //Ejecutar init try { example.init(); //Ver si abrimos una ventana para modo FullScreen if (FullScreenEnable) { mainForm.removePanel3dFromMainForm(); fullScreenPanel.Controls.Add(panel3d); fullScreenPanel.Show(mainForm); } this.currentExample = example; panel3d.Focus(); mainForm.setCurrentExampleStatus("Ejemplo actual: " + example.getName()); Logger.log("Ejecutando ejemplo: " + example.getName(), Color.Blue); } catch (Exception e) { Logger.logError("Error en init() de ejemplo: " + example.getName(), e); } }
/// <summary> /// Deja de ejecutar el ejemplo actual /// </summary> internal void stopCurrentExample() { if (currentExample != null) { currentExample.close(); tgcD3dDevice.resetWorldTransofrm(); Logger.log("Ejemplo " + currentExample.getName() + " terminado"); currentExample = null; elapsedTime = -1; if (FullScreenEnable && fullScreenPanel.Visible) { closeFullScreenPanel(); } } }