Created
October 5, 2014 03:06
-
-
Save drewish/cb759f5a8c1a64711bd7 to your computer and use it in GitHub Desktop.
My Cinder StarterApp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cinder/app/AppNative.h" | |
#include "cinder/Camera.h" | |
#include "cinder/gl/gl.h" | |
#include "cinder/gl/Vbo.h" | |
#include "cinder/Utilities.h" | |
using namespace ci; | |
using namespace ci::app; | |
using namespace std; | |
class StarterApp : public AppNative { | |
public: | |
void prepareSettings( Settings *settings ) override; | |
void setup(); | |
void resize(); | |
void draw(); | |
cinder::CameraOrtho mCam; | |
}; | |
void StarterApp::prepareSettings( Settings *settings ) | |
{ | |
settings->enableHighDensityDisplay(); | |
settings->setWindowSize(800, 800); | |
} | |
void StarterApp::setup() | |
{ | |
} | |
void StarterApp::resize() | |
{ | |
int height = getWindowHeight(); | |
int width = getWindowWidth(); | |
mCam.setOrtho( 0, width, height, 0, -100, 100 ); | |
gl::setMatrices( mCam ); | |
} | |
void StarterApp::draw() | |
{ | |
gl::clear( Color::white() ); | |
gl::color( Color::black() ); | |
gl::enableWireframe(); | |
gl::pushModelView(); | |
/* | |
// Save a frame in the home directory. | |
if (getElapsedFrames() == 1) { | |
writeImage( getHomeDirectory() / "StarterAppOutput.png", copyWindowSurface() ); | |
} | |
*/ | |
gl::popModelView(); | |
gl::disableWireframe(); | |
} | |
CINDER_APP_NATIVE( StarterApp, RendererGl ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment