FryGUI CPU usage
BlitzMax Forums/BlitzMax Programming/FryGUI CPU usage
| ||
I am requesting some advice regarding CPU usage and FryGUI. I made a minimal app - just creates a screen in FryGUI and loops. I note that cpu usage during execution is 100%. Here is code SuperStrict 'import FryGui Import fry.frygui 'Set graphics and blendmode before loading the gui AppTitle="FryGui Canvas Test" Graphics 1024,768,0,0 fry_SetResolution (1024,768) fry_SystemCursor(False) SetBlend ALPHABLEND 'load in a skin for the GUI fry_LoadSkin("Skin1") 'add the fonts to the GUI. Fonts will be referenced by their names. fry_AddFont("Default", "trebucbd.ttf", 13) fry_AddFont("Large", "trebucbd.ttf", 24) 'create a screen Local scr1:fry_TScreen=fry_CreateScreen("Screen1") 'set the initial screen - need to do this or the gui will crash fry_SetScreen("Screen1") SetClsColor 40,40,70 'main loop While Not KeyHit(KEY_ESCAPE) PollSystem Cls 'refresh the gui fry_Refresh() Flip(0) GCCollect() Wend Do I need to add a timer ? or just let it run flat out? Thanks Matty |
| ||
Replace PollSystem with WaitEvent |
| ||
Thanks. I did change the Flip(0) to just Flip and this dropped the CPU usage from 100% to about 5% when no events were being generated. |