Skip to content

Expose display mode bit depth in DisplayInfo (#2871) - #3076

Open
adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2871-display-bit-depth
Open

adrian-andrzjewski wants to merge 1 commit into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2871-display-bit-depth

Conversation

@adrian-andrzjewski

Copy link
Copy Markdown

Closes #2871

What changed

  • Add DisplayInfo.getBitDepth() for the current display mode's pixel-format bits per pixel, excluding depth and stencil bits.
  • Populate it from SDL and AWT display mode APIs; report 0 when a single value is unavailable.
  • Preserve the existing Displays.setInfo(...) signature through a delegating overload.

Validation

  • .\gradlew.bat :jme3-core:test --tests com.jme3.system.DisplayInfoTest :jme3-lwjgl3:compileJava — passed.
  • .\gradlew.bat :jme3-core:test :jme3-lwjgl3:compileTestJava — passed; 1,217 core tests, 0 failures, 0 errors, 1 skipped.
  • .\gradlew.bat :jme3-core:checkstyleMain :jme3-core:checkstyleTest :jme3-lwjgl3:checkstyleMain — passed; no findings in changed files.
  • git diff --check — passed.

The SDL/AWT backend paths compile, but no live display window was opened for this validation.

Copy link
Copy Markdown
Author

@riccardobl Could you review this change when you have a chance? It adds display mode bit depth to DisplayInfo, with SDL/AWT mappings and compatibility-preserving fallback behavior.

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Adrian, thanks for putting this together. This adds the missing display-mode color depth in a way that fits the existing DisplayInfo model, and the legacy Displays.setInfo(...) overload remains compatible while clearly treating depth as unavailable.

I checked the SDL and AWT population paths, the DisplayInfo equality/hash updates, and the new tests. Using SDL’s pixel-format helper keeps the reported value tied to the display mode rather than the GL framebuffer configuration, while clamping AWT’s unavailable sentinel to 0 matches the API documentation. The tests cover both the new value and the compatibility default, and the reported validation gives good coverage for the affected modules.

Looks good to me—thanks for addressing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bitdepth to DisplayInfo

2 participants