The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Problem with SDL_SetWindowFullscreen and SDL_SetTextureAlpha
RomanH


Joined: 24 May 2015
Posts: 2
Hi everybody

I'm currently porting my programs from SDL1.3 to SDL2 and want users to be able to switch between windowed- and fullscreen-mode. I use SDL_SetWindowFullscreen to do that and it works quite nicely. However, there is one thing that bugs me. As soon as I call SDL_SetWindowFullscreen my program immediately forgets about any "alpha"-information and even calling SDL_SetTextureAlphaMod again doesn't do anything. Which means I can't hav esemi-transparent sprites etc.

I create my window by calling:
Code:
gWindow = SDL_CreateWindow( "ProgName", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN);

or
Code:
gWindow = SDL_CreateWindow( "ProgName", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN|SDL_WINDOW_FULLSCREEN);


both work perfectly and show "alpha-textures" as long as I don't call SDL_SetWindowFullscreen.

I only tested it on a Windows 7 computer. Don't know if the behaviour would be the same on another operating system.

Am I the only one with this problem?

thanks!

RomanH
RomanH


Joined: 24 May 2015
Posts: 2
Hi everyone

sorry, it was my own fault. I compiled my programs on a computer on which I thought I had installed SDL 2.03. However, I had used libraries that are much older. Everything works now. Embarrassed Very Happy

RomanH