Giter Site home page Giter Site logo

Regression: "Window framebuffer support not available" error if software renderer is explicitly enforced in the SDL_HINT_RENDER_DRIVER about sdl HOT 7 CLOSED

olekolek1000 avatar olekolek1000 commented on August 15, 2024
Regression: "Window framebuffer support not available" error if software renderer is explicitly enforced in the SDL_HINT_RENDER_DRIVER

from sdl.

Comments (7)

slouken avatar slouken commented on August 15, 2024 1

Fixed, thanks!

from sdl.

slouken avatar slouken commented on August 15, 2024

What platform are you seeing this on? Are you testing with the latest code?
I tested on Windows both with and without forcing the rendering path, and in each case the software renderer wasn't used and the window surface was successfully created.

from sdl.

olekolek1000 avatar olekolek1000 commented on August 15, 2024

It's Linux, tested again with the latest commit (9d47dae):

SDL_RENDER_DRIVER=software ./test/testdrawchessboard
ERROR: Render creation for surface fail : Parameter 'window' is invalid

SDL_RENDER_DRIVER=opengl and others work just fine.

from sdl.

slouken avatar slouken commented on August 15, 2024

I just tested and that same setup works fine here.

That error message means that SDL_CreateSoftwareRenderer() failed, which doesn't make any sense because the hint shouldn't affect that, and there is never any window in that code path. Can you debug that function to see what's happening?

from sdl.

olekolek1000 avatar olekolek1000 commented on August 15, 2024

Differences between the environment flag and without it:
In testdrawchessboard.c:133, SDL_GetWindowSurface(window) returns null instead of SDL_Surface
In SDL_video.c:3371, SDL_CreateWindowFramebuffer returns null instead of SDL_Surface
In SDL_video.c:3311, ShouldAttemptTextureFramebuffer is false, thus created_framebuffer is never set, returning null

image

Removing this piece of code (which was introduced in 5c8d92e ) mitigates this issue.

from sdl.

olekolek1000 avatar olekolek1000 commented on August 15, 2024

SDL_CreateSoftwareRenderer fails here:

SDL_render.c, SDL_CreateRendererWithProperties:

    if ((!window && !surface) || (window && surface)) {
        SDL_InvalidParamError("window");
        goto error;
    }

Parameter window is null here, because SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL) returns a null pointer here.

surface is null here because SDL_GetWindowSurface() returns null before calling this function, and SDL_SetProperty is set with a null surface.

from sdl.

slouken avatar slouken commented on August 15, 2024

Okay, I'm able to reproduce this on Wayland, thanks!

from sdl.

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.