{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiaegx4vljwosnnnhksrffjzrgof3zkvd5p25qidaarnh4krbk7n4q",
    "uri": "at://did:plc:dxjzgxe7cvirxkwfjr2tjspt/app.bsky.feed.post/3mn6ij2c2sen2"
  },
  "path": "/t/jme-3-10-0-beta1/49603#post_13",
  "publishedAt": "2026-05-31T21:03:02.000Z",
  "site": "https://hub.jmonkeyengine.org",
  "tags": [
    "SDL_DisplayMode"
  ],
  "textContent": "sgold:\n\n> Many of my apps use GLFW to determine the available resolutions for full-screen display. I’m sure SDL3 has equivalent functionality;\n\nThis is what I’ve done so far:\n\n\n        public List<VideoMode> getAvailableVideoModes() {\n            initVideo();\n\n            final List<VideoMode> videoModes = new ArrayList<>();\n            final PointerBuffer displayModes = SDLVideo.SDL_GetFullscreenDisplayModes(display);\n\n            for (int i = 0; i < displayModes.capacity(); i++) {\n                final SDL_DisplayMode displayMode = SDL_DisplayMode.create(displayModes.get());\n                final VideoMode videoMode = new VideoMode(displayMode.w(), displayMode.h(), displayMode.refresh_rate());\n                videoModes.add(videoMode);\n            }\n\n            SDL_free_func.free(displayModes.address());\n\n            return videoModes;\n        }\n\n        private void initVideo() {\n            if ((SDLInit.SDL_WasInit(SDLInit.SDL_INIT_VIDEO) & SDLInit.SDL_INIT_VIDEO) == 0 && !SDLInit.SDL_Init(SDLInit.SDL_INIT_VIDEO)) {\n                String message = SDLError.SDL_GetError();\n                logger.log(Level.SEVERE, \"CRITICAL ERROR: Failed to initialize SDL3 Video Subsystem!\\n * {0}\", message);\n                throw new RuntimeException(message);\n            }\n        }\n\n\n`VideoMode` is a record I created that holds only width, height and frequency, but SDL_DisplayMode has other data.\n\n\n    public record VideoMode(int width, int height, float refreshRate) {\n    }\n",
  "title": "jME 3.10.0-beta1"
}