Results 1 to 8 of 8

Thread: Minimize/Resize the screen

  1. #1
    Squire
    Join Date
    Jun 2012
    Location
    Mexico
    Posts
    26

    Default Minimize/Resize the screen

    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)

  2. #2
    Lesser Knight
    Join Date
    Jan 2012
    Location
    Finland
    Posts
    31

    Default

    Quote Originally Posted by Zaxuhe View Post
    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)
    Founder, owner and pretty much everything else at
    Second Lion Ltd.

  3. #3
    Squire
    Join Date
    Jun 2012
    Location
    Mexico
    Posts
    26

    Default

    On windows the context, does get lost, any way to avoid this?

  4. #4
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Quote Originally Posted by Zaxuhe View Post
    On windows the context, does get lost, any way to avoid this?
    Yeah, it really shouldn't. Ok, fixed on svn
    Seth A. Robinson
    Robinson Technologies

  5. #5
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Quote Originally Posted by Zaxuhe View Post
    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.
    Seth A. Robinson
    Robinson Technologies

  6. #6
    Squire
    Join Date
    Jun 2012
    Location
    Mexico
    Posts
    26

    Default

    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
    Last edited by Zaxuhe; 06-07-2012 at 03:40 PM. Reason: Note

  7. #7
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Quote Originally Posted by Zaxuhe View Post
    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?
    Seth A. Robinson
    Robinson Technologies

  8. #8
    Squire
    Join Date
    Jun 2012
    Location
    Mexico
    Posts
    26

    Default

    Quote Originally Posted by Seth View Post
    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!

Similar Threads

  1. Load image, resize and save it
    By Dominik Dopplinger in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 03-01-2012, 08:14 PM
  2. blank screen
    By DavinciZhe in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 06-24-2011, 07:46 AM
  3. Bug screen
    By hachibi in forum Novashell Game Creation System
    Replies: 7
    Last Post: 12-20-2009, 11:53 PM
  4. Screen scrolling
    By Blint in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 08-21-2008, 08:40 PM
  5. Minimize? (MAC)
    By Suudsu2200 in forum Novashell Game Creation System
    Replies: 2
    Last Post: 03-05-2007, 08:18 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •