Window doesn't show unless I specify fullscreen

Here is my (abbreviated) code (it’s Ada, sorry! The calls are all the same though):

with SDL; use SDL;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with System; use System;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

procedure Main is

	Background_Surface : access SDL_Surface;
	No_Ui : Boolean := false;
	Window : access SDL_Window;
	Surface : access SDL_Surface;
	
	procedure Init is
	begin
		if SDL_Init(SDL_INIT_VIDEO) < 0 then
			No_Ui := true;
			Put_Line("Init failed!");
			Put_Line(Value(SDL_GetError));
			return;
		end if;
	end Init;

        procedure Get_Background is
	begin
		Background_Surface := SDL_LoadBMP(To_C("background.bmp"));
		if Background_Surface = null then
			Put_Line("SDL_LoadBMP failed!");
			Put_Line(Value(SDL_GetError));
			No_Ui := true;
			return;
		end if;
	end Get_Background;
	
	procedure Show_Window is
	begin
		Put_Line("Showing Window!");
		--Window := SDL_CreateWindow(To_C("SDL Tutorial"), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Background_Surface.w, Background_Surface.h, SDL_WINDOW_SHOWN + SDL_WINDOW_FULLSCREEN);
		Window := SDL_CreateWindow(To_C("SDL Tutorial"), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Background_Surface.w, Background_Surface.h, SDL_WINDOW_SHOWN);
		if Window = null then
			No_Ui := true;
			Put_Line(Value(SDL_GetError));
			SDL_Quit;
			return;
		end if;
		SDL_SetWindowBordered(Window, SDL_TRUE);
		Surface := SDL_GetWindowSurface(Window);
		if Surface = null then
			No_Ui := true;
			Put_Line(Value(SDL_GetError));
			return;
		end if;
	end Show_Window;
	
	procedure Draw is
		Temp : Interfaces.C.Int;
	begin
		Temp := SDL_BlitSurface(Background_Surface, NULL, Surface, NULL );
		Temp := SDL_UpdateWindowSurface(Window);
	end Draw;
	
	procedure Clean_Up is
	begin
		if Background_Surface /= null then
			SDL_FreeSurface(Background_Surface);
			Background_Surface := null;
		end if;
		if Surface /= null then
			SDL_FreeSurface(Surface);
			Surface := null;
		end if;
		if Window /= null then
			SDL_DestroyWindow(Window);
			Window := null;
		end if;
		SDL_Quit;
	end Clean_Up;
	
begin
	Init;
	Get_Background;
	Show_Window;
	Draw;
	
	declare
		E : aliased SDL_Event;
		Quit : Boolean;
	begin
		while not Quit loop
			while Integer(SDL_PollEvent(E'Access)) /= 0 loop
				if E.typ = SDL_SHUTDOWN then
					Quit := true;
				end if;
				if E.typ = SDL_KEYDOWN then
					Quit := true;
				end if;
			end loop;
			delay 0.1;
		end loop;
	end;
	
	Clean_Up;
end Main;

If I run it with the SDL_VIDEO_FULLSCREEN flag, it works (although for some reason the image only fills a quarter of the screen… It’s just the Lazy Foo image saved as a bmp), but if I try to run it without, SDL refuses to show anything. Not sure what I could be forgetting; this should be a pretty simple exercise.

To clarify, the Put_Line commands are basic console output commands (like printf or cout), and the only output I’m receiving is “Showing Window!”, so it doesn’t look like any of these calls are failing; just for some reason, no window appears.

Any help is appreciated.

So I didn’t actually find a solution for the problem as stated, but I did find a way to get to the actual end goal. For whatever reason, if I specify borderless (which was what I wanted anyway; I didn’t realize you could specify it at SDL_CreateWindow time), the window is shown, and without a border.

According to The SDL_CreateWindow documentation, SDL_WINDOW_SHOWN is ignored by the function call because it’s the default, which I assume means that when you pass in, for example, SDL_WINDOW_BORDERLESS, you don’t need to OR it with SDL_WINDOW_SHOWN, but it made me curious, so as an experiment, I tried running it passing in 0 instead of any of the defined flags:

Wind := SDL_CreateWindow(To_C("SDL Tutorial"), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Background_Surface.w, Background_Surface.h, 0);--SDL_WINDOW_BORDERLESS);

It has the same behavior that I was observing with SDL_WINDOW_SHOWN. I’m not sure if the binding has anything to do with it (all evidence I’ve seen suggests it doesn’t) but I will mention that a few versions ago (I believe it was 2.0.3 but I’m not positive), I used to run in Windowed mode using the SDL_WINDOW_SHOWN flag with no issue, and I still use the same binding now that I used then.

So while my issue is resolved, if anyone has any insight to what might be happening with the windowed mode, please share in case someone else has the same issue.

Thanks!