Game Development Reference
In-Depth Information
Next, right-click on the
demo-desktop
project in
Project Explorer
in Eclipse, and
then select the
Java Application
option from the
Debug As
menu, or press the
F11
key on your keyboard. The application should be halted almost directly after the
application window becomes visible. Eclipse should have automatically changed
to the debugging perspective, which shows lots of extra information about an
application running in the debug mode, as shown here:
In the
Variables
tab, you can now inspect every variable that is within the current
scope of execution, for example, the two floating-point variables,
w
and
h
, have
already been set. You can check this by looking for them in the
Variables
tab. The
correct values of the variables are displayed as
480.0
for
w
and
320.0
for
h
. To step
through, resume or stop the execution of the application; you can go to the
Run
menu
and choose the appropriate menu item. Choose to resume the application for now.
Let's try to do code hot swapping now. Make sure that the demo application is
currently running and is being executed right now. The following code listing
is a modified version of the
render()
method; the modification is highlighted:
@Override
public void render() {
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(camera.combined);