GWT build issue with Pixmap.createFromFrameBuffer
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 25.4k
- Forks
- 6.5k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 5
Description
Issue details
It isn't possible to compile following code on GWT (required for taking screenshots):
Pixmap pixmap = Pixmap.createFromFrameBuffer(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
ByteBuffer pixels = pixmap.getPixels();
It gives following error when compiling: Type mismatch: cannot convert from Buffer to ByteBuffer
And seems to be caused by this line, with IDE showing the line as syntax error.
It shows also this and this line as syntax error with message Cannot resolve symbol 'pixmap', but I have no idea why and it isn't causing any problems for me (most likely because I am not calling those functions).
Version of libGDX and/or relevant dependencies
1.11.0
Please select the affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- macOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the GWT compilation example in the issue and inspect gdx/src/com/badlogic/gdx/graphics/Pixmap.java at lines 103, 311, and 329. Reproduce the ByteBuffer/Buffer error for the HTML/GWT target, then verify that the reported syntax and symbol errors are resolved and the screenshot code compiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, java
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100