Skip to content

Commit 539cf96

Browse files
committed
initial commit
0 parents  commit 539cf96

38 files changed

+11100
-0
lines changed

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#OSX
2+
.DS_Store
3+
*.swp
4+
*~.nib
5+
# Thumbnails
6+
._*
7+
8+
bin/
9+
build/
10+
obj/
11+
*.o
12+
Debug*/
13+
Release*/
14+
*.mode*
15+
*.app/
16+
*.pyc
17+
18+
#XCode
19+
*.pbxuser
20+
*.perspective
21+
*.perspectivev3
22+
*.mode1v3
23+
*.mode2v3
24+
*.xcactivitylog
25+
#XCode 4
26+
xcuserdata
27+
*.xcworkspace
28+
xcode/DerivedData/
29+
DerivedData/

example/Project.xcconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
2+
//THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
3+
OF_PATH = ../../..
4+
5+
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
6+
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
7+
8+
OTHER_LDFLAGS = $(OF_CORE_LIBS)
9+
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)

example/ofxShivaVGRendererTest.xcodeproj/project.pbxproj

Lines changed: 689 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
version = "1.3">
4+
<BuildAction
5+
parallelizeBuildables = "YES"
6+
buildImplicitDependencies = "YES">
7+
<BuildActionEntries>
8+
<BuildActionEntry
9+
buildForTesting = "YES"
10+
buildForRunning = "YES"
11+
buildForProfiling = "YES"
12+
buildForArchiving = "YES"
13+
buildForAnalyzing = "YES">
14+
<BuildableReference
15+
BuildableIdentifier = "primary"
16+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
17+
BuildableName = "ofxShivaVG.app"
18+
BlueprintName = "ofxShivaVGRendererTest"
19+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
20+
</BuildableReference>
21+
</BuildActionEntry>
22+
</BuildActionEntries>
23+
</BuildAction>
24+
<TestAction
25+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
26+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
27+
shouldUseLaunchSchemeArgsEnv = "YES"
28+
buildConfiguration = "Debug">
29+
<Testables>
30+
</Testables>
31+
<MacroExpansion>
32+
<BuildableReference
33+
BuildableIdentifier = "primary"
34+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
35+
BuildableName = "ofxShivaVG.app"
36+
BlueprintName = "ofxShivaVGRendererTest"
37+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
38+
</BuildableReference>
39+
</MacroExpansion>
40+
</TestAction>
41+
<LaunchAction
42+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
43+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
44+
launchStyle = "0"
45+
useCustomWorkingDirectory = "NO"
46+
buildConfiguration = "Debug"
47+
ignoresPersistentStateOnLaunch = "NO"
48+
debugDocumentVersioning = "YES"
49+
allowLocationSimulation = "YES">
50+
<BuildableProductRunnable>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
54+
BuildableName = "ofxShivaVG.app"
55+
BlueprintName = "ofxShivaVGRendererTest"
56+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
57+
</BuildableReference>
58+
</BuildableProductRunnable>
59+
<AdditionalOptions>
60+
</AdditionalOptions>
61+
</LaunchAction>
62+
<ProfileAction
63+
shouldUseLaunchSchemeArgsEnv = "YES"
64+
savedToolIdentifier = ""
65+
useCustomWorkingDirectory = "NO"
66+
buildConfiguration = "Debug"
67+
debugDocumentVersioning = "YES">
68+
<BuildableProductRunnable>
69+
<BuildableReference
70+
BuildableIdentifier = "primary"
71+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
72+
BuildableName = "ofxShivaVG.app"
73+
BlueprintName = "ofxShivaVGRendererTest"
74+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
75+
</BuildableReference>
76+
</BuildableProductRunnable>
77+
</ProfileAction>
78+
<AnalyzeAction
79+
buildConfiguration = "Debug">
80+
</AnalyzeAction>
81+
<ArchiveAction
82+
buildConfiguration = "Debug"
83+
revealArchiveInOrganizer = "YES">
84+
</ArchiveAction>
85+
</Scheme>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
version = "1.3">
4+
<BuildAction
5+
parallelizeBuildables = "YES"
6+
buildImplicitDependencies = "YES">
7+
<BuildActionEntries>
8+
<BuildActionEntry
9+
buildForTesting = "YES"
10+
buildForRunning = "YES"
11+
buildForProfiling = "YES"
12+
buildForArchiving = "YES"
13+
buildForAnalyzing = "YES">
14+
<BuildableReference
15+
BuildableIdentifier = "primary"
16+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
17+
BuildableName = "ofxShivaVG.app"
18+
BlueprintName = "ofxShivaVGRendererTest"
19+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
20+
</BuildableReference>
21+
</BuildActionEntry>
22+
</BuildActionEntries>
23+
</BuildAction>
24+
<TestAction
25+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
26+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
27+
shouldUseLaunchSchemeArgsEnv = "YES"
28+
buildConfiguration = "Release">
29+
<Testables>
30+
</Testables>
31+
<MacroExpansion>
32+
<BuildableReference
33+
BuildableIdentifier = "primary"
34+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
35+
BuildableName = "ofxShivaVG.app"
36+
BlueprintName = "ofxShivaVGRendererTest"
37+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
38+
</BuildableReference>
39+
</MacroExpansion>
40+
</TestAction>
41+
<LaunchAction
42+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
43+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
44+
launchStyle = "0"
45+
useCustomWorkingDirectory = "NO"
46+
buildConfiguration = "Release"
47+
ignoresPersistentStateOnLaunch = "NO"
48+
debugDocumentVersioning = "YES"
49+
allowLocationSimulation = "YES">
50+
<BuildableProductRunnable>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
54+
BuildableName = "ofxShivaVG.app"
55+
BlueprintName = "ofxShivaVGRendererTest"
56+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
57+
</BuildableReference>
58+
</BuildableProductRunnable>
59+
<AdditionalOptions>
60+
</AdditionalOptions>
61+
</LaunchAction>
62+
<ProfileAction
63+
shouldUseLaunchSchemeArgsEnv = "YES"
64+
savedToolIdentifier = ""
65+
useCustomWorkingDirectory = "NO"
66+
buildConfiguration = "Release"
67+
debugDocumentVersioning = "YES">
68+
<BuildableProductRunnable>
69+
<BuildableReference
70+
BuildableIdentifier = "primary"
71+
BlueprintIdentifier = "E4B69B5A0A3A1756003C02F2"
72+
BuildableName = "ofxShivaVG.app"
73+
BlueprintName = "ofxShivaVGRendererTest"
74+
ReferencedContainer = "container:ofxShivaVGRendererTest.xcodeproj">
75+
</BuildableReference>
76+
</BuildableProductRunnable>
77+
</ProfileAction>
78+
<AnalyzeAction
79+
buildConfiguration = "Release">
80+
</AnalyzeAction>
81+
<ArchiveAction
82+
buildConfiguration = "Release"
83+
revealArchiveInOrganizer = "YES">
84+
</ArchiveAction>
85+
</Scheme>

example/openFrameworks-Info.plist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleExecutable</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>com.yourcompany.openFrameworks</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundlePackageType</key>
14+
<string>APPL</string>
15+
<key>CFBundleSignature</key>
16+
<string>????</string>
17+
<key>CFBundleVersion</key>
18+
<string>1.0</string>
19+
</dict>
20+
</plist>

example/simpleVGContext.cpp

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#include "simpleVGContext.h"
2+
3+
simpleVGContext::simpleVGContext()
4+
:_hasContext(false)
5+
{
6+
7+
}
8+
9+
void simpleVGContext::create(VGint w, VGint h)
10+
{
11+
_hasContext = vgCreateContextSH(w, h);
12+
}
13+
14+
void simpleVGContext::setFillColor(VGint r, VGint g, VGint b, VGint a)
15+
{
16+
setFillColor(r/255.0f, g/255.0f, b/255.0f, a/255.0f);
17+
}
18+
19+
void simpleVGContext::setFillColor(VGfloat r, VGfloat g, VGfloat b, VGfloat a)
20+
{
21+
if (_fillPaint) vgDestroyPaint(_fillPaint);
22+
23+
VGfloat color[] = {r, g, b, a};
24+
_fillPaint = vgCreatePaint();
25+
vgSetParameterfv(_fillPaint, VG_PAINT_COLOR, 4, color);
26+
vgSetPaint(_fillPaint, VG_FILL_PATH);
27+
}
28+
29+
void simpleVGContext::setStrokeColor(VGint r, VGint g, VGint b, VGint a)
30+
{
31+
setStrokeColor(r/255.0f, g/255.0f, b/255.0f, a/255.0f);
32+
}
33+
34+
void simpleVGContext::setStrokeColor(VGfloat r, VGfloat g, VGfloat b, VGfloat a)
35+
{
36+
if (_strokePaint) vgDestroyPaint(_strokePaint);
37+
38+
VGfloat color[] = {r, g, b, a};
39+
_strokePaint = vgCreatePaint();
40+
vgSetParameterfv(_strokePaint, VG_PAINT_COLOR, 4, color);
41+
vgSetPaint(_strokePaint, VG_STROKE_PATH);
42+
}
43+
44+
void simpleVGContext::setStrokeWidth(VGfloat w)
45+
{
46+
_strokeWidth = w;
47+
vgSeti(VG_STROKE_LINE_WIDTH, w);
48+
}
49+
50+
VGfloat simpleVGContext::getStrokeWidth()
51+
{
52+
return _strokeWidth;
53+
}
54+
55+
void simpleVGContext::setStrokeJoinStyle(VGJoinStyle join)
56+
{
57+
_strokeJoinStyle = join;
58+
vgSeti(VG_STROKE_JOIN_STYLE, join);
59+
}
60+
61+
void simpleVGContext::setStrokeCapStyle(VGCapStyle cap)
62+
{
63+
_strokeCapStyle = cap;
64+
vgSeti(VG_STROKE_CAP_STYLE, cap);
65+
}
66+
67+
VGCapStyle simpleVGContext::getStrokeCapStyle()
68+
{
69+
return _strokeCapStyle;
70+
}
71+
72+
VGJoinStyle simpleVGContext::getStrokeJoinStyle()
73+
{
74+
return _strokeJoinStyle;
75+
}
76+
77+
void simpleVGContext::fillPath(simpleVGPath &path)
78+
{
79+
vgDrawPath(path.getVGPath(), VG_FILL_PATH);
80+
}
81+
82+
void simpleVGContext::strokePath(simpleVGPath &path)
83+
{
84+
vgDrawPath(path.getVGPath(), VG_STROKE_PATH);
85+
}
86+
87+
88+
simpleVGContext::~simpleVGContext()
89+
{
90+
if (_hasContext)
91+
{
92+
vgDestroyContextSH();
93+
}
94+
}

example/simpleVGContext.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#ifndef __ofxShivaVGRendererTest__SimpleVG__
2+
#define __ofxShivaVGRendererTest__SimpleVG__
3+
4+
#include "openvg.h"
5+
#include "simpleVGPath.h"
6+
7+
class simpleVGContext
8+
{
9+
public:
10+
simpleVGContext();
11+
~simpleVGContext();
12+
13+
void create(VGint w, VGint h);
14+
15+
void setFillColor(VGint r, VGint g, VGint b, VGint a);
16+
void setFillColor(VGfloat r, VGfloat g, VGfloat b, VGfloat a);
17+
void setStrokeWidth(VGfloat w);
18+
void setStrokeCapStyle(VGCapStyle cap);
19+
void setStrokeJoinStyle(VGJoinStyle join);
20+
void setStrokeColor(VGint r, VGint g, VGint b, VGint a);
21+
void setStrokeColor(VGfloat r, VGfloat g, VGfloat b, VGfloat a);
22+
VGfloat getStrokeWidth();
23+
VGCapStyle getStrokeCapStyle();
24+
VGJoinStyle getStrokeJoinStyle();
25+
26+
void fillPath(simpleVGPath &path);
27+
void strokePath(simpleVGPath &path);
28+
29+
private:
30+
31+
bool _hasContext;
32+
VGPaint _fillPaint = 0;
33+
VGPaint _strokePaint = 0;
34+
VGfloat _strokeWidth;
35+
VGCapStyle _strokeCapStyle;
36+
VGJoinStyle _strokeJoinStyle;
37+
};
38+
39+
#endif /* defined(__ofxShivaVGRendererTest__SimpleVG__) */

0 commit comments

Comments
 (0)