Skip to content

Commit

Permalink
Merge pull request #90 from webner/libgdx-fixes
Browse files Browse the repository at this point in the history
LibGDX width/height & ReshapeEvent
  • Loading branch information
husker-dev authored Dec 19, 2024
2 parents 2feb087 + 6391503 commit 98e1534
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class LibGDXCanvas(
adapter.render()
}

override fun fireReshapeEvent(width: Int, height: Int) {
super.fireReshapeEvent(width, height)
adapter.resize(width, height)
}

override fun fireInitEvent() {
if(!::application.isInitialized) {
application = OGLFXApplication(configuration, this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class OGLFXGraphics(val canvas: GLCanvas): AbstractGraphics() {
override fun setGL31(gl31: GL31?) { this.gl31 = gl31 }
override fun setGL32(gl32: GL32?) { this.gl32 = gl32 }

override fun getWidth() = canvas.scaledWidth
override fun getHeight() = canvas.scaledHeight
override fun getWidth() = canvas.width.toInt()
override fun getHeight() = canvas.height.toInt()
override fun getBackBufferWidth() = canvas.scaledWidth
override fun getBackBufferHeight() = canvas.scaledHeight

Expand Down

0 comments on commit 98e1534

Please sign in to comment.