Code Monkey home page Code Monkey logo

Comments (6)

 avatar commented on June 16, 2024

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.

icculus avatar icculus commented on June 16, 2024

It's meant to be the closest fullscreen resolution your hardware supports to the current size of the window.

from sdlwiki.

 avatar commented on June 16, 2024

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.

icculus avatar icculus commented on June 16, 2024

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.

 avatar commented on June 16, 2024

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.

 avatar commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.