cellfusion
3/10/2013 - 5:26 PM

Cinder0.8.5 で Orientations 対応する方法

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 )