Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Bojko committed Jun 23, 2017
2 parents 9b5f9ac + fe3c36c commit 68b4f26
Show file tree
Hide file tree
Showing 63 changed files with 387 additions and 4,535 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,15 @@ public:
};

void BaseAppSampleApp::prepareSettings(ci::app::App::Settings* settings) {
// Use this method to set up your window
SettingsManager::getInstance()->mFullscreen = false;
SettingsManager::getInstance()->mWindowSize = ivec2(1280, 720);
SettingsManager::getInstance()->mBorderless = false;

BaseApp::prepareSettings(settings);

// Optional: configure a multi-screen layout
ScreenLayout::getInstance()->setDisplaySize(ivec2(1080, 1920));
ScreenLayout::getInstance()->setNumRows(1);
ScreenLayout::getInstance()->setNumColumns(3);
// Optional: Override the shared settings manager instance with your subclass
SettingsManager::setInstance(myApp::MyAppSettingsManager::getInstance());

// Initialize the settings manager with the cinder app settings and the settings json
SettingsManager::getInstance()->setup(settings, ci::app::getAssetPath("appSettings.json"), [](SettingsManager * manager) {
// Optional: Override json defaults at runtime
manager->mFullscreen = false;
manager->mWindowSize = ivec2(1280, 720);
});
}

void BaseAppSampleApp::setup() {
Expand All @@ -64,10 +62,10 @@ void BaseAppSampleApp::setup() {

// Sample content
auto button = TouchViewRef(new TouchView());
button->setPosition(vec2(100, 100));
button->setPosition(vec2(400, 300));
button->setSize(vec2(200, 100));
button->setBackgroundColor(Color(1, 0, 0));
button->mDidTap.connect([=](bluecadet::touch::TouchEvent e) { CI_LOG_I("Button tapped"); });
button->getSignalTapped().connect([=](bluecadet::touch::TouchEvent e) { CI_LOG_I("Button tapped"); });
getRootView()->addChild(button);
}

Expand Down Expand Up @@ -98,7 +96,7 @@ CINDER_APP(BaseAppSampleApp, RendererGl(RendererGl::Options().msaa(4)), BaseAppS
## Notes
Version 1.3.1
Version 1.4.0
Based on [Cinder v0.9.1](https://github.com/cinder/Cinder/tree/v0.9.1)
Expand Down
37 changes: 37 additions & 0 deletions assets/appSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"settings": {
"general": {
"consoleWindowEnabled": true,
"FPS": 60,
"appVersion": "alpha-1.0"
},
"display": {
"width": 1920,
"height": 1080,
"columns": 1,
"rows": 1
},
"graphics": {
"verticalSync": true,
"fullscreen": true,
"borderless": false
},
"debug": {
"debugMode": true,
"drawMinimap": true,
"drawTouches": false,
"minimizeParams": true,
"drawScreenLayout": false
},
"touch": {
"mouse": true,
"tuio": true,
"native": true
},
"analytics": {
"appName": "",
"trackingID": "",
"clientID": ""
}
}
}
4 changes: 3 additions & 1 deletion cinderblock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
author="Bluecadet"
summary="Scene graph with nested transforms, events, touch/mouse delegation and app boilerplates."
license="MIT"
version="1.3.1"
version="1.4.0"
url="https://github.com/bluecadet/Cinder-BluecadetViews"
>

<requires>org.libcinder.tuio</requires>
<requires>com.bluecadet.cinder.text</requires>

<asset>assets/appSettings.json</asset>

<headerPattern>src/*.h</headerPattern>
<sourcePattern>src/*.cpp</sourcePattern>

Expand Down
74 changes: 38 additions & 36 deletions samples/BaseAppCrossPlatform/src/BaseAppCrossPlatformApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"

#include "cinder/Rand.h"

#include "bluecadet/core/BaseApp.h"
#include "bluecadet/views/TouchView.h"

Expand All @@ -15,54 +17,54 @@ using namespace bluecadet::touch;

class BaseAppCrossPlatformApp : public BaseApp {
public:
static void prepareSettings(ci::app::App::Settings* settings);
void setup() override;
void update() override;
void draw() override;
static void prepareSettings(ci::app::App::Settings* settings);
void setup() override;
void update() override;
void draw() override;
};

void BaseAppCrossPlatformApp::prepareSettings(ci::app::App::Settings* settings) {
// Use this method to set up your window
SettingsManager::getInstance()->mFullscreen = false;
SettingsManager::getInstance()->mWindowSize = ivec2(1280, 720);
SettingsManager::getInstance()->mBorderless = false;

BaseApp::prepareSettings(settings);

// Optional: configure a multi-screen layout (defaults to 1x1 1080p landscape)
ScreenLayout::getInstance()->setDisplaySize(ivec2(1080, 1920));
ScreenLayout::getInstance()->setNumRows(1);
ScreenLayout::getInstance()->setNumColumns(3);
// Initialize the settings manager with the cinder app settings and the settings json
SettingsManager::getInstance()->setup(settings, ci::app::getAssetPath("appSettings.json"), [](SettingsManager * manager) {
// Optional: Override json defaults at runtime
manager->mFullscreen = false;
manager->mWindowSize = ivec2(720, 405);
manager->mConsoleWindowEnabled = false;
manager->mDrawMinimap = true;
manager->mDrawStats = true;
manager->mDrawTouches = true;
});
}

void BaseAppCrossPlatformApp::setup() {

BaseApp::setup();
BaseApp::addTouchSimulatorParams();

// Optional: configure your root view
getRootView()->setBackgroundColor(Color::gray(0.5f));

// Sample content
auto button = TouchViewRef(new TouchView());
button->setSize(getRootView()->getSize() * 0.75f);
button->setPosition((getRootView()->getSize() - button->getSize()) * 0.5f);
button->setBackgroundColor(ColorA(1, 0, 0));
button->setMultiTouchEnabled(true);
button->mDidBeginTouch.connect([](bluecadet::touch::TouchEvent e) { e.touchTarget->setAlpha(0.75f); });
button->mDidEndTouch.connect([](bluecadet::touch::TouchEvent e) { e.touchTarget->setAlpha(1.0f); });
getRootView()->addChild(button);
BaseApp::setup();
BaseApp::addTouchSimulatorParams();

// Optional: configure your root view
getRootView()->setBackgroundColor(Color::gray(0.5f));

// Sample content
auto button = TouchViewRef(new TouchView());
button->setPosition(vec2(400, 300));
button->setSize(vec2(200, 100));
button->setBackgroundColor(Color(1, 0, 0));
button->getSignalTapped().connect([=](bluecadet::touch::TouchEvent e) {
ColorAf color = hsvToRgb(vec3(randFloat(), 1.0f, 1.0f));
button->getTimeline()->apply(&button->getBackgroundColor(), color, 0.33f, easeInOutQuad);
});

getRootView()->addChild(button);
}

void BaseAppCrossPlatformApp::update() {
// Optional override. BaseApp::update() will update all views.
BaseApp::update();
// Optional override. BaseApp::update() will update all views.
BaseApp::update();
}

void BaseAppCrossPlatformApp::draw() {
// Optional override. BaseApp::draw() will draw all views.
BaseApp::draw();
// Optional override. BaseApp::draw() will draw all views.
BaseApp::draw();
}

// Make sure to pass a reference to prepareSettings to configure the app correctly. MSAA and other render options are optional.
CINDER_APP(BaseAppCrossPlatformApp, RendererGl(RendererGl::Options().msaa(4)), BaseAppCrossPlatformApp::prepareSettings);
CINDER_APP(BaseAppCrossPlatformApp, RendererGl(RendererGl::Options().msaa(4)), BaseAppCrossPlatformApp::prepareSettings);
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\include;..\..\..\..\..\include;..\..\..\..\Cinder-BluecadetText\src;..\..\..\src;..\..\..\..\OSC\src;..\..\..\..\TUIO\src</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader />
Expand Down
Binary file not shown.
Loading

0 comments on commit 68b4f26

Please sign in to comment.