Browse Source

Merge branch 'develop', version 0.2.2

master
Krisjanis Rijnieks 11 years ago
parent
commit
2f02f4ccee
  1. 12
      README.md
  2. 9
      src/Sources/FboSource.cpp
  3. 13
      src/Sources/FboSource.h
  4. 7
      src/Surfaces/QuadSurface.cpp
  5. 7
      src/Surfaces/SurfaceManager.cpp
  6. 9
      src/UserInterface/SourcesEditor.cpp

12
README.md

@ -138,7 +138,7 @@ sudo rpi-update
fatal error: libavcodec/opt.h: No such file or directory
```
To fix that, create a file `opt.h` in `addons/ofxOMXPlayer/libs/ffmpeg/libavcodec/` with the following contents:
To fix that, create a file `opt.h` in `addons/ofxOMXPlayer/libs/ffmpeg/include/libavcodec/` with the following contents:
**opt.h**
@ -165,13 +165,19 @@ A short wishlist for the next releases:
- Syphon source for Mac
- Spout source for Win
- Streaming source for RPi (fb sharing, network streams...)
- Even better structure
- Even better code structure
### Version 0.2.2 (2014-11-17):
- Remove perspective warping in favour of doing mesh warping first and then adding proper perspective warping as a wrapper of the mesh warp
- Fixed issue 24 (selected surface FBO source not checked in the sources editor view)
- Fix OMX player workaround instructions
### Version 0.2.1 (2014-11-05):
- Added single instance feature. Now you can use ofxPiMapper as single object for your project.
- Added FBO source. You can create a custom openFrameworks application for piMapper by extending the FboSource class. Add/register your custom object as source in piMapper and you will be able to select it in the source editor. Source is saved and loaded from the settings as well.
- Fixed issue #15
- Added -f (fullscreen) flag for the Raspberry Pi version. Use `./yourApp -f` to launch it fullscreen on start.
- Added XCode project file to example.
### Version 0.2.0 (2014-10-18):
- Added logo (thanks [Irina Spicaka](http://irina.spicaka.info/))

9
src/Sources/FboSource.cpp

@ -3,7 +3,7 @@
namespace ofx {
namespace piMapper {
FboSource::FboSource() : fbo(NULL) {
name = PIMAPPER_DEF_FBO_SOURCE_NAME;
name = PIMAPPER_FBO_SOURCE_DEF_NAME;
loadable = false;
loaded = false;
type = SourceType::SOURCE_TYPE_FBO;
@ -32,6 +32,13 @@ namespace ofx {
void FboSource::onAppSetup(ofEventArgs &args) {
ofRemoveListener(ofEvents().setup, this, &FboSource::onAppSetup, OF_EVENT_ORDER_BEFORE_APP);
setup();
// Check if FBO was allocated in user defined setup
// If not, show warning and alocate to avoid panic
if (!fbo->isAllocated()) {
ofLogWarning("FboSource::onAppSetup") << "FBO not allocated, allocating with default values";
allocate(PIMAPPER_FBO_SOURCE_DEF_WIDTH, PIMAPPER_FBO_SOURCE_DEF_HEIGHT);
}
}
void FboSource::onAppUpdate(ofEventArgs &args) {

13
src/Sources/FboSource.h

@ -10,7 +10,9 @@ class YourGenerativeSource : public FboSource {
#include "ofMain.h"
#include "BaseSource.h"
#define PIMAPPER_DEF_FBO_SOURCE_NAME "FBO Source"
#define PIMAPPER_FBO_SOURCE_DEF_NAME "FBO Source"
#define PIMAPPER_FBO_SOURCE_DEF_WIDTH 500
#define PIMAPPER_FBO_SOURCE_DEF_HEIGHT 500
namespace ofx {
namespace piMapper {
@ -38,12 +40,15 @@ namespace ofx {
virtual void draw() {}; // But this is the only place where you shoud do drawing
virtual void exit() {};
// Use these to set up FBo itself
void allocate(int width, int height);
void clear(); // The only method from BaseSource to be overriden
// The only method from BaseSource to be overriden
void clear();
protected:
ofFbo* fbo;
// Use this instead fbo->allocate as it sets other source related settings
// It is protected to force the user to create derived FBO sources from this
void allocate(int width, int height);
};
} // namespace piMapper
} // namespace ofx

7
src/Surfaces/QuadSurface.cpp

@ -3,7 +3,6 @@
namespace ofx {
namespace piMapper {
QuadSurface::QuadSurface() {
cout << "QuadSurface constructor." << endl;
setup();
}
@ -76,6 +75,7 @@ void QuadSurface::draw() {
/*if(mesh.haveVertsChanged() || mesh.haveTexCoordsChanged()){
calculate4dTextureCoords();
}*/
/*
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(4, GL_FLOAT, 0, quadTexCoordinates);
glVertexPointer(3, GL_FLOAT, 0, quadVertices);
@ -83,6 +83,11 @@ void QuadSurface::draw() {
source->getTexture()->bind();
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, quadIndices);
source->getTexture()->unbind();
*/
source->getTexture()->bind();
mesh.draw();
source->getTexture()->unbind();
}
void QuadSurface::setVertex(int index, ofVec2f p) {

7
src/Surfaces/SurfaceManager.cpp

@ -2,10 +2,9 @@
namespace ofx {
namespace piMapper {
SurfaceManager::SurfaceManager() {
// Init variables
mediaServer = NULL;
}
SurfaceManager::SurfaceManager() :
mediaServer(NULL),
selectedSurface(NULL) {}
SurfaceManager::~SurfaceManager() { clear(); }

9
src/UserInterface/SourcesEditor.cpp

@ -133,7 +133,14 @@ namespace piMapper {
fboSelector->enable();
}
BaseSource* source = surfaceManager->getSelectedSurface()->getSource();
selectSourceRadioButton(source->getPath());
// TODO: getPath should be replaced with something like getId() as now we
// use paths for loadable sources and names for FBOs
if (source->getType() == SourceType::SOURCE_TYPE_FBO) {
selectSourceRadioButton(source->getName());
} else {
selectSourceRadioButton(source->getPath());
}
}
void SourcesEditor::setSurfaceManager(SurfaceManager* newSurfaceManager) {

Loading…
Cancel
Save