SDL_GetWindowSurface creates a renderer?

Hi, trying to figure some stuff out,
I’m using SDLCS with IMGUI.Net
everything is working fine on linux, but failing on windows.
in my attempts to find out why things are failing on windows, I realised I was not actualy calling SDL_CreateRenderer anywhere, even though I was succesfully SDL_GetRenderer - on linux at least, I found that in windows (or at least in a windows virtual machine) SDL_GetRenderer was returning an IntPtr.Zero…

a bit more experimenting and I found that calling SDL_GetWindowSurface apeared to be creating a Renderer, is this normal? why is it doing it on linux, but not windows?

regardless, I threw in a check for GetRenderer being Zero and created one if it wasn’t already there, but I still apear to be having problems on windows.
after calling SDL.SDL_GL_BindTexture(pcmd.TextureId, out w, out h);
a call to SDL.SDL_GetError(); returns: “That operation is not supported”.
How do I go about finding out why it doesn’t want to bind the texture here?
as well as it having problems with textures, SDL_RenderDrawLine() does not apear to be doing anything on windows, (again both these are working fine in linux mint)

Probably a very silly question, but are you forcing the use of OpenGL? Direct3D is the default renderer in Windows so of course any GL call will fail. If the explanation is that simple, you need to add:

SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
1 Like

It was exactly that simple.
Thankyou very much, that’s solved the problem of it not working in windows!

still unsure why I seem to be getting the renderer ‘for free’ on linux though. seems odd that I have to create it in one place, but not the other.