Skip to content

Commit c34ec16

Browse files
committed
Update for 2.0 reference, including edits to source files
1 parent f497c01 commit c34ec16

18 files changed

Lines changed: 231 additions & 30 deletions
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<root>
3+
4+
<name>start()</name>
5+
6+
<category>Capture</category>
7+
8+
<subcategory></subcategory>
9+
10+
<usage>Web &amp; Application</usage>
11+
12+
<example>
13+
<image></image>
14+
<code><![CDATA[
15+
import processing.video.*;
16+
Capture cam;
17+
18+
void setup() {
19+
size(200, 200);
20+
cam = new Capture(this);
21+
cam.start();
22+
}
23+
24+
void draw() {
25+
if (cam.available()) {
26+
// Reads the new frame
27+
cam.read();
28+
}
29+
image(cam, 0, 0);
30+
}
31+
32+
void mousePressed() {
33+
cam.stop();
34+
}
35+
36+
]]></code>
37+
</example>
38+
39+
<description><![CDATA[
40+
Starts capturing frames from an attached device.
41+
]]></description>
42+
43+
<syntax>
44+
<c>cam</c>.start()
45+
</syntax>
46+
47+
<parameter>
48+
<label>cam</label>
49+
<description><![CDATA[any variable of type Capture]]></description>
50+
</parameter>
51+
52+
<returns></returns>
53+
54+
<related></related>
55+
56+
<availability>1.0</availability>
57+
58+
<type>Method</type>
59+
60+
<partof>Library</partof>
61+
62+
63+
</root>

content/api_en/LIB_video/Capture_list.xml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,26 @@
1212
<example>
1313
<image></image>
1414
<code><![CDATA[
15-
import processing.video.*;
16-
17-
void setup() {
18-
size(200, 200);
19-
println(Capture.list());
20-
}
21-
15+
import processing.video.*;
16+
17+
Capture cam;
18+
19+
void setup() {
20+
size(640, 480);
21+
22+
String[] cameras = Capture.list();
23+
24+
if (cameras.length == 0) {
25+
println("There are no cameras available for capture.");
26+
exit();
27+
} else {
28+
println("Available cameras:");
29+
for (int i = 0; i < cameras.length; i++) {
30+
println(cameras[i]);
31+
}
32+
}
33+
}
34+
2235
]]></code>
2336
</example>
2437

content/api_en/PShape_addChild.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example to come...
1616
</example>
1717

1818
<description><![CDATA[
19-
This is a new reference entry for Processing 2.0. It will be updated shortly.
19+
This is a new reference entry for Processing 2.0. It will be updated shortly. For now, please check the Examples to see how to use this new syntax.
2020
]]></description>
2121

2222
</root>

content/api_en/PShape_beginContour.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example to come...
1616
</example>
1717

1818
<description><![CDATA[
19-
This is a new reference entry for Processing 2.0. It will be updated shortly.
19+
This is a new reference entry for Processing 2.0. It will be updated shortly. For now, please check the Examples to see how to use this new syntax.
2020
]]></description>
2121

2222
</root>

content/api_en/PShape_end.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example to come...
1616
</example>
1717

1818
<description><![CDATA[
19-
This is a new reference entry for Processing 2.0. It will be updated shortly.
19+
This is a new reference entry for Processing 2.0. It will be updated shortly. For now, please check the Examples to see how to use this new syntax.
2020
]]></description>
2121

2222
</root>

content/api_en/PShape_endContour.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example to come...
1616
</example>
1717

1818
<description><![CDATA[
19-
This is a new reference entry for Processing 2.0. It will be updated shortly.
19+
This is a new reference entry for Processing 2.0. It will be updated shortly. For now, please check the Examples to see how to use this new syntax.
2020
]]></description>
2121

2222
</root>

content/api_en/blendMode.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Example to come...
1717
</example>
1818

1919
<description><![CDATA[
20-
This is a new reference entry for Processing 2.0. It will be updated shortly.
20+
This is a new reference entry for Processing 2.0. It will be updated shortly. For now, please check the Examples to see how to use this new syntax.
2121
]]></description>
2222

2323
</root>

content/api_en/createShape.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<root>
3+
<name>createShape()</name>
4+
5+
<category>Shape</category>
6+
7+
<subcategory></subcategory>
8+
9+
<type></type>
10+
11+
<example>
12+
<image></image>
13+
<code><![CDATA[
14+
]]></code>
15+
</example>
16+
17+
<example>
18+
<image></image>
19+
<code><![CDATA[
20+
]]></code>
21+
</example>
22+
23+
<description><![CDATA[
24+
This is a new reference entry for Processing 2.0. It will be updated shortly. For now, please check the Examples to see how to use this new syntax.
25+
]]></description>
26+
27+
</root>

content/api_en/hint.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<description><![CDATA[
1212
Set various hints and hacks for the renderer. This is used to handle obscure rendering features that cannot be implemented in a consistent manner across renderers. Each hint is enabled with the "ENABLE" syntax and disabled with "DISABLE." Some are enabled by default and other are disabled. For example, to turn on native fonts, use <b>hint(ENABLE_NATIVE_FONTS)</b> and later use <b>hint(DISABLE_NATIVE_FONTS)</b> to stop using the feature. Some options might graduate to standard features instead of hints over time.
1313
<br/><br/>
14-
hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are installed, rather than the bitmapped version from a .vlw file. This is useful with the default (or JAVA2D) renderer setting, as it will improve font rendering speed. This is not enabled by default, because it can be misleading while testing because the type will look great on your machine (because you have the font installed) but lousy on others' machines if the identical font is unavailable. This option can only be set per-sketch, and must be called before any use of textFont().
14+
hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are installed, rather than the bitmapped version from a .vlw file. This is useful with the default renderer setting, as it will improve font rendering speed. This is not enabled by default, because it can be misleading while testing because the type will look great on your machine (because you have the font installed) but lousy on others' machines if the identical font is unavailable. This option can only be set per-sketch, and must be called before any use of textFont().
1515
<br/><br/>
1616
hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on top of everything at will. When depth testing is disabled, items will be drawn to the screen sequentially, like a painting. This hint is most often used to draw in 3D, then draw in 2D on top of it (for instance, to draw GUI controls in 2D on top of a 3D interface). Starting in release 0149, this will also clear the depth buffer. Restore the default with hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared, any 3D drawing that happens later in draw() will ignore existing shapes on the screen.
1717
<br/><br/>
@@ -32,6 +32,8 @@ hint(DISABLE_TRANSFORM_CACHE) - Description to come...
3232
hint(ENABLE_STROKE_PERSPECTIVE) - Description to come...
3333
<br/> <br/>
3434
hint(DISABLE_TEXTURE_MIPMAPS) - Description to come...
35+
<br/> <br/>
36+
hint(ENABLE_STROKE_PURE) - Improves rendering glitches with <b>vertex()</b> in the default renderer
3537
<br/><br/>
3638
As of release 0149, unhint() has been removed in favor of adding additional ENABLE/DISABLE constants to reset the default behavior. This prevents the double negatives, and also reinforces which hints can be enabled or disabled.
3739
]]></description>

content/api_en/include/bitwiseOR.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ rect(30, 20, 55, 55);
3838
Compares each corresponding bit in the binary representation of the values. For each comparison two 1's yield 1, 1 and 0 yield 1, and two 0's yield 0. This is easy to see when we look at the binary representation of numbers<br />
3939
<br />
4040
<pre> 11010110 // 214
41-
& 01011100 // 92
41+
| 01011100 // 92
4242
--------
4343
11011110 // 222</pre>
4444
<br />

0 commit comments

Comments
 (0)