Skip to content

Commit

Permalink
chapter 4 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mimetaur committed Jan 12, 2013
1 parent b47bc26 commit c6a4300
Show file tree
Hide file tree
Showing 33 changed files with 1,647 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chapter04/Example1/include/Resources.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once
#include "cinder/CinderResources.h"
#include "Resources.h"

//#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE )
52 changes: 52 additions & 0 deletions chapter04/Example1/src/Example1App.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
#include "Particle.h"

using namespace ci;
using namespace ci::app;
using namespace std;

class Example1App : public AppBasic {
public:
void setup();
void prepareSettings(Settings *settings);
void mouseDown( MouseEvent event );
void update();
void draw();

Particle *mParticle;
float mFrames;
};

void Example1App::setup()
{
mParticle = new Particle(Vec2f(getWindowWidth() / 2, 10));
gl::clear( Color( 1, 1, 1 ) );
mFrames = 240;
}

void Example1App::prepareSettings(Settings *settings) {
settings->setWindowSize(640, 360);
settings->setFrameRate(60);
}

void Example1App::mouseDown( MouseEvent event )
{
}

void Example1App::update()
{
if (getElapsedFrames() > mFrames)
mParticle->update();
}

void Example1App::draw()
{
gl::color(1, 1, 1, 0.1);
gl::enableAlphaBlending();
gl::drawSolidRect(Rectf(getWindowBounds()));
gl::disableAlphaBlending();
mParticle->draw();
}

CINDER_APP_BASIC( Example1App, RendererGl )
Binary file added chapter04/Example1/xcode/CinderApp.icns
Binary file not shown.
328 changes: 328 additions & 0 deletions chapter04/Example1/xcode/Example1.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {

/* Begin PBXBuildFile section */
0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0091D8F80E81B9330029341E /* OpenGL.framework */; };
0097E3E50F3E9819005A4392 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0097E3E40F3E9819005A4392 /* QuickTime.framework */; };
00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */; };
00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */; };
00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */; };
00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */; };
00BAE65A0E7ED9C10018A608 /* Example1App.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00BAE6590E7ED9C10018A608 /* Example1App.cpp */; };
00CCAF15116A9FEE008396D5 /* CinderApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 00CCAF14116A9FEE008396D5 /* CinderApp.icns */; };
5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */; };
5323E6B60EAFCA7E003A9687 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B50EAFCA7E003A9687 /* QTKit.framework */; };
53E3CDFC0E86099300238D2B /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53E3CDFB0E86099300238D2B /* Carbon.framework */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
D8FFDF9516A1D22A00C39044 /* Particle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D8FFDF9316A1D22A00C39044 /* Particle.cpp */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0091D8F80E81B9330029341E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
0097E3E40F3E9819005A4392 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
00B784AF0FF439BC000DE1D7 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
00B784B10FF439BC000DE1D7 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
00B784B20FF439BC000DE1D7 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
00BAE6590E7ED9C10018A608 /* Example1App.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Example1App.cpp; path = ../src/Example1App.cpp; sourceTree = SOURCE_ROOT; };
00CCAF14116A9FEE008396D5 /* CinderApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = CinderApp.icns; sourceTree = SOURCE_ROOT; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32CA4F630368D1EE00C91783 /* Example1_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Example1_Prefix.pch; sourceTree = "<group>"; };
5323E6B10EAFCA74003A9687 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
5323E6B50EAFCA7E003A9687 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; };
53E3CDFB0E86099300238D2B /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Example1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example1.app; sourceTree = BUILT_PRODUCTS_DIR; };
D8FFDF9316A1D22A00C39044 /* Particle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Particle.cpp; sourceTree = "<group>"; };
D8FFDF9416A1D22A00C39044 /* Particle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Particle.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */,
53E3CDFC0E86099300238D2B /* Carbon.framework in Frameworks */,
5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */,
5323E6B60EAFCA7E003A9687 /* QTKit.framework in Frameworks */,
0097E3E50F3E9819005A4392 /* QuickTime.framework in Frameworks */,
00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */,
00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */,
00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */,
00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Source */ = {
isa = PBXGroup;
children = (
00BAE6590E7ED9C10018A608 /* Example1App.cpp */,
D8FFDF9316A1D22A00C39044 /* Particle.cpp */,
D8FFDF9416A1D22A00C39044 /* Particle.h */,
);
name = Source;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
00B784AF0FF439BC000DE1D7 /* Accelerate.framework */,
00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */,
00B784B10FF439BC000DE1D7 /* AudioUnit.framework */,
00B784B20FF439BC000DE1D7 /* CoreAudio.framework */,
0097E3E40F3E9819005A4392 /* QuickTime.framework */,
5323E6B50EAFCA7E003A9687 /* QTKit.framework */,
5323E6B10EAFCA74003A9687 /* CoreVideo.framework */,
53E3CDFB0E86099300238D2B /* Carbon.framework */,
0091D8F80E81B9330029341E /* OpenGL.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* Example1.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* Example1 */ = {
isa = PBXGroup;
children = (
29B97315FDCFA39411CA2CEA /* Headers */,
080E96DDFE201D6D7F000001 /* Source */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = Example1;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Headers */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* Example1_Prefix.pch */,
);
name = Headers;
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* Info.plist */,
00CCAF14116A9FEE008396D5 /* CinderApp.icns */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Example1 */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Example1" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Example1;
productInstallPath = "$(HOME)/Applications";
productName = Example1;
productReference = 8D1107320486CEB800E47090 /* Example1.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Example1" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* Example1 */;
projectDirPath = "";
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Example1 */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00CCAF15116A9FEE008396D5 /* CinderApp.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00BAE65A0E7ED9C10018A608 /* Example1App.cpp in Sources */,
D8FFDF9516A1D22A00C39044 /* Particle.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Example1_Prefix.pch;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
OTHER_LDFLAGS = (
"\"$(CINDER_PATH)/lib/libcinder_d.a\"",
"-lcurl",
);
PRODUCT_NAME = Example1;
SYMROOT = ./build;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_FAST_MATH = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Example1_Prefix.pch;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
OTHER_LDFLAGS = (
"\"$(CINDER_PATH)/lib/libcinder.a\"",
"-lcurl",
);
PRODUCT_NAME = Example1;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = ./build;
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = i386;
CINDER_PATH = ../../../../../cinder_0.8.4_mac;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/boost\"";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = i386;
CINDER_PATH = ../../../../../cinder_0.8.4_mac;
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/boost\"";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Example1" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Example1" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6a4300

Please sign in to comment.