diff --git a/README.md b/README.md
index 6dd4616..a385ea6 100644
--- a/README.md
+++ b/README.md
@@ -72,4 +72,4 @@ On the main simulation window:
- `space` Start/stop the sequencer
- `m` Mutates the current preset
- `Ctrl+s` Save the preset on the current slot
-- `Ctrl+c` Clear the current preset slot
\ No newline at end of file
+- `Ctrl+c` Clear the current preset slot
diff --git a/bin/data/support/gui-styles.json b/bin/data/support/gui-styles.json
index f475c7a..240127e 100644
--- a/bin/data/support/gui-styles.json
+++ b/bin/data/support/gui-styles.json
@@ -2,6 +2,9 @@
"default": {
"base": {
"border-radius": 4,
+ "border-color": "#444444",
+ "fill-color": "#aaaaaa",
+ "border-width": 1,
"text-color": "#ffffef"
},
diff --git a/esencia.sln b/esencia.sln
index 42a863d..095dde9 100644
--- a/esencia.sln
+++ b/esencia.sln
@@ -1,9 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35527.113 d17.12
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esencia", "esencia.vcxproj", "{7FD42DF7-442E-479A-BA76-D0022F99702A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openframeworksLib", "..\..\..\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj", "{5837595D-ACA9-485C-8E76-729040CE4B0B}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E2104F86-B40A-465C-8AE0-704E30EB6E5C}"
+ ProjectSection(SolutionItems) = preProject
+ LICENSE = LICENSE
+ README.md = README.md
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
diff --git a/esencia.vcxproj b/esencia.vcxproj
index 7dfac6f..570fb81 100644
--- a/esencia.vcxproj
+++ b/esencia.vcxproj
@@ -163,7 +163,7 @@
-
+
diff --git a/esencia.vcxproj.filters b/esencia.vcxproj.filters
index 3eb2bb6..8f5bd48 100644
--- a/esencia.vcxproj.filters
+++ b/esencia.vcxproj.filters
@@ -530,7 +530,7 @@
src\gui\panels
-
+
src\gui\panels
diff --git a/src/camera/Camera.cpp b/src/camera/Camera.cpp
index 36a070b..a9683d4 100644
--- a/src/camera/Camera.cpp
+++ b/src/camera/Camera.cpp
@@ -36,8 +36,6 @@ void Camera::setup(CameraParameters* params) {
else {
changeSource(VideoSources::VIDEOSOURCE_VIDEOFILE);
}
-
- restoreBackgroundReference(backgroundReference);
}
///
@@ -58,6 +56,8 @@ void Camera::onGUIChangeSource(bool& _) {
} else {
stopCurrentSource();
}
+
+ restoreBackgroundReference(backgroundReference);
}
@@ -67,6 +67,8 @@ void Camera::onGUIChangeSource(bool& _) {
///
/// From the list of VideoSources
void Camera::changeSource(VideoSources newSource) {
+ ofLogNotice(__FUNCTION__) << "Attempting to change source to " << (int)newSource;
+
stopCurrentSource();
currentVideosource = VideoSources::VIDEOSOURCE_NONE; // in the new setup fail, stay at None
@@ -80,6 +82,9 @@ void Camera::changeSource(VideoSources newSource) {
else if (newSource == VideoSources::VIDEOSOURCE_WEBCAM) {
setupWebcam();
}
+ else {
+ return;
+ }
// to-do: need to call setFrameSize with the updated frame size from the new source
setFrameSize(cameraResolutions[selectedOrbbecResolution].x, cameraResolutions[selectedOrbbecResolution].y);
@@ -107,9 +112,15 @@ void Camera::changeSource(VideoSources newSource) {
///
///
void Camera::setFrameSize(int width, int height) {
+ ofLogNotice(__FUNCTION__) << "Resizing every image and fb to " << width << ", " << height;
+
+ if (currentVideosource == VideoSources::VIDEOSOURCE_ORBBEC) {
if (orbbecSettings.rotation == OB_ROTATE_DEGREE_90 || orbbecSettings.rotation == OB_ROTATE_DEGREE_270) {
+ ofLogNotice(__FUNCTION__) << "Rotating orbbec camera also rotates dimentions (rotation " << orbbecSettings.rotation << " degrees)";
std::swap(width, height);
}
+ }
+
IMG_WIDTH = width;
IMG_HEIGHT = height;
@@ -154,10 +165,10 @@ void Camera::onGUIStartBackgroundReference(bool &value) {
/// Loads a video file to use it as the video source
///
void Camera::loadVideoFile() {
- ofLogNotice("Camera::loadVideoFile()") << "Switching source to video file";
+ ofLogNotice(__FUNCTION__) << "Switching source to video file";
// to-do: let the user select the file (ofFileDialogResult from ofSystemLoadDialog)
- ofLogNotice("Camera::loadVideoFile()") << "Attempting to load a video file";
+ ofLogNotice(__FUNCTION__) << "Attempting to load a video file";
prerecordedVideo.load("video_mocks/movement_nfov_h264.mp4");
// to-do: throw error when file does not exist, or cant be loaded
@@ -165,7 +176,13 @@ void Camera::loadVideoFile() {
prerecordedVideo.play();
currentVideosource = VideoSources::VIDEOSOURCE_VIDEOFILE;
- ofLogNotice("Camera::loadVideoFile()") << "Camera::loadVideoFile Video file loaded";
+ ofLogNotice(__FUNCTION__) << "Video file loaded";
+
+ // copy the the associated precaptured background into the right folder
+ ofFile::removeFile(BG_REFERENCE_FILENAME);
+ ofFile::copyFromTo("video_mocks\\" + BG_REFERENCE_FILENAME, BG_REFERENCE_FILENAME);
+ restoreBackgroundReference(backgroundReference);
+ ofLogNotice(__FUNCTION__) << "Load precaptured background reference from video file";
}
///
@@ -188,6 +205,7 @@ void Camera::setupOrbbecCamera() {
orbbecSettings.depthFrameSize.requestWidth = orbbecRequestedWidth;
orbbecSettings.rotation = OB_ROTATE_DEGREE_90;
orbbecCam.open(orbbecSettings);
+
currentVideosource = VideoSources::VIDEOSOURCE_ORBBEC;
}
@@ -215,10 +233,11 @@ void Camera::stopCurrentSource() {
ofLogNotice("Camera::stopCurrentSource()") << "Closing the orbbec camera";
orbbecCam.close();
}
- else if (currentVideosource == VideoSources::VIDEOSOURCE_VIDEOFILE) {
+ if (currentVideosource == VideoSources::VIDEOSOURCE_VIDEOFILE) {
ofLogNotice("Camera::stopCurrentSource()") << "Stopping the video file playback";
prerecordedVideo.stop();
}
+ currentVideosource = VideoSources::VIDEOSOURCE_NONE;
// webcam.stop
}
@@ -280,7 +299,14 @@ void Camera::draw() {
void Camera::update() {
// acquire frame
- if (currentVideosource == VideoSources::VIDEOSOURCE_VIDEOFILE) {
+ if (currentVideosource == VideoSources::VIDEOSOURCE_ORBBEC) {
+ orbbecCam.update();
+
+ if (orbbecCam.isFrameNewDepth()) {
+ source.setFromPixels(orbbecCam.getDepthPixels());
+ }
+ }
+ else if (currentVideosource == VideoSources::VIDEOSOURCE_VIDEOFILE) {
prerecordedVideo.update();
if (prerecordedVideo.isFrameNew()) {
@@ -288,15 +314,13 @@ void Camera::update() {
source = colorFrame;
}
}
-
- if (currentVideosource == VideoSources::VIDEOSOURCE_ORBBEC) {
- orbbecCam.update();
-
- if (orbbecCam.isFrameNewDepth()) {
- source.setFromPixels(orbbecCam.getDepthPixels());
- }
+ else {
+ // no source, no update
+ return;
}
+ parameters->previewSource.setFromPixels(source.getPixels());
+
// to-do: make backgroundref an object with state?
if (isTakingBackgroundReference) {
addSampleToBackgroundReference(source, backgroundReference, BG_SAMPLE_FRAMES);
@@ -306,10 +330,10 @@ void Camera::update() {
// all the processing from source to extract the final segment
processCameraFrame(source, backgroundReference);
-
// update the preview images on the shared parameters data structure for the GUI
- parameters->previewSource.setFromPixels(source.getPixels());
convertToTransparent(segment, parameters->previewSegment); // to-do: should be called only when accessed
+
+ saveDebugImage(segment, "segment", "final");
// parameters->previewBackground.setFromPixels(backgroundReference.getPixels()); // this does not need to run every update, so its placed when updating backgroundReference data
}
@@ -364,9 +388,11 @@ void Camera::processCameraFrame(ofxCvGrayscaleImage &frame, ofxCvGrayscaleImage
// ---------
// remove the background from the frame (save the output in maskImage object)
if (backgroundReferenceTaken) {
+ if (backgroundNewFrame.width != processedImage.width) return;
+
cvAbsDiff(processedImage.getCvImage(), backgroundNewFrame.getCvImage(), segment.getCvImage()); // this works great for a single background frame of reference!
- saveDebugImage(processedImage, "processedImage", "removed background absdiff");
+ saveDebugImage(segment, "segment", "removed background absdiff");
}
else {
segment = processedImage;
@@ -422,6 +448,8 @@ void Camera::processCameraFrame(ofxCvGrayscaleImage &frame, ofxCvGrayscaleImage
getContourPolygonsFromImage(processedImage, &polygons);
}
+ saveDebugImage(processedImage, "processedImage", "pre-gpuBlur");
+
// add gaussian blur to the silouetes
// (this step was originaly performed by the simulation on the sorounds of each particle, its here now to test if the performance is better)
gpuBlur(processedImage, parameters->gaussianBlur);
@@ -582,7 +610,7 @@ void Camera::startBackgroundReferenceSampling() {
}
void Camera::startBackgroundReferenceSampling(int samples) {
- ofLogNotice("Camera::startBackgroundReferenceSampling()") << "Starting background";
+ ofLogNotice(__FUNCTION__) << "Starting background sampling for futher substraction";
isTakingBackgroundReference = true;
backgroundReferenceTaken = false;
clearBackgroundReference();
@@ -590,10 +618,17 @@ void Camera::startBackgroundReferenceSampling(int samples) {
backgroundReferenceLeftFrames = samples;
}
+///
+/// Clear the background reference image
+/// will remove the previous bg reference file
+/// wil set the Taken flag to false
+///
void Camera::clearBackgroundReference() {
- ofLogNotice("Camera::clearBackgroundReference()") << "Clearing background";
+ ofLogNotice("Camera::clearBackgroundReference()") << "Cleaning background";
backgroundReference.set(0);
parameters->previewBackground.clear();
+ ofFile::removeFile(BG_REFERENCE_FILENAME);
+ backgroundReferenceTaken = false;
}
@@ -612,20 +647,27 @@ void Camera::saveBackgroundReference(ofxCvGrayscaleImage image) {
///
-/// Reloads a previous reference from the disk
+/// Reloads a previous background reference from the disk
///
///
/// True if loads the reference successfully
bool Camera::restoreBackgroundReference(ofxCvGrayscaleImage & outputImage) {
- ofLogNotice("Camera::restoreBackgroundReference") << "Attempting to load a background reference at data/" + BG_REFERENCE_FILENAME;
+ ofLogNotice(__FUNCTION__) << "Attempting to load a background reference at data/" + BG_REFERENCE_FILENAME;
+
ofPixels pixels;
bool loaded = ofLoadImage(pixels, BG_REFERENCE_FILENAME);
+
if (loaded) {
- // to-do: validate bg ref and frame have the same size resolution
+ // validate if the bg ref and the camera frame have the same size to continue, otherwise delete the bg ref for sanity
+ if (pixels.getWidth() != IMG_WIDTH || pixels.getHeight() != IMG_HEIGHT) {
+ ofLogError("Camera::restoreBackgroundReference") << "The background reference image has a different resolution from the current frame and will be deleted";
+ ofFile::removeFile(BG_REFERENCE_FILENAME);
+ return false;
+ }
outputImage.allocate(pixels.getWidth(), pixels.getHeight());
outputImage.setFromPixels(pixels);
backgroundReferenceTaken = true;
- parameters->previewBackground.setFromPixels(backgroundReference.getPixels()); // updates the gui preview // not perfect code, since this function should be agnostic and saving value to a pointer, but this param access is used directly
+ parameters->previewBackground.setFromPixels(backgroundReference.getPixels()); // updates the gui preview // not perfect code, since this function should be agnostic and saving value to a pointer, but using a param is convenient and params are already glueing the modules
ofLogNotice("Camera::restoreBackgroundReference") << "Load successfull";
}
else {
@@ -671,12 +713,17 @@ void convertToTransparent(ofxCvGrayscaleImage &grayImage, ofImage &rgbaImage) {
/// object name id (background, camera, cleared..)
/// additional id, i.e. sequence step
void Camera::saveDebugImage(ofxCvGrayscaleImage img, string name, string step) {
-#ifdef DEBUG_IMAGES
if (parameters->saveDebugImages) {
- const string& filename = ofGetTimestampString() + "_" + name + "_" + step + ".png";
+ const string& filename = "raw_recording\\" + ofGetTimestampString() + "_" + name + "_" + step + ".png";
ofSaveImage(img.getPixels(), filename);
}
-#endif
+}
+
+void Camera::saveDebugImage(ofPixels img, string name, string step) {
+ if (parameters->saveDebugImages) {
+ const string& filename = "raw_recording\\" + ofGetTimestampString() + "_" + name + "_" + step + ".png";
+ ofSaveImage(img, filename);
+ }
}
void Camera::recordTestingFrames(ofxCvGrayscaleImage img) {
diff --git a/src/camera/Camera.h b/src/camera/Camera.h
index f66b88c..6190e78 100644
--- a/src/camera/Camera.h
+++ b/src/camera/Camera.h
@@ -9,10 +9,10 @@
class Camera
{
enum class VideoSources : int {
- VIDEOSOURCE_ORBBEC,
- VIDEOSOURCE_VIDEOFILE,
- VIDEOSOURCE_WEBCAM,
- VIDEOSOURCE_NONE
+ VIDEOSOURCE_ORBBEC = 1,
+ VIDEOSOURCE_VIDEOFILE = 2,
+ VIDEOSOURCE_WEBCAM = 3,
+ VIDEOSOURCE_NONE = 0
};
public:
@@ -34,6 +34,7 @@ class Camera
void getContourPolygonsFromImage(ofxCvGrayscaleImage image, vector* output);
void saveDebugImage(ofxCvGrayscaleImage img, string name, string step);
+ void saveDebugImage(ofPixels img, string name, string step);
void recordTestingFrames(ofxCvGrayscaleImage frame);
uint64 recordTestingFramesCounter = 0;
void saveMeshFrame();
diff --git a/src/gui/EsenciaPanelBase.h b/src/gui/EsenciaPanelBase.h
index 09bedb2..e9a8658 100644
--- a/src/gui/EsenciaPanelBase.h
+++ b/src/gui/EsenciaPanelBase.h
@@ -9,6 +9,10 @@ const int PANELS_CIRCLE_RESOLUTION = 8;
const int PANELS_BEZIER_PADDING = 40;
const int PANELS_BEZIER_RESOLUTION = 10;
const int PANELS_TRIANGLE_SIZE = 4;
+const ofColor LINE_COLOR1 = ofColor::darkSlateGrey; //paleGoldenRod;
+const ofColor LINE_COLOR2 = ofColor::darkSlateGrey; //paleTurquoise;
+const ofColor LINE_COLOR3 = ofColor::darkSlateGrey; // khaki;
+const ofColor FLOW_COLOR = ofColor::darkSlateGrey; //paleGoldenRod;
class EsenciaPanelBase {
@@ -58,16 +62,16 @@ class EsenciaPanelBase {
ofPushMatrix();
// origin glyph
- ofSetColor(ofColor::paleGoldenRod, 200);
+ ofSetColor(LINE_COLOR2, 200);
ofSetCircleResolution(PANELS_CIRCLE_RESOLUTION);
ofFill();
ofDrawCircle(originCircleX, originCircleY, PANELS_CIRCLE_RADIUS);
// destination glyph
- ofSetColor(ofColor::paleTurquoise, 200);
+ ofSetColor(LINE_COLOR1, 200);
ofDrawArrow(destinationArrowStart, destinationArrowEnd, PANELS_TRIANGLE_SIZE);
- ofSetColor(ofColor::khaki, 200);
+ ofSetColor(LINE_COLOR3, 200);
ofPolyline l;
l.addVertex(originCircleX, originCircleY);
l.bezierTo(bezierCX1, bezierCY1,
@@ -79,7 +83,7 @@ class EsenciaPanelBase {
// Draw a 3x3 rectangle moving along the Bezier line
float percent = fmod((oy + ofGetElapsedTimef()) / 5, 1.0f); // Get a percentage value that loops from 0 to 1
ofVec3f rectPos = l.getPointAtPercent(percent);
- ofSetColor(ofColor::paleTurquoise, 180);
+ ofSetColor(FLOW_COLOR, 220);
ofDrawRectangle(rectPos.x - 1.5f, rectPos.y - 1.5f, 3, 3);
ofPopMatrix();
diff --git a/src/gui/GuiApp.cpp b/src/gui/GuiApp.cpp
index 6fc28c7..ed7c9df 100644
--- a/src/gui/GuiApp.cpp
+++ b/src/gui/GuiApp.cpp
@@ -5,7 +5,7 @@
void GuiApp::setup()
{
ofBackground(0);
- fbo.allocate(ofGetWindowWidth(), ofGetWindowHeight());
+ fbo.allocate(ofGetWindowWidth(), ofGetWindowHeight(), GL_RGBA32F_ARB);
ofEnableSmoothing();
gui.setupFlexBoxLayout();
@@ -38,7 +38,7 @@ void GuiApp::update()
{
presetsPanel.update();
- float colorProgress = ofxeasing::map_clamp(bgChangeFrequency++, 0, bgChangeDuration, 0, 1, &ofxeasing::linear::easeInOut);
+ float colorProgress = ofxeasing::map_clamp(bgChangeFrequency++, 0, bgChangeDuration, 0, 1, &ofxeasing::linear::easeInOut);
if (bgChangeFrequency == bgChangeDuration) bgChangeFrequency = 0;
if (colorProgress == 0) {
@@ -59,8 +59,11 @@ void GuiApp::update()
void GuiApp::draw()
{
- fbo.begin();
ofBackgroundGradient(bgColor2, bgColor1, OF_GRADIENT_LINEAR);
+ fbo.begin();
+
+ ofSetColor(255, 150);
+ ofDrawRectangle(0, 0, ofGetWidth(), ofGetHeight());
// draw lines
EsenciaPanelBase::drawLineBetween(videoOriginPanel, videoProcessingPanel);
@@ -75,10 +78,13 @@ void GuiApp::draw()
-
void GuiApp::keyReleased(ofKeyEventArgs& e) {
presetsPanel.keyReleased(e);
sequencePanel.keyReleased(e);
+
+ if (e.keycode == 'S' && e.hasModifier(OF_KEY_SHIFT)) {
+ ofSaveFrame(true);
+ }
}
diff --git a/src/gui/GuiApp.h b/src/gui/GuiApp.h
index a701f7d..81a0552 100644
--- a/src/gui/GuiApp.h
+++ b/src/gui/GuiApp.h
@@ -3,6 +3,7 @@
#include "ofMain.h"
#include "ofxGuiExtended.h"
#include "ofxOpenCv.h"
+#include "ofxEasing.h"
#include "ofxPresetsParametersBase.h"
#include "EsenciaParameters.h"
@@ -11,7 +12,7 @@
#include "panels/SystemstatsPanel.h"
#include "panels/SimulationPanel.h"
#include "panels/RenderPanel.h"
-#include "panels/VideoOriginPanel.h"
+#include "panels/VideoSourcePanel.h"
#include "panels/VideoProcessingPanel.h"
#include "panels/PresetsPanel.h"
#include "panels/SequencePanel.h"
@@ -57,7 +58,7 @@ class GuiApp
VideoProcessingPanel videoProcessingPanel;
- VideoOriginPanel videoOriginPanel;
+ VideoSourcePanel videoOriginPanel;
RenderPanel renderPanel;
diff --git a/src/gui/panels/SequencePanel.h b/src/gui/panels/SequencePanel.h
index cc26b4c..78bbc18 100644
--- a/src/gui/panels/SequencePanel.h
+++ b/src/gui/panels/SequencePanel.h
@@ -5,7 +5,7 @@
class SequencePanel : public EsenciaPanelBase {
- const ofRectangle PANEL_RECT = ofRectangle(11, 25, 12, 0);
+ const ofRectangle PANEL_RECT = ofRectangle(13, 26, 8, 0);
const ofColor &BG_COLOR = ofColor(100, 100, 100, 100);
const float DEFAULT_TRANSITION_DURATION_INIT = 5.0;
@@ -27,7 +27,7 @@ class SequencePanel : public EsenciaPanelBase {
ofParameter curPreset;
void setup(ofxGui& gui, PresetsParameters *params, ofxPresets&presetMan) {
- panel = gui.addPanel("sequence");
+ panel = gui.addPanel("sequencer");
presetParams = params;
presetManager = &presetMan;
@@ -98,7 +98,7 @@ class SequencePanel : public EsenciaPanelBase {
playButton->setNeedsRedraw();
}
void updatePlaybuttonToStopped() {
- playButton->setLabel("stopped");
+ playButton->setLabel("play");
playButton->setBackgroundColor(ofColor(ofColor::orangeRed, 200));
playButton->setNeedsRedraw();
}
diff --git a/src/gui/panels/VideoOriginPanel.h b/src/gui/panels/VideoSourcePanel.h
similarity index 84%
rename from src/gui/panels/VideoOriginPanel.h
rename to src/gui/panels/VideoSourcePanel.h
index 9836da3..324e812 100644
--- a/src/gui/panels/VideoOriginPanel.h
+++ b/src/gui/panels/VideoSourcePanel.h
@@ -2,7 +2,11 @@
#include "EsenciaPanelBase.h"
-class VideoOriginPanel : public EsenciaPanelBase {
+#define DEBUG_IMAGES false
+//#define RECORD_TESTING_VIDEO true
+
+
+class VideoSourcePanel : public EsenciaPanelBase {
const bool SOURCE_ORBBEC = { false };
const bool SOURCE_FILE = { false };
@@ -27,7 +31,6 @@ class VideoOriginPanel : public EsenciaPanelBase {
cameraSourcePanel->add(params._sourceOrbbec.set("orbbec camera", SOURCE_ORBBEC));
cameraSourcePanel->add(params._sourceVideofile.set("video file", SOURCE_FILE));
- //cameraSourcePanel->setWidth(w * 30);
cameraSourcePanel->minimize();
// DEPTH CLIPPING
@@ -65,12 +68,14 @@ class VideoOriginPanel : public EsenciaPanelBase {
+#if defined DEBUG_IMAGES || defined RECORD_TESTING_VIDEO
+ ofxGuiGroup* debug = panel->addGroup("debug");
+#endif
#ifdef DEBUG_IMAGES
- cameraGroup.add(ofParameter().set("DEBUG"));
- camera.add(cameraParameters.saveDebugImages.set("save debug images", false));
+ debug->add(params.saveDebugImages.set("save debug images", false));
#endif
#ifdef RECORD_TESTING_VIDEO
- camera.add(cameraParameters.recordTestingVideo.set("record testing video", false));
+ debug.add(cameraParameters.recordTestingVideo.set("record testing video", false));
#endif
diff --git a/src/main.cpp b/src/main.cpp
index 4517596..0cbc87c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,8 +20,8 @@ int main()
// gui window
- settings.setSize(34*30, 33*30);
- settings.setPosition(glm::vec2(0,50));
+ settings.setSize(34*30, 34*30);
+ settings.setPosition(glm::vec2(0,40));
settings.resizable = true;
auto mainWindow = ofCreateWindow(settings);
shared_ptr mainApp(new ofApp);
diff --git a/src/render/RenderApp.cpp b/src/render/RenderApp.cpp
index 4a12f27..5497b30 100644
--- a/src/render/RenderApp.cpp
+++ b/src/render/RenderApp.cpp
@@ -167,14 +167,21 @@ void RenderApp::keyReleased(ofKeyEventArgs& e)
int key = e.keycode;
switch (key)
{
- case 'F':
- {
- ofToggleFullscreen();
- fbo.allocate(ofGetWidth(), ofGetHeight());
- fboS.allocate(ofGetWidth(), ofGetHeight());
- break;
- }
- default: break;
+ case 'F':
+ {
+ ofToggleFullscreen();
+ fbo.allocate(ofGetWidth(), ofGetHeight());
+ fboS.allocate(ofGetWidth(), ofGetHeight());
+ break;
+ }
+
+ case 'S':
+ {
+ ofSaveFrame();
+ break;
+ }
+
+ default: break;
}
}
@@ -183,13 +190,18 @@ void RenderApp::mouseMoved(int x, int y) {
}
-//--------------------------------------------------------------
+///
+/// on window resized event
+/// updates the window size render parameter (simulator is listening to this from her side)
+///
+///
+///
void RenderApp::windowResized(int _width, int _height) {
ofLogNotice("RenderApp::windowResized()") << "window resized to: " << _width << "," << _height;
- fbo.allocate(_width, _height);
- fboS.allocate(_width, _height);
+ fbo.allocate(_width, _height, GL_RGBA);
+ fboS.allocate(_width, _height, GL_RGBA);
glm::vec2 newSize = glm::vec2(_width, _height);
parameters->windowSize.set(glm::vec2(_width, _height));
-}
\ No newline at end of file
+}