gdx2d icon indicating copy to clipboard operation
gdx2d copied to clipboard

Version upgrade for LibGDX and LWJGL so that it works on ARM64 macs.

Open renaud opened this issue 8 months ago • 2 comments

  1. Updated LibGDX version from 1.9.8 to 1.12.0
  2. Switched from LWJGL2 to LWJGL3 backend
  3. Updated controllers API (replaced PovDirection enum with int values)
  4. Fixed type casting for camera movement in tile demos
  5. Updated Java requirements from 1.6 to 1.8
  6. Added proper window resize handling in Game2D class
  7. Maintained LWJGL2 support for Swing integration
  8. Updated gdx-controllers dependency to the new separate package (2.2.2)
  9. Removed deprecated GdxNativesLoader class
  10. Improved student script with safer sed command usage
  11. Wasted 45,390,848 tokens using Claude CLI, but it was not that bad

To make the application work in IntelliJ IDEA on macOS:

  1. Open your project in IntelliJ IDEA
  2. Click on "Run" in the top menu, then select "Edit Configurations..."
  3. Select your run configuration (or create a new one if needed)
  4. In the "VM options" field, add: -XstartOnFirstThread
  5. Make sure the "Main class" is set correctly (e.g., ch.hevs.gdx2d.demos.DemoSimpleAnimation)
  6. Click "Apply" and then "OK"
  7. Run your application using the updated configuration

renaud avatar May 11 '25 20:05 renaud

11. Wasted 45,390,848 tokens using Claude CLI, but it was not that bad

Short note. You can get free access to Copilot Pro as a student, teacher, or maintainer With the free pro plan on GitHub Copilot you can get Claude 3.7 Sonnet, o1, and more. 🚀

metc avatar May 12 '25 22:05 metc

@metc I am testing this version with the new LibGDX. I can make a basic example work. But strangely when subclassing PortableApplication, the onInit() methods gets called BEFORE the class variables initialization. I don't think that should be the case. Do you have any idea why?

To reproduce:

import ch.hevs.gdx2d.lib.GdxGraphics
import ch.hevs.gdx2d.desktop.PortableApplication
import com.badlogic.gdx.graphics.Color

class Demo() extends PortableApplication {

  var a = 1

  override def onInit(): Unit = {
    setTitle("demo" + a)
  }

  override def onGraphicRender(g: GdxGraphics): Unit = {
    a+=1
    g.clear()
    g.drawRectangle( 10, 10, 20, 20,0)
    g.drawAntiAliasedCircle(200, 200, a, Color.RED)
  }
}

object Demo extends App{
  new Demo()
}

The title should be demo1 but it is demo0. variable a never gets initialized before onInit() is called...

renaud avatar May 23 '25 01:05 renaud