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
In Fullscreen, after 'Alt + Tab', my program just Blank Scre
ricoh11


Joined: 19 Dec 2012
Posts: 4
Hi.

I made a fullscreen with SDL 2.0.

but, i Input 'Alt + Tab' to change to desktop, and returned to my program by clicking my program title in task bar.

however, there is just blank (black) screen.

i heard in that case (i heard this is 'device lost'), the program have to re-create the texture.

so, my question is..

how to check the timing (or event) to re-create the texture??
[img]http://mail.naver.com/readReceipt/notify/?img=zrYw1zeo1BUwK6tlhAnwF4UwpopSMxUlFAblaxMrMxt9FAglp43SF4Fg%2BH%2B0Mogd74lR74lcWNFlbX30WLloWrdQaXFvWuIn1BFdbZln16iqpzm5WXiN.gif[/img]
In Fullscreen, after 'Alt + Tab', my program just Blank Scre
Sik


Joined: 26 Nov 2011
Posts: 905
I think that's specific to Direct3D. Not sure if OpenGL loses its
textures on video mode change.

Anyway, you can check when the window gains or loses focus if needed.
Look up the SDL_WINDOWEVENT event as well as the SDL_WindowEventID
enumeration.

2013/2/6, ricoh11:
Quote:


Hi.

I made a fullscreen with SDL 2.0.

but, i Input 'Alt + Tab' to change to desktop, and returned to my program
by clicking my program title in task bar.

however, there is just blank (black) screen.

i heard in that case (i heard this is 'device lost'), the program have to
re-create the texture.

so, my question is..

how to check the timing (or event) to re-create the texture??

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
In Fullscreen, after 'Alt + Tab', my program just Blank Scre
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
2013/2/6 ricoh11
Quote:

 
 
Hi.
 
I made a fullscreen with SDL 2.0.
 
but,  i Input 'Alt + Tab' to change to desktop, and returned to my program by clicking my program title in task bar.
 
however, there is just blank (black) screen.
 
i heard in that case (i heard this is 'device lost'), the program have to re-create the texture.
 
so, my question is..
 
how to check the timing (or event) to re-create the texture??


If you are using Direct3D or OpenGL ES on some Android devices, you may lose your "context" (device lost in D3D speak) and have to recreate the textures. We discussed about adding an event to notify the user of this situation, but never got around to implement it. The Direct3D backend uses managed textures which should recreate the textures automatically when the device is lost, however, if you use rendering to textures (http://wiki.libsdl.org/moin.cgi/SDL_SetRenderTarget), this won't be the case as they are not managed. Is this your case?



--
Gabriel.