Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL3: Using Gallium GLon12 now fails to create a GL Context on Xbox #11247

Open
RustyMoyher opened this issue Oct 17, 2024 · 0 comments
Open
Milestone

Comments

@RustyMoyher
Copy link
Contributor

When using the SDL3 preview 3.1.3 with the Mesa Gallium driver, a GL Context is no longer created when running on Xbox One. The same setup is successful on SDL2 version 2.20.3.

Here’s a quick test case for SDL3:

#include <SDL3/SDL_main.h>

SDL_Window *window = NULL;
SDL_GLContext *glContext = NULL;

int main(int argc, char *argv[])
{
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);

    if (!SDL_Init(SDL_INIT_VIDEO)) {
        SDL_Log("ERROR - %s\n", SDL_GetError());
        return 1;
    }

    Uint32 flags = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN;
    window = SDL_CreateWindow("Test GL Window", 1920, 1080, flags);
    if (!window) {
        SDL_Log("ERROR - %s\n", SDL_GetError());
        return 1;
    }

    glContext = SDL_GL_CreateContext(window);
    if (!glContext) {
        SDL_Log("ERROR - %s\n", SDL_GetError());
        return 1;
    }

    return 0;
}

Strangely, this error message is returned:
ERROR - Could not create GL context: The operation completed successfully.

This odd error message led me to debug SDL3. However it does appear to fail. In SDL_windowsopengl.c on line 747 the context that is returned from wglCreateContext() is NULL:

// Create legacy context
context = _this->gl_data->wglCreateContext(hdc);

Tested with a couple releases of GDK including June 2024 GDKX Update 2. They work with SDL2 and fail with SDL3. I’m using these helpful build instructions and the specific commit mentioned to build Mesa with GLon12 for Xbox.

Perhaps @TheSpydog or @flibitijibibo would know more why it no longer works in SDL3?

@slouken slouken added this to the 3.2.0 milestone Oct 17, 2024
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

No branches or pull requests

2 participants