summaryrefslogtreecommitdiff
path: root/nditest
diff options
context:
space:
mode:
Diffstat (limited to 'nditest')
-rw-r--r--nditest/Makefile13
-rw-r--r--nditest/addons.make1
-rw-r--r--nditest/config.make142
-rw-r--r--nditest/libs/libndi.3.dylibbin0 -> 1989504 bytes
-rw-r--r--nditest/obj/osx/Release/.compiler_flags1
-rw-r--r--nditest/src/main.cpp13
-rw-r--r--nditest/src/ofApp.cpp128
-rw-r--r--nditest/src/ofApp.h35
-rwxr-xr-xnditest/start2
9 files changed, 335 insertions, 0 deletions
diff --git a/nditest/Makefile b/nditest/Makefile
new file mode 100644
index 0000000..177e172
--- /dev/null
+++ b/nditest/Makefile
@@ -0,0 +1,13 @@
+# Attempt to load a config.make file.
+# If none is found, project defaults in config.project.make will be used.
+ifneq ($(wildcard config.make),)
+ include config.make
+endif
+
+# make sure the the OF_ROOT location is defined
+ifndef OF_ROOT
+ OF_ROOT=$(realpath ../../..)
+endif
+
+# call the project makefile!
+include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
diff --git a/nditest/addons.make b/nditest/addons.make
new file mode 100644
index 0000000..e77b1fe
--- /dev/null
+++ b/nditest/addons.make
@@ -0,0 +1 @@
+ofxN \ No newline at end of file
diff --git a/nditest/config.make b/nditest/config.make
new file mode 100644
index 0000000..469c495
--- /dev/null
+++ b/nditest/config.make
@@ -0,0 +1,142 @@
+################################################################################
+# CONFIGURE PROJECT MAKEFILE (optional)
+# This file is where we make project specific configurations.
+################################################################################
+
+################################################################################
+# OF ROOT
+# The location of your root openFrameworks installation
+# (default) OF_ROOT = ../../..
+################################################################################
+ OF_ROOT = ../../openFrameworks
+
+################################################################################
+# PROJECT ROOT
+# The location of the project - a starting place for searching for files
+# (default) PROJECT_ROOT = . (this directory)
+#
+################################################################################
+# PROJECT_ROOT = .
+
+################################################################################
+# PROJECT SPECIFIC CHECKS
+# This is a project defined section to create internal makefile flags to
+# conditionally enable or disable the addition of various features within
+# this makefile. For instance, if you want to make changes based on whether
+# GTK is installed, one might test that here and create a variable to check.
+################################################################################
+# None
+
+################################################################################
+# PROJECT EXTERNAL SOURCE PATHS
+# These are fully qualified paths that are not within the PROJECT_ROOT folder.
+# Like source folders in the PROJECT_ROOT, these paths are subject to
+# exlclusion via the PROJECT_EXLCUSIONS list.
+#
+# (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank)
+#
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+# PROJECT_EXTERNAL_SOURCE_PATHS =
+
+################################################################################
+# PROJECT EXCLUSIONS
+# These makefiles assume that all folders in your current project directory
+# and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations
+# to look for source code. The any folders or files that match any of the
+# items in the PROJECT_EXCLUSIONS list below will be ignored.
+#
+# Each item in the PROJECT_EXCLUSIONS list will be treated as a complete
+# string unless teh user adds a wildcard (%) operator to match subdirectories.
+# GNU make only allows one wildcard for matching. The second wildcard (%) is
+# treated literally.
+#
+# (default) PROJECT_EXCLUSIONS = (blank)
+#
+# Will automatically exclude the following:
+#
+# $(PROJECT_ROOT)/bin%
+# $(PROJECT_ROOT)/obj%
+# $(PROJECT_ROOT)/%.xcodeproj
+#
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+# PROJECT_EXCLUSIONS =
+
+################################################################################
+# PROJECT LINKER FLAGS
+# These flags will be sent to the linker when compiling the executable.
+#
+# (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs
+#
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+
+# Currently, shared libraries that are needed are copied to the
+# $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to
+# add a runtime path to search for those shared libraries, since they aren't
+# incorporated directly into the final executable application binary.
+# TODO: should this be a default setting?
+# PROJECT_LDFLAGS=-Wl,-rpath=./libs
+
+################################################################################
+# PROJECT DEFINES
+# Create a space-delimited list of DEFINES. The list will be converted into
+# CFLAGS with the "-D" flag later in the makefile.
+#
+# (default) PROJECT_DEFINES = (blank)
+#
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+# PROJECT_DEFINES =
+
+################################################################################
+# PROJECT CFLAGS
+# This is a list of fully qualified CFLAGS required when compiling for this
+# project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS
+# defined in your platform specific core configuration files. These flags are
+# presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below.
+#
+# (default) PROJECT_CFLAGS = (blank)
+#
+# Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in
+# your platform specific configuration file will be applied by default and
+# further flags here may not be needed.
+#
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+# PROJECT_CFLAGS =
+
+################################################################################
+# PROJECT OPTIMIZATION CFLAGS
+# These are lists of CFLAGS that are target-specific. While any flags could
+# be conditionally added, they are usually limited to optimization flags.
+# These flags are added BEFORE the PROJECT_CFLAGS.
+#
+# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets.
+#
+# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank)
+#
+# PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets.
+#
+# (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank)
+#
+# Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the
+# PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration
+# file will be applied by default and further optimization flags here may not
+# be needed.
+#
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+# PROJECT_OPTIMIZATION_CFLAGS_RELEASE =
+# PROJECT_OPTIMIZATION_CFLAGS_DEBUG =
+
+################################################################################
+# PROJECT COMPILERS
+# Custom compilers can be set for CC and CXX
+# (default) PROJECT_CXX = (blank)
+# (default) PROJECT_CC = (blank)
+# Note: Leave a leading space when adding list items with the += operator
+################################################################################
+# PROJECT_CXX =
+# PROJECT_CC =
diff --git a/nditest/libs/libndi.3.dylib b/nditest/libs/libndi.3.dylib
new file mode 100644
index 0000000..773c469
--- /dev/null
+++ b/nditest/libs/libndi.3.dylib
Binary files differ
diff --git a/nditest/obj/osx/Release/.compiler_flags b/nditest/obj/osx/Release/.compiler_flags
new file mode 100644
index 0000000..47bd934
--- /dev/null
+++ b/nditest/obj/osx/Release/.compiler_flags
@@ -0,0 +1 @@
+-Os -mtune=native -DNDEBUG -stdlib=libc++ -Wall -fexceptions -fpascal-strings -mmacosx-version-min=10.9 -D__MACOSX_CORE__ -fPIC -x objective-c++ -std=c++11 -I../../openFrameworks/libs/FreeImage/include -I../../openFrameworks/libs/boost/include -I../../openFrameworks/libs/boost/include/boost -I../../openFrameworks/libs/cairo/include -I../../openFrameworks/libs/cairo/include/cairo -I../../openFrameworks/libs/curl/include -I../../openFrameworks/libs/curl/include/curl -I../../openFrameworks/libs/fmodex/include -I../../openFrameworks/libs/freetype/include -I../../openFrameworks/libs/freetype/include/freetype2 -I../../openFrameworks/libs/freetype/include/freetype2/freetype -I../../openFrameworks/libs/freetype/include/freetype2/freetype/config -I../../openFrameworks/libs/freetype/include/freetype2/freetype/internal -I../../openFrameworks/libs/freetype/include/freetype2/freetype/internal/services -I../../openFrameworks/libs/glew/include -I../../openFrameworks/libs/glew/include/GL -I../../openFrameworks/libs/glfw/include -I../../openFrameworks/libs/glfw/include/GLFW -I../../openFrameworks/libs/glm/include -I../../openFrameworks/libs/glm/include/glm -I../../openFrameworks/libs/glm/include/glm/detail -I../../openFrameworks/libs/glm/include/glm/gtc -I../../openFrameworks/libs/glm/include/glm/gtx -I../../openFrameworks/libs/glm/include/glm/simd -I../../openFrameworks/libs/json/include -I../../openFrameworks/libs/kiss/include -I../../openFrameworks/libs/pugixml/include -I../../openFrameworks/libs/rtAudio/include -I../../openFrameworks/libs/tess2/include -I../../openFrameworks/libs/uriparser/include -I../../openFrameworks/libs/uriparser/include/uriparser -I../../openFrameworks/libs/utf8/include -I../../openFrameworks/libs/utf8/include/utf8 -I../../openFrameworks/libs/utf8cpp/include -I../../openFrameworks/libs/utf8cpp/include/utf8 -I../../openFrameworks/libs/openFrameworks -I../../openFrameworks/libs/openFrameworks/3d -I../../openFrameworks/libs/openFrameworks/app -I../../openFrameworks/libs/openFrameworks/communication -I../../openFrameworks/libs/openFrameworks/events -I../../openFrameworks/libs/openFrameworks/gl -I../../openFrameworks/libs/openFrameworks/graphics -I../../openFrameworks/libs/openFrameworks/math -I../../openFrameworks/libs/openFrameworks/sound -I../../openFrameworks/libs/openFrameworks/types -I../../openFrameworks/libs/openFrameworks/utils -I../../openFrameworks/libs/openFrameworks/video -I/work/workspace/raverony/nditest/libs -I/work/workspace/raverony/nditest/src -I/work/workspace/openFrameworks/addons/ofxN/src -I/work/workspace/openFrameworks/addons/ofxN/libs -I/work/workspace/openFrameworks/addons/ofxN/libs/libndi -I/work/workspace/openFrameworks/addons/ofxN/libs/libndi/includes -I/work/workspace/openFrameworks/addons/ofxN/libs/libndi/lib -I/work/workspace/openFrameworks/addons/ofxN/libs/libndi/lib/osx -stdlib=libc++ -mmacosx-version-min=10.9 -v -framework Accelerate -framework QTKit -framework AGL -framework ApplicationServices -framework AudioToolbox -framework CoreAudio -framework CoreFoundation -framework CoreServices -framework OpenGL -framework IOKit -framework Cocoa -framework CoreVideo -framework AVFoundation -framework CoreMedia -framework QuartzCore -framework Security -framework LDAP
diff --git a/nditest/src/main.cpp b/nditest/src/main.cpp
new file mode 100644
index 0000000..1589978
--- /dev/null
+++ b/nditest/src/main.cpp
@@ -0,0 +1,13 @@
+#include "ofMain.h"
+#include "ofApp.h"
+
+//========================================================================
+int main()
+{
+ ofGLFWWindowSettings settings;
+ settings.width = 1280;
+ settings.height = 720;
+ ofCreateWindow(settings);
+
+ ofRunApp(new ofApp());
+}
diff --git a/nditest/src/ofApp.cpp b/nditest/src/ofApp.cpp
new file mode 100644
index 0000000..e8e6422
--- /dev/null
+++ b/nditest/src/ofApp.cpp
@@ -0,0 +1,128 @@
+#include "ofApp.h"
+
+//--------------------------------------------------------------
+void ofApp::setup()
+{
+ ofSetLogLevel(OF_LOG_NOTICE);
+ ofBackground(ofColor::black);
+
+ NDI.init();
+ int framenum=0;
+}
+
+//--------------------------------------------------------------
+void ofApp::exit()
+{
+ NDI.stopThread();
+}
+
+//--------------------------------------------------------------
+void ofApp::update()
+{
+
+}
+
+ofPolyline ofApp::polyLineTransform(const ofPolyline& poly, ofMatrix4x4 xform){
+ ofPolyline tempPoly;
+ for (auto& p:poly){
+ tempPoly.addVertex(ofVec3f(p)*xform);
+ }
+ return tempPoly;
+}
+
+ofPolyline ofApp::makePolygon(int num,float diam){
+ ofPolyline poly;
+ float step=PI*2/num;
+ for (int i=0;i<=num;i++){
+ poly.addVertex(cos(step*i)*diam,sin(step*i)*diam);
+ }
+ return poly;
+}
+
+void ofApp::drawPoly(ofPolyline poly,float x,float y){
+ glPushMatrix();
+ ofTranslate(x,y);
+ poly.draw();
+ for (int i=0;i<poly.size();i++){
+ ofDrawBitmapString(poly.getDegreesAtIndex(i),poly[i].x+10,poly[i].y+10,0);
+ }
+ glPopMatrix();
+}
+
+
+//--------------------------------------------------------------
+void ofApp::draw(){
+ ofBackground(0,0,0);
+ ofSetColor(255,255,255);
+
+ ofMatrix4x4 m = ofMatrix4x4::newIdentityMatrix();
+ m.rotateRad(ofGetElapsedTimef(),0,0,1);
+ m.translate(ofGetWidth()/2,ofGetHeight()/2,0);
+
+ drawPoly(polyLineTransform(makePolygon(4,200),m),200,200);
+ drawPoly(polyLineTransform(makePolygon(5,200),m),-200,200);
+ drawPoly(polyLineTransform(makePolygon(6,200),m),-200,-200);
+}
+
+//--------------------------------------------------------------
+void ofApp::keyPressed(int key)
+{
+ switch(key){
+ case 'c':{
+ if (NDI.connect()==0){
+ printf("no connection\n");
+ }
+ else printf("connected\n");
+ }
+ }
+}
+
+//--------------------------------------------------------------
+void ofApp::keyReleased(int key){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::mouseMoved(int x, int y){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::mouseDragged(int x, int y, int button){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::mousePressed(int x, int y, int button){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::mouseReleased(int x, int y, int button){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::mouseEntered(int x, int y){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::mouseExited(int x, int y){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::windowResized(int w, int h){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::gotMessage(ofMessage msg){
+
+}
+
+//--------------------------------------------------------------
+void ofApp::dragEvent(ofDragInfo dragInfo){
+
+}
diff --git a/nditest/src/ofApp.h b/nditest/src/ofApp.h
new file mode 100644
index 0000000..ab8c14f
--- /dev/null
+++ b/nditest/src/ofApp.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxN.h"
+
+class ofApp
+ : public ofBaseApp
+{
+public:
+ void setup();
+ void exit();
+
+ void update();
+ void draw();
+
+ void keyPressed(int key);
+ void keyReleased(int key);
+ void mouseMoved(int x, int y);
+ void mouseDragged(int x, int y, int button);
+ void mousePressed(int x, int y, int button);
+ void mouseReleased(int x, int y, int button);
+ void mouseEntered(int x, int y);
+ void mouseExited(int x, int y);
+ void windowResized(int w, int h);
+ void dragEvent(ofDragInfo dragInfo);
+ void gotMessage(ofMessage msg);
+
+ ofPolyline polyLineTransform(const ofPolyline& poly, ofMatrix4x4 xform);
+ ofPolyline makePolygon(int num,float diam);
+ void drawPoly(ofPolyline poly,float x,float y);
+
+ ofxN NDI;
+
+ int framenum;
+};
diff --git a/nditest/start b/nditest/start
new file mode 100755
index 0000000..b7817d6
--- /dev/null
+++ b/nditest/start
@@ -0,0 +1,2 @@
+mkdir bin/nditest.app/Contents/MacOS/@rpath
+cp libs/* bin/nditest.app/Contents/MacOS/@rpath/