Skip to content

Instantly share code, notes, and snippets.

@cellfusion
Last active December 14, 2015 18:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cellfusion/5129544 to your computer and use it in GitHub Desktop.
Save cellfusion/5129544 to your computer and use it in GitHub Desktop.
Cinder0.8.5 で Orientations 対応する方法
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class CinderProjectApp : public AppNative {
public:
void setup();
void mouseDown( MouseEvent event );
void prepareSettings(Settings* settings);
void update();
void draw();
void hoge();
};
void CinderProjectApp::prepareSettings(Settings* settings) {
settings->enableHighDensityDisplay(true);
settings->enableStatusBar(true);
}
void CinderProjectApp::setup()
{
getSignalSupportedOrientations().connect([](){ return LandscapeRight; });
getSignalWillRotate().connect([this](){hoge();});
}
void CinderProjectApp::hoge() {
console() << "hoge" << std::endl;
}
void CinderProjectApp::mouseDown( MouseEvent event )
{
}
void CinderProjectApp::update()
{
}
void CinderProjectApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
gl::color(Colorf(1.0, 1.0, 1.0));
gl::drawSolidRect(Rectf(0, 0, 100, 100));
gl::color(Colorf(1.0, 0.0, 0.0));
gl::drawSolidRect(Rectf(200, 200, 300, 300));
gl::color(Colorf(0.0, 1.0, 0.0));
gl::drawSolidCircle(Vec2f(160, 240), 50, 8);
}
CINDER_APP_NATIVE( CinderProjectApp, RendererGl )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment