PDA

View Full Version : Minimize/Resize the screen



Zaxuhe
06-06-2012, 04:24 AM
Minimizing or resizing the screen unloads the textures (or it seems like so, everything gets white), I should reload them on each change? or what should I do? I load a lot of images and it takes some time, don't want that if you resize it on windows, linux or mac you have to wait 5 seconds each time, any tip on how to do it? (only tested it on windows)

Aki Koskinen
06-06-2012, 07:26 AM
Minimizing or resizing the screen unloads the textures (or it seems like so, everything gets white), I should reload them on each change? or what should I do? I load a lot of images and it takes some time, don't want that if you resize it on windows, linux or mac you have to wait 5 seconds each time, any tip on how to do it? (only tested it on windows)

Resizing the window might require recreating the OpenGL context which would then require reloading the textures. Minimizing the window shouldn't (at least in theory) require losing the context.

Anyways, when the textures need to be reloaded IMO it should be handled by Proton and the user (of the library) shouldn't need to do anything explicitly. This is how it works on Android already for example.

Just tested on Linux: minimizing the window doesn't lose the OpenGL context and resizing of windows is disabled so no problems there :)

Other opinions? (realizing this reply doesn't really get the OP any forward with the issue)

Zaxuhe
06-06-2012, 03:30 PM
On windows the context, does get lost, any way to avoid this?

Seth
06-07-2012, 12:39 AM
On windows the context, does get lost, any way to avoid this?

Yeah, it really shouldn't. Ok, fixed on svn :whistling: :ninja:

Seth
06-07-2012, 12:43 AM
Minimizing or resizing the screen unloads the textures (or it seems like so, everything gets white), I should reload them on each change? or what should I do? I load a lot of images and it takes some time, don't want that if you resize it on windows, linux or mac you have to wait 5 seconds each time, any tip on how to do it? (only tested it on windows)

Also, if you are using Surface/ResourceManager, like Aki mentioned, it actually has a system where it re-loads textures on demand, so you shouldn't be seeing any white boxes, unless you aren't using Surface to load them.

If you're doing your own texture management/loading, you can hook to the BaseApp::m_sig_unloadSurfaces signal to know when you've lost them. Even though I fixed the minimize/restore thing, this can still happen for other reasons (resizing the screen, toggling full screen) and is a must on Android where you lose stuff when task switching.

Zaxuhe
06-07-2012, 02:58 AM
Thanks for the super and awesome fast reply, will change all the resources to be loaded from the sdk (seems like easier, but will be time consuming)

on a side note, while compiling on the blackberry ndk, I found an small issue, some file paths (about 12) where pointing to your local folder (D:/projects/...) and when I tried to compile I couldn't because not everything was pointing to $PATH, this was solved by pointing directly to the files on the folder

EDIT: also I do need to bind the font texture if I want to print the fps text, it does not get bind auto, I guess it should be done automatically?

EDIT2: just tested on windows on linux, the minimize problem was solved :)

AND ONE LAST EDIT: on android you need to run "android update project --PATH ./ --target 7", it dosen't says on the wiki, guess it should

Seth
06-08-2012, 05:56 AM
on a side note, while compiling on the blackberry ndk, I found an small issue, some file paths (about 12) where pointing to your local folder (D:/projects/...) and when I tried to compile I couldn't because not everything was pointing to $PATH, this was solved by pointing directly to the files on the folder


Hmm, which example project was this? (Or both?) I'll fix!


on android you need to run "android update project --PATH ./ --target 7", it dosen't says on the wiki, guess it should

Is this with the windows build.bat (it does run "call android update project -p ./" from app_info_setup.bat, which is called from build.bat.. so it should have worked...) or with the linux build script?

Zaxuhe
06-08-2012, 01:12 PM
Hmm, which example project was this? (Or both?) I'll fix!



Is this with the windows build.bat (it does run "call android update project -p ./" from app_info_setup.bat, which is called from build.bat.. so it should have worked...) or with the linux build script?

I didn't tested both projects, just bare bones not sure about the other one :)

On windows build.bat does run call android update project -p ./, but if its the first time you have to run it, you need to add a target (atleast on my case I had to manually run that command with target 7 once and after that it would run all times, but not if I didn't)

Thank you!