Created
December 10, 2019 10:12
-
-
Save duskvirkus/80411572d7c492e85811b6c09b5cb60c to your computer and use it in GitHub Desktop.
Cinder Sketch Starter, cmake is setup for project to be two levels below cinder root
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
cmake_minimum_required( VERSION 2.8 FATAL_ERROR ) | |
set( CMAKE_VERBOSE_MAKEFILE ON ) | |
project( Sketch ) | |
get_filename_component( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../.." ABSOLUTE ) | |
get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE ) | |
include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" ) | |
ci_make_app( | |
SOURCES ${APP_PATH}/src/Sketch.cpp | |
CINDER_PATH ${CINDER_PATH} | |
) |
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 "./Sketch.h" | |
void Sketch::setup() | |
{ | |
} | |
void Sketch::update() | |
{ | |
} | |
void Sketch::draw() | |
{ | |
} | |
void Sketch::keyDown(ci::app::KeyEvent event) | |
{ | |
if (event.getChar() == 'f') | |
{ | |
ci::app::setFullScreen(!isFullScreen()); | |
} | |
else if (event.getCode() == ci::app::KeyEvent::KEY_ESCAPE) | |
{ | |
if(ci::app::isFullScreen()) | |
{ | |
ci::app::setFullScreen(false); | |
} | |
else | |
{ | |
quit(); | |
} | |
} | |
} | |
void prepareSettings(Sketch::Settings* settings) | |
{ | |
settings->setMultiTouchEnabled(false); | |
} | |
CINDER_APP(Sketch, ci::app::RendererGl, prepareSettings) |
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/App.h" | |
#include "cinder/app/RendererGl.h" | |
#include "cinder/gl/gl.h" | |
class Sketch : public ci::app::App | |
{ | |
private: | |
public: | |
void setup() override; | |
void update() override; | |
void draw() override; | |
void keyDown(ci::app::KeyEvent event) override; | |
}; | |
void prepareSettings(Sketch::Settings* settings); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment