Skip to content

Commit 9b9b7e5

Browse files
committed
Add C++ specific descriptions to examples
1 parent e3ed759 commit 9b9b7e5

105 files changed

Lines changed: 105 additions & 105 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/arrays-array-2d.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Array 2D</h1>
81-
<p class="desc">Demonstrates the syntax for creating a two-dimensional (2D) array. Values in a 2D array are accessed through two index values. 2D arrays are useful for storing images. In this example, each dot is colored in relation to its distance from the center of the image.</p>
81+
<p class="desc">Instead of a 2D Java array, C++ uses a flat <code>float*</code> with manual index math: <code>arr[y * width + x]</code>.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/arrays-array-objects.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Array Objects</h1>
81-
<p class="desc">Demonstrates the syntax for creating an array of custom objects.</p>
81+
<p class="desc">Instead of an ArrayList, C++ uses <code>std::vector&lt;Ball&gt;</code>. Structs replace classes for simple data.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/arrays-array.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Array</h1>
81-
<p class="desc">An array is a list of data. Each piece of data in an array is identified by an index number representing its position in the array. Arrays are zero based, which means that the first element in the array is [0], the second element is [1], and so on. In this example, an array named "coswave" is created and filled with the cosine values. This data is displayed three separate ways on the screen.</p>
81+
<p class="desc">In C++ we use a raw <code>float*</code> pointer and <code>new float[width]</code> instead of a Java array.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/camera-move-eye.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Move Eye</h1>
81-
81+
<p class="desc">The same camera() function works in C++ Mode. Parameters are floats instead of doubles.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/camera-perspective-vs-ortho.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Perspective vs Ortho</h1>
81-
<p class="desc">Perspective vs. Ortho Move the mouse left to right to change the "far" parameter for the perspective() and ortho() functions. This parameter sets the maximum distance from the origin away from the viewer and will clip the geometry. Click a mouse button to switch between the perspective and orthographic projections.</p>
81+
<p class="desc">ortho() and perspective() work the same way in C++ Mode.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/camera-perspective.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Perspective</h1>
81-
<p class="desc">Move the mouse left and right to change the field of view (fov). Click to modify the aspect ratio. The perspective() function sets a perspective projection applying foreshortening, making distant objects appear smaller than closer ones. The parameters define a viewing volume with the shape of truncated pyramid. Objects near to the front of the volume appear their actual size, while farther objects appear smaller. This projection simulates the perspective of the world more accurately than orthographic projection. The version of perspective without parameters sets the default perspective and the version with four parameters allows the programmer to set the area precisely.</p>
81+
<p class="desc">perspective() works identically. C++ Mode uses OpenGL so the math is the same.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/color-brightness.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Brightness</h1>
81-
81+
<p class="desc">color arithmetic works the same. C++ uses float internally for color channels.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/color-color-variables.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Color Variables</h1>
81-
<p class="desc">Color Variables (Homage to Albers). This example creates variables for colors that may be referred to in the program by a name, rather than a number.</p>
81+
<p class="desc">In C++ <code>color</code> is a typedef for <code>unsigned int</code>. You can store and pass colors the same way.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/color-hue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Hue</h1>
81-
<p class="desc">Hue is the color reflected from or transmitted through an object and is typically referred to as the name of the color such as red, blue, or yellow. In this example, move the cursor vertically over each bar to alter its hue.</p>
81+
<p class="desc">HSB color mode works identically in C++ Mode.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

examples/color-radial-gradient.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</div>
7979
<div class="content">
8080
<h1>Radial Gradient</h1>
81-
<p class="desc">Draws a series of concentric circles to create a gradient from one color to another.</p>
81+
<p class="desc">Same as the linear gradient. Pure math and drawing calls.</p>
8282
<div class="preview-wrap" style="width:640px;height:360px;"><div id="p5-container"></div></div>
8383
<div class="code-block">
8484
<div class="code-header">

0 commit comments

Comments
 (0)