Guest User

Untitled

a guest
Jan 12th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. #include "cinder/app/AppBasic.h"
  2. #include "cinder/gl/gl.h"
  3. #include "cinder/ImageIo.h"
  4. #include "cinder/gl/Texture.h"
  5.  
  6. using namespace ci;
  7. using namespace ci::app;
  8. using namespace std;
  9.  
  10. class HelloCinderApp : public AppBasic {
  11.   public:
  12.     void prepareSettings( Settings *settings);
  13.     void setup();
  14.     void mouseDown( MouseEvent event );
  15.     void update();
  16.     void draw();
  17. };
  18.  
  19. void HelloCinderApp::prepareSettings( Settings *settings)
  20. {
  21.     settings->setFrameRate( 60.0f );
  22.     settings->setWindowSize( 800, 600);
  23. }
  24.  
  25. void HelloCinderApp::setup()
  26. {
  27. }
  28.  
  29. void HelloCinderApp::mouseDown( MouseEvent event )
  30. {
  31. }
  32.  
  33. void HelloCinderApp::update()
  34. {
  35.  
  36. }
  37.  
  38. void HelloCinderApp::draw()
  39. {  
  40.     float gray = sin( getElapsedSeconds() ) * 0.2f;
  41.     gl::clear( Color( gray, gray, gray ) );    
  42.     gl::Texture myImage;
  43.     myImage = gl::Texture( loadImage( loadResource( "image.jpg") ) );
  44.     gl::draw( myImage, getWindowBounds() );
  45.    
  46.     float x = getWindowWidth() / 2 + (cos( getElapsedSeconds() * 45 ) );
  47.     float y = getWindowHeight() / 2 + (sin( getElapsedSeconds() * 45 ) );
  48.     gl::drawSolidCircle( Vec2f( x, y ), 50.0f );
  49.    
  50.    
  51. }
  52.  
  53.  
  54. CINDER_APP_BASIC( HelloCinderApp, RendererGl )
Add Comment
Please, Sign In to add comment