0

I started developing a game in Java with Eclipse. As you all know you have to debug a lot while coding. But I have the following issue:

My game is full-screen. If I run into a breakpoint it stops (like it should) and for some reason I can't switch window anymore (I am using Windows 7). I have to press Ctrl + Alt + Delete" and start the "Task manager" to be able to switch to Eclipse window and continue debugging.

So I tried to use window mode instead of full screen. Now if I run into a breakpoint the Eclipse window gets the focus (automatically) and I can debug easily.

So I thought it would be great to be in window mode, if and only if I am in debug mode, else it should be full screen.

For this I need to know if I am in debug mode or not. After reading this and this it seems like you can't check that easily, cause it depends on the VM you are using. Also it seems like the best solution is to use the Eclipse Debug/Run-Configuration and set a VM or program argument.

But how can I tell Eclipse to use this configuration only for debug mode? Or is there even a better way to determine, if debug is on or off?

Community
  • 1
  • 1
Robert P
  • 9,398
  • 10
  • 58
  • 100
  • If you set a program argument for your debug run configuration, than this argument is only set if you start debug. The Normal run configuration is not affected by this. – Absurd-Mind Apr 01 '14 at 14:46
  • I know this is not an answer, but if you could get another screen to connect to your machine, you could run the game fullscreen on one screen and Eclipse on the other. – Yuval Apr 01 '14 at 14:52
  • @Absurd-Mind i tryed that, but the same configuration can be used for both, debug and run. So i thought it is also possible to create a configuration, that is only usable as debug. – Robert P Apr 01 '14 at 15:08
  • @Yuval yea that would be great. But i am working on a 5 year old laptop with 1 screen only :P – Robert P Apr 01 '14 at 15:09

1 Answers1

0

It seems like the best way is to use arguments and pass them by using a Debug-Configuration and a Run-Configuration with the right values.

In Eclipse you have the possibility to add a Configuration to the Run list and the Debug list.
This can be done by going to the common tab inside the configurations and check the Debug and/or Run checkbox inside the "Display in favorite menu" section.
You can also edit the favorite list (add/remove/move entries) by clicking "Organize Favorites".

Note, that it does not prevent you from runing the Debug-Configuration or debuging the Run-Configuration.

Robert P
  • 9,398
  • 10
  • 58
  • 100