Ignore:
Timestamp:
01/12/16 10:42:58 (5 years ago)
Author:
gkronber
Message:

#1966: fixed various problems: bugs in cloning, bugs in persistence, method names, various minor improvements of source code for readability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/PackingPlan3D.cs

    r13465 r13497  
    2323using System.Windows.Forms;
    2424using System.Threading;
     25using SharpDX.Toolkit;
     26using SharpDX.Windows;
    2527
    2628
    2729namespace PackingPlanVisualizations {
    2830  public partial class PackingPlan3D : UserControl {
    29     private PackingGame game;
     31    private readonly PackingGame game;
    3032    private Thread gameLoopThread;
     33    private RenderForm renderForm;
    3134
    3235    public PackingPlan3D() {
    3336      InitializeComponent();
    34       if (!(System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv")) {
     37
     38      using (var proc = System.Diagnostics.Process.GetCurrentProcess()) {
     39        if (proc.ProcessName == "devenv") return;
    3540        game = new PackingGame(this);
    3641      }
     
    3944
    4045    public void StartRendering() {
    41       if (!(System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv")) {
     46      using (var proc = System.Diagnostics.Process.GetCurrentProcess()) {
     47        if (proc.ProcessName == "devenv") return;
    4248        if (!game.IsRunning)
    4349          StartGameLoop();
     
    5561                new MethodInvoker(
    5662                  () => {
    57                     game.Run(this);
     63                    var renderForm = new RenderForm("bla");
     64                    var gameContext = new GameContext(renderForm);
     65                    gameContext.UseApplicationDoEvents = false;
     66                    game.Run(gameContext);
    5867                  }
    5968                )
     
    95104    private void PackingPlan3D_Resize(object sender, EventArgs e) {
    96105      //this.Refresh();                                         
    97       if (!(System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv")) {
     106      using (var proc = System.Diagnostics.Process.GetCurrentProcess()) {
     107        if (proc.ProcessName == "devenv") return;
    98108        game.SetSize(this.Width, this.Height);
    99109      }
    100110    }
     111
     112    private void PackingPlan3D_MouseEnter(object sender, EventArgs e) {
     113    }
     114
     115    private void PackingPlan3D_MouseLeave(object sender, EventArgs e) {
     116
     117    }
    101118  }
    102119}
Note: See TracChangeset for help on using the changeset viewer.