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

How to run update() and draw() in keyPressed() event

$
0
0

Mantissa,

Sorry my code was not clear.
Not in the draw() but I was trying to call draw() in a for loop in the keyPressed event.

    void testApp::keyPressed(int key) {
    switch (key) {
    case ' ':
      for(int i=0 i < 100; i++){
           if(i % 10 == 0)
            someUpdateFunction();
            draw();
           }
          break;
    }
}

Viewing all articles
Browse latest Browse all 40524

Trending Articles



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