From 0c6659703c529274a3e82156c2fc2f9ea911c03b Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sun, 3 Jan 2016 15:25:11 +0000 Subject: [PATCH] Add `Info` class for displaying info --- src/Info/Info.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/Info/Info.h | 20 ++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/Info/Info.cpp create mode 100644 src/Info/Info.h diff --git a/src/Info/Info.cpp b/src/Info/Info.cpp new file mode 100644 index 0000000..717ecbf --- /dev/null +++ b/src/Info/Info.cpp @@ -0,0 +1,36 @@ +#include "Info.h" + +namespace ofx { +namespace piMapper { + +Info::Info(){ + _visible = false; +} + +void Info::draw(){ + if(_visible){ + stringstream ss; + ss << "There are 4 modes:\n\n"; + ss << " 1. Presentation mode\n"; + ss << " 2. Texture mapping mode\n"; + ss << " 3. Projection mapping mode\n"; + ss << " 4. Source selection mode\n\n"; + ss << "You can switch between the modes by using <1>, <2>, <3> and <4> " + "keys on the keyboard.\n\n"; + ss << "Press to add new triangle surface\n"; + ss << "Press to add new quad surface\n"; + ss << "Press to save the composition\n"; + ss << "Press to toggle fullscreen\n"; + ss << "Press to hide this message"; + ofDrawBitmapStringHighlight(ss.str(), 10, 20, + ofColor(0, 0, 0, 100), + ofColor(255, 255, 255, 200)); + } +} + +void Info::toggle(){ + _visible = !_visible; +} + +} // namespace piMapper +} // namespace ofx \ No newline at end of file diff --git a/src/Info/Info.h b/src/Info/Info.h new file mode 100644 index 0000000..31dd46d --- /dev/null +++ b/src/Info/Info.h @@ -0,0 +1,20 @@ +#pragma once + +#include "ofMain.h" + +namespace ofx { +namespace piMapper { + +class Info { + public: + Info(); + + void draw(); + void toggle(); + + private: + bool _visible; +}; + +} // namespace piMapper +} // namespace ofx \ No newline at end of file