Guest User

ofApp.cpp

a guest
Jul 20th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.90 KB | None | 0 0
  1. #include "ofApp.h"
  2.  
  3. //--------------------------------------------------------------
  4. void ofApp::setup(){
  5.     shader.load("inkspread");
  6.     image.load("paintedsky_large.jpg");
  7. }
  8.  
  9. //--------------------------------------------------------------
  10. void ofApp::update(){
  11.  
  12. }
  13.  
  14. //--------------------------------------------------------------
  15. void ofApp::draw(){
  16.     float mousePosition = ofMap(mouseX, 0.0, ofGetWidth(), 0.0, 2.0, true);
  17.  
  18.     shader.begin();
  19.         image.draw(0,0);
  20.         shader.setUniform1f("T", mousePosition);
  21.     shader.end();
  22.    
  23.     ofSetColor(0,0,0);
  24.     ofDrawBitmapString("T = "+ofToString(mousePosition),10,10);
  25. }
  26.  
  27. //--------------------------------------------------------------
  28. void ofApp::keyPressed(int key){
  29.  
  30. }
  31.  
  32. //--------------------------------------------------------------
  33. void ofApp::keyReleased(int key){
  34.  
  35. }
  36.  
  37. //--------------------------------------------------------------
  38. void ofApp::mouseMoved(int x, int y ){
  39.  
  40. }
  41.  
  42. //--------------------------------------------------------------
  43. void ofApp::mouseDragged(int x, int y, int button){
  44.  
  45. }
  46.  
  47. //--------------------------------------------------------------
  48. void ofApp::mousePressed(int x, int y, int button){
  49.  
  50. }
  51.  
  52. //--------------------------------------------------------------
  53. void ofApp::mouseReleased(int x, int y, int button){
  54.  
  55. }
  56.  
  57. //--------------------------------------------------------------
  58. void ofApp::mouseEntered(int x, int y){
  59.  
  60. }
  61.  
  62. //--------------------------------------------------------------
  63. void ofApp::mouseExited(int x, int y){
  64.  
  65. }
  66.  
  67. //--------------------------------------------------------------
  68. void ofApp::windowResized(int w, int h){
  69.  
  70. }
  71.  
  72. //--------------------------------------------------------------
  73. void ofApp::gotMessage(ofMessage msg){
  74.  
  75. }
  76.  
  77. //--------------------------------------------------------------
  78. void ofApp::dragEvent(ofDragInfo dragInfo){
  79.  
  80. }
Add Comment
Please, Sign In to add comment