Commit 95fd0acf authored by kimon-satan's avatar kimon-satan
Browse files

initial commit

parents
bin/*
!/bin/data/
.DS_Store
Build
# 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=../../..
endif
# call the project makefile!
include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
//ICONS - NEW IN 0072
ICON_NAME_DEBUG = icon-debug.icns
ICON_NAME_RELEASE = icon.icns
ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/
//IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to:
//ICON_FILE_PATH = bin/data/
OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS)
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
#version 150
in vec4 colorV;
out vec4 outputColor;
void main()
{
// gl_FragCoord contains the window relative coordinate for the fragment.
// we use gl_FragCoord.x position to control the red color value.
// we use gl_FragCoord.y position to control the green color value.
// please note that all r, g, b, a values are between 0 and 1.
/*float windowWidth = 1024.0;
float windowHeight = 768.0;
float r = gl_FragCoord.x / windowWidth;
float g = gl_FragCoord.y / windowHeight;
float b = 1.0;
float a = 1.0;*/
outputColor = colorV;
}
\ No newline at end of file
#version 150
uniform mat4 modelViewProjectionMatrix;
uniform float circleRadius;
in vec4 position;
in vec4 color;
out vec4 colorV;
void main(){
float a = 1.0f - length(position)/circleRadius;
a = pow(a, 0.4);
//pass the colour through modifying alpha by the distance from the center
colorV = vec4 (color.rgb, a);
gl_Position = modelViewProjectionMatrix * position;
}
################################################################################
# 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 = ../../..
################################################################################
# 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 =
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>cc.openFrameworks.ofapp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFile</key>
<string>${ICON}</string>
</dict>
</plist>
#include "ofMain.h"
#include "ofApp.h"
//========================================================================
int main( ){
ofGLWindowSettings settings;
settings.setGLVersion(3,2);
ofCreateWindow(settings);
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp(new ofApp());
}
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
shader.load("shadersGL3/shader");
mMesh.setMode(OF_PRIMITIVE_TRIANGLES); //not the most efficient winding mode ... but the easiest
mMesh.addVertex(ofVec3f(0,0,0)); // the center of the circle
ofColor c;
c.setHsb(255, 255, 255);
mMesh.addColor(c);
mCircleRadius = 300;
float h = 0;
for(int i = 0; i < 360; i ++){ //make a circle mesh with 360 points
ofVec3f p(sin(ofDegToRad(i)), cos(ofDegToRad(i)), 0); //sine and cos make a circle
p *= mCircleRadius; ///scale the circle
mMesh.addVertex(p);
h += 1.0f/360.0f * 255.0f;
c.setHsb(h, 255, 255);
mMesh.addColor(c);
}
for(int i = 1; i < 360; i++){
mMesh.addTriangle(0, i, (i%359)+1 );
}
}
//--------------------------------------------------------------
void ofApp::update(){
}
//--------------------------------------------------------------
void ofApp::draw(){
ofBackground(0);
ofTranslate(ofGetWidth()/2, ofGetHeight()/2);
shader.begin();
shader.setUniform1f("circleRadius", mCircleRadius);
mMesh.draw();
shader.end();
}
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
}
//--------------------------------------------------------------
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::windowResized(int w, int h){
}
//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){
}
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
}
\ No newline at end of file
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp{
public:
void setup();
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 windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
ofShader shader;
ofMesh mMesh;
float mCircleRadius;
};
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; };
E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; };
E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = E4B27C1510CBEB8E00536013;
remoteInfo = openFrameworks;
};
E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = E4B27C1410CBEB8E00536013;
remoteInfo = openFrameworks;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
E4C2427710CC5ABF004149E2 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; };
E4B69B5B0A3A1756003C02F2 /* vertColoursExampleDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = vertColoursExampleDebug.app; sourceTree = BUILT_PRODUCTS_DIR; };
E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; };
E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; };
E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ofApp.h; path = src/ofApp.h; sourceTree = SOURCE_ROOT; };
E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = "<group>"; };
E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; };
E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = "<group>"; };
F17E9AFE1C62019C00795BB2 /* shader.frag */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = shader.frag; path = bin/data/shadersGL3/shader.frag; sourceTree = "<group>"; };
F17E9AFF1C62019C00795BB2 /* shader.vert */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; name = shader.vert; path = bin/data/shadersGL3/shader.vert; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
E4B69B590A3A1756003C02F2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
BB4B014C10F69532006C3DED /* addons */ = {
isa = PBXGroup;
children = (
);
name = addons;
sourceTree = "<group>";
};
E4328144138ABC890047C5CB /* Products */ = {
isa = PBXGroup;
children = (
E4328148138ABC890047C5CB /* openFrameworksDebug.a */,
);
name = Products;
sourceTree = "<group>";
};
E4B69B4A0A3A1720003C02F2 = {
isa = PBXGroup;
children = (
E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */,
E4EB6923138AFD0F00A09F29 /* Project.xcconfig */,
F17E9AFE1C62019C00795BB2 /* shader.frag */,
F17E9AFF1C62019C00795BB2 /* shader.vert */,
E4B69E1C0A3A1BDC003C02F2 /* src */,
E4EEC9E9138DF44700A80321 /* openFrameworks */,
BB4B014C10F69532006C3DED /* addons */,
E4B69B5B0A3A1756003C02F2 /* vertColoursExampleDebug.app */,
);
sourceTree = "<group>";
};
E4B69E1C0A3A1BDC003C02F2 /* src */ = {
isa = PBXGroup;
children = (
E4B69E1D0A3A1BDC003C02F2 /* main.cpp */,
E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */,
E4B69E1F0A3A1BDC003C02F2 /* ofApp.h */,
);
path = src;
sourceTree = SOURCE_ROOT;
};
E4EEC9E9138DF44700A80321 /* openFrameworks */ = {
isa = PBXGroup;
children = (
E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */,
E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */,
);
name = openFrameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
E4B69B5A0A3A1756003C02F2 /* vertColoursExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "vertColoursExample" */;
buildPhases = (
E4B69B580A3A1756003C02F2 /* Sources */,
E4B69B590A3A1756003C02F2 /* Frameworks */,
E4B6FFFD0C3F9AB9008CF71C /* ShellScript */,
E4C2427710CC5ABF004149E2 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
E4EEB9AC138B136A00A80321 /* PBXTargetDependency */,
);
name = vertColoursExample;
productName = myOFApp;
productReference = E4B69B5B0A3A1756003C02F2 /* vertColoursExampleDebug.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
E4B69B4C0A3A1720003C02F2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
};
buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "vertColoursExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = E4B69B4A0A3A1720003C02F2;
productRefGroup = E4B69B4A0A3A1720003C02F2;
projectDirPath = "";
projectReferences = (
{
ProductGroup = E4328144138ABC890047C5CB /* Products */;
ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */;
},
);
projectRoot = "";
targets = (
E4B69B5A0A3A1756003C02F2 /* vertColoursExample */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = openFrameworksDebug.a;
remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXShellScriptBuildPhase section */
E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "rsync -aved ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\nrsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\nrsync -aved ../../../libs/glut/lib/osx/GLUT.framework \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\"\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
E4B69B580A3A1756003C02F2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */,
E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;