Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name | hint() |
||
---|---|---|---|
Examples | void setup() { size(400, 400, OPENGL); // Enable 4x oversampling (if supported) hint(ENABLE_OPENGL_4X_SMOOTH); } |
||
Description | 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_2X_SMOOTH) and hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 2x or 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 is not enabled by default, because on many machines, this disables the ability to accumulate an image over time. That is, it may only work when background() is called on each frame. This hint should 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 again). With some graphics cards, this option may enforce all drawing to be smoothed: calling smooth() may not be necessary, and noSmooth() might be ignored altogether. 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 because they may not have the font available. 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 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). 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. hint(DISABLE_ERROR_REPORT) - Speeds up the OPENGL renderer setting by not checking for errors while running. hint(ENABLE_ACCURATE_TEXTURES) - Enables better texture accuracy for the P3D renderer. This option will do a better job of dealing with textures in perspective. hint(DISABLE_AUTO_GZIP) - When a file has a .gz extension and is loaded or saved, the file will automatically be uncompressed or compressed. This may not be desirable in some cases, so the behavior can be shut off. |
||
Syntax | hint(item) |
||
Parameters |
|
||
Usage | Web & Application | ||
Related | unhint PGraphics createGraphics size |