Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Force a draw - outside of the ::draw() method?

$
0
0

Hi, something like this should do it:

//-----------------------------------------------------------------------------------------
//
class ofApp : public ofBaseApp
{
	public:


		//----------------------------------
		void setup()
		{
			loaded = false;
		}

		//----------------------------------
		void update()
		{
			if( !loaded && ofGetFrameNum() > 1 )
			{
				// LoadHeavyStuff();
				loaded = true;
			}

		}

		//----------------------------------
		void draw()
		{
			if( !loaded )
			{
				// draw something saying you're loading
			}
			else
			{
				draw normally
			}
		}

		bool loaded;
};

Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>