diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java
index 905e1ae6a..b206b1fa9 100644
--- a/core/src/processing/core/PApplet.java
+++ b/core/src/processing/core/PApplet.java
@@ -1032,6 +1032,17 @@ public class PApplet extends Applet
/**
+ * Defines the dimension of the display window in units of pixels. The size() function must be the first line in setup(). If size() is not called, the default size of the window is 100x100 pixels. The system variables width and height are set by the parameters passed to the size() function.
+ * Do not use variables as the parameters to size() command, because it will cause problems when exporting your sketch. When variables are used, the dimensions of your sketch cannot be determined during export. Instead, employ numeric values in the size() statement, and then use the built-in width and height variables inside your program when you need the dimensions of the display window are needed.
+ * The MODE parameters selects which rendering engine to use. For example, if you will be drawing 3D shapes for the web use P3D, if you want to export a program with OpenGL graphics acceleration use OPENGL. A brief description of the four primary renderers follows:
JAVA2D - The default renderer. This renderer supports two dimensional drawing and provides higher image quality in overall, but generally slower than P2D.
P2D (Processing 2D) - Fast 2D renderer, best used with pixel data, but not as accurate as the JAVA2D default.
P3D (Processing 3D) - Fast 3D renderer for the web. Sacrifices rendering quality for quick 3D drawing.
OPENGL - High speed 3D graphics renderer that makes use of OpenGL-compatible graphics hardware is available. Keep in mind that OpenGL is not magic pixie dust that makes any sketch faster (though it's close), so other rendering options may produce better results depending on the nature of your code. Also note that with OpenGL, all graphics are smoothed: the smooth() and noSmooth() commands are ignored.
PDF - The PDF renderer draws 2D graphics directly to an Acrobat PDF file. This produces excellent results when you need vector shapes for high resolution output or printing. You must first use Import Library → PDF to make use of the library. More information can be found in the PDF library reference.
+ * If you're manipulating pixels (using methods like get() or blend(), or manipulating the pixels[] array), P2D and P3D will usually be faster than the default (JAVA2D) setting, and often the OPENGL setting as well. Similarly, when handling lots of images, or doing video playback, P2D and P3D will tend to be faster.
+ * The P2D, P3D, and OPENGL renderers do not support strokeCap() or strokeJoin(), which can lead to ugly results when using strokeWeight(). (Bug 955)
+ * For the most elegant and accurate results when drawing in 2D, particularly when using smooth(), use the JAVA2D renderer setting. It may be slower than the others, but is the most complete, which is why it's the default. Advanced users will want to switch to other renderers as they learn the tradeoffs.
+ * Rendering graphics requires tradeoffs between speed, accuracy, and general usefulness of the available features. None of the renderers are perfect, so we provide multiple options so that you can decide what tradeoffs make the most sense for your project. We'd prefer all of them to have perfect visual accuracy, high performance, and support a wide range of features, but that's simply not possible.
+ * The maximum width and height is limited by your operating system, and is usually the width and height of your actual screen. On some machines it may simply be the number of pixels on your current screen, meaning that a screen that's 800x600 could support size(1600, 300), since it's the same number of pixels. This varies widely so you'll have to try different rendering modes and sizes until you get what you're looking for. If you need something larger, use createGraphics to create a non-visible drawing surface.
+ *
Again, the size() method must be the first line of the code (or first item inside setup). Any code that appears before the size() command may run more than once, which can lead to confusing results.
+ *
+ * =advanced
* Starts up and creates a two-dimensional drawing surface,
* or resizes the current drawing surface.
*
@@ -1045,12 +1056,19 @@ public class PApplet extends Applet *
* If called once a renderer has already been set, this will
* use the previous renderer and simply resize it.
+ *
+ * @webref structure
+ * @param iwidth width of the display window in units of pixels
+ * @param iheight height of the display window in units of pixels
*/
public void size(int iwidth, int iheight) {
size(iwidth, iheight, JAVA2D, null);
}
-
+ /**
+ *
+ * @param irenderer Either P2D, P3D, JAVA2D, or OPENGL
+ */
public void size(int iwidth, int iheight, String irenderer) {
size(iwidth, iheight, irenderer, null);
}
@@ -1112,6 +1130,11 @@ public class PApplet extends Applet
/**
+ * Creates and returns a new PGraphics object of the types P2D, P3D, and JAVA2D. Use this class if you need to draw into an off-screen graphics buffer. It's not possible to use createGraphics() with OPENGL, because it doesn't allow offscreen use. The DXF and PDF renderers require the filename parameter.
+ *
It's important to call any drawing commands between beginDraw() and endDraw() statements. This is also true for any commands that affect drawing, such as smooth() or colorMode().
+ *
Unlike the main drawing surface which is completely opaque, surfaces created with createGraphics() can have transparency. This makes it possible to draw into a graphics and maintain the alpha channel. By using save() to write a PNG or TGA file, the transparency of the graphics object will be honored. Note that transparency levels are binary: pixels are either complete opaque or transparent. For the time being (as of release 0127), this means that text characters will be opaque blocks. This will be fixed in a future release (Bug 641).
+ *
+ * =advanced
* Create an offscreen PGraphics object for drawing. This can be used
* for bitmap or vector images drawing or rendering.
*
* When run with an applet, uses the browser to open the url, @@ -2216,6 +2264,11 @@ public class PApplet extends Applet *
open(new String[] { "firefox", url });
* or whatever you want as your browser, since Linux doesn't
* yet have a standard method for launching URLs.
+ *
+ * @webref input:web
+ * @param url complete url as a String in quotes
+ * @param frameTitle name of the window to load the URL as a string in quotes
+ *
*/
public void link(String url, String frameTitle) {
if (online) {
@@ -2277,7 +2330,19 @@ public class PApplet extends Applet
/**
- * Attempt to open a file using the platform's shell.
+ * Attempts to open an application or file using your platform's launcher. The file parameter is a String specifying the file name and location. The location parameter must be a full path name, or the name of an executable in the system's PATH. In most cases, using a full path is the best option, rather than relying on the system PATH. Be sure to make the file executable before attempting to open it (chmod +x).
+ * * This method is useful if you want to use the facilities provided @@ -4261,6 +4355,14 @@ public class PApplet extends Applet *
* Exceptions are handled internally, when an error, occurs, an
@@ -4492,6 +4611,13 @@ public class PApplet extends Applet
* of new users (or people who are just trying to get things done
* in a "scripting" fashion. If you want to handle exceptions,
* use Java methods for I/O.
+ *
+ * @webref input:files
+ * @param filename name of the file or url to load
+ *
+ * @see processing.core.PApplet#loadBytes(String)
+ * @see processing.core.PApplet#saveStrings(String, String[])
+ * @see processing.core.PApplet#saveBytes(String, byte[])
*/
public String[] loadStrings(String filename) {
InputStream is = createInput(filename);
@@ -7230,6 +7356,24 @@ public class PApplet extends Applet
}
+ /**
+ * 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. Many options will often graduate to standard features instead of hints over time.
+ *
hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for OpenGL. This can help force anti-aliasing if it has not been enabled by the user. On some graphics cards, this can also be set by the graphics driver's control panel, however not all cards make this available. This hint must be called immediately after the size() command because it resets the renderer, obliterating any settings and anything drawn (and like size(), re-running the code that came before it again).
+ *
hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always enables 2x smoothing when the OpenGL renderer is used. This hint disables the default 2x smoothing and returns the smoothing behavior found in earlier releases, where smooth() and noSmooth() could be used to enable and disable smoothing, though the quality was inferior.
+ *
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 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().
+ *
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.
+ *
hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and lines in P3D and OPENGL. This can slow performance considerably, and the algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
+ *
hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the OPENGL renderer setting by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
+ *
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.
+ *
+ * @webref rendering
+ * @param which name of the hint to be enabled or disabled
+ *
+ * @see processing.core.PGraphics
+ * @see processing.core.PApplet#createGraphics(int, int, String, String)
+ * @see processing.core.PApplet#size(int, int)
+ */
public void hint(int which) {
if (recorder != null) recorder.hint(which);
g.hint(which);
diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java
index d04815f9b..95834f24b 100644
--- a/core/src/processing/core/PGraphics.java
+++ b/core/src/processing/core/PGraphics.java
@@ -29,6 +29,13 @@ import java.util.HashMap;
/**
+ * Main graphics and rendering context, as well as the base API implementation for processing "core".
+ * Use this class if you need to draw into an off-screen graphics buffer.
+ * A PGraphics object can be constructed with the createGraphics() function.
+ * The beginDraw() and endDraw() methods (see above example) are necessary to set up the buffer and to finalize it.
+ * The fields and methods for this class are extensive;
+ * for a complete list visit the developer's reference: http://dev.processing.org/reference/core/
+ * =advanced
* Main graphics and rendering context, as well as the base API implementation.
*
*