Comments (6)
Interesting. When I call this function on a window, I get a resolution of 1024x768, which matches neither the window resolution nor the monitor resolution.
My goal in all of this is to access the GLX data so as to use OpenXR. I'm thinking I might have to do without SDL for now.
from sdlwiki.
It's meant to be the closest fullscreen resolution your hardware supports to the current size of the window.
from sdlwiki.
That would make sense, though that's not in the wiki page.
I would like to get window manager and driver data (X11/GLX or Win32/WGL, etc.) for integration with other APIs. Not sure how to articulate this... Ideally, usage of SDL would be transparent, as if SDL didn't exist and I were calling native system APIs, but when I need SDL for input and application lifecycle handling, it would work and enhance the experience with other APIs like OpenXR. Not sure if this is possible.
from sdlwiki.
Take a look at SDL_syswm.h, which gets you access to the platform-specific handles/pointers, so you can do anything you need by stepping out of SDL when it makes sense to do so.
(at your own risk, of course.)
from sdlwiki.
I started to play around with that a week ago, but I hit a few walls. I'm just testing X11/GLX for now.
I'm using Glad, and that conflicts with GLX because both libraries define OpenGL things. Rather than drop Glad, I typedef'd GLXFBConfig
, GLXDrawable
, and GLXContext
, all of which are required by OpenXR. That way I don't need to #include GLX.
So onto the SDL part. I #include SDL_syswm.h. This gives me SDL_GetWindowWMInfo, which fills SDL_SysWMinfo, which is supposed to contain x11.display
(though that often fails to exist). Where is the GLX info? I can't fill out the struct in OpenXR without it. Furthermore, the compiler errors I'm getting are at times confusing, and window manager stuff is unexplored territory for me.
I thought this might be related to SDL_DisplayMode because that has driverdata
which can be GLX data, though maybe not the data I'm looking for. And I don't know how to get any relevant GLX data.
Thanks Ryan. Been looking at your site on and off the last 10 years. Never thought I'd get the chance to waste so much of your time. ;)
from sdlwiki.
So, looking at SDL_x11opengl.c
, driverdata
is cast to SDL_WindowData
before it is used for GLX calls. There is a function called SDL_GetWindowData which returns a void pointer. The struct definition is in src/video/x11/SDL_x11window.h
for X11, src/video/windows/SDL_windowswindow.h
for Windows, and src/video/cocoa/SDL_cocoawindow.h
for Mac, and that looks like Objective-C. I assume it's standard practice to #include these?
Also, I'm assuming SDL_GetWindowDisplayMode
is not what I want at all and many things are undocumented...
from sdlwiki.
Related Issues (20)
- Feedback on page SDL2/SDL_SysWMinfo
- Feedback on page SDL3/SDL_SetRenderViewport
- Feedback on page SDL3/SDL_ShowSimpleMessageBox HOT 1
- Feedback on page SDL2/Tutorials HOT 1
- Page on SDL2/README/dynapi lacks info on how to disable it HOT 2
- Notification in the API reference of functions that are broken on Wayland.
- Feedback on page SDL2/SDL_SysWMinfo
- Feedback on page SDL2/Installation HOT 1
- Feedback on page SDL3/SDL_GetWindowWMInfo HOT 6
- (Many) Pull requests already merged are reverted by SDLWikiBot weeks later HOT 3
- Feedback on page SDL2/Installation HOT 1
- wiki.libsdl.org is down HOT 3
- Insufficient information on SDL_RendererFlags and their interoperability. HOT 6
- Feedback on page SDL2/SDL_RenderSetVSync HOT 2
- Feedback on page SDL2/SDL_JoystickEventState
- Feedback on page SDL2/FAQUsingSDL HOT 1
- CreateRGBSurface and indexed images HOT 1
- Include the header file in which a function is located in the documentation. HOT 5
- Report mouse wheel scroll state through a function
- SDL_IsEventEnabled / SDL_EventEnabled HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdlwiki.