Last active
December 14, 2015 18:29
-
-
Save cellfusion/5129544 to your computer and use it in GitHub Desktop.
Cinder0.8.5 で Orientations 対応する方法
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/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