Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "cinder/app/AppBasic.h"
- #include "cinder/gl/gl.h"
- #include "cinder/ImageIo.h"
- #include "cinder/gl/Texture.h"
- using namespace ci;
- using namespace ci::app;
- using namespace std;
- class HelloCinderApp : public AppBasic {
- public:
- void prepareSettings( Settings *settings);
- void setup();
- void mouseDown( MouseEvent event );
- void update();
- void draw();
- };
- void HelloCinderApp::prepareSettings( Settings *settings)
- {
- settings->setFrameRate( 60.0f );
- settings->setWindowSize( 800, 600);
- }
- void HelloCinderApp::setup()
- {
- }
- void HelloCinderApp::mouseDown( MouseEvent event )
- {
- }
- void HelloCinderApp::update()
- {
- }
- void HelloCinderApp::draw()
- {
- float gray = sin( getElapsedSeconds() ) * 0.2f;
- gl::clear( Color( gray, gray, gray ) );
- gl::Texture myImage;
- myImage = gl::Texture( loadImage( loadResource( "image.jpg") ) );
- gl::draw( myImage, getWindowBounds() );
- float x = getWindowWidth() / 2 + (cos( getElapsedSeconds() * 45 ) );
- float y = getWindowHeight() / 2 + (sin( getElapsedSeconds() * 45 ) );
- gl::drawSolidCircle( Vec2f( x, y ), 50.0f );
- }
- CINDER_APP_BASIC( HelloCinderApp, RendererGl )
Add Comment
Please, Sign In to add comment