Files
2015-09-01 19:05:48 -04:00

178 lines
8.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>hint() | reference | Processing.js</title>
<link rel="stylesheet" href="../../css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="../../css/syntax.css" type="text/css" />
<link rel="stylesheet" href="../../css/processing-js.css" type="text/css" />
<script src="../../js/processing.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script src="../../js/jquery.tweet.min.js" type="text/javascript"></script>
<script src="../../js/tabselector.js" type="text/javascript"></script>
<script src="http://cdn.webglstats.com/stat.js" defer="defer" async="async"></script>
<script type="text/javascript">
// Only do tracking on the actual site
if (document.location.host === "processingjs.org") {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8565070-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
}());
}
</script>
</head>
<body>
<div class="container">
<div class="header">
<a href="http://processingjs.org/"><img src="../../images/header.png" width="177" height="42"></a>
</div>
<span class="tagline">a port of the Processing Visualization Language</span>
<div class="navbar">
<canvas width="940px" height="78px" data-processing-sources="/sketches/bannerSketch.pde"></canvas>
<ul>
<li><a href="http://processingjs.org/"><span>home</span></a></li>
<li><a href="http://processingjs.org/download/"><span>download</span></a></li>
<li><a href="../index.html"><span>reference</span></a></li>
<li><a href="http://processingjs.org/exhibition/"><span>exhibition</span></a></li>
<li><a href="http://processingjs.org/learning/"><span>learning</span></a></li>
<li><a href="http://processingjs.org/articles/"><span>articles</span></a></li>
<li><a href="http://processingjs.org/community/"><span>community</span></a></li>
<li><a href="http://processingjs.org/blog/"><span>blog</span></a></li>
</ul>
<a class="viewsource" href="http://processingjs.org/sketches/bannerSketch.pde">view source</a>
</div>
<div class="page row">
<div class="span11">
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>hint()</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><pre class="">void setup() {
size(400, 400, OPENGL);
// Enable 4x oversampling (if supported)
hint(ENABLE_OPENGL_4X_SMOOTH);
}</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td><p>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. </p>
<p>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).</p>
<p>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. </p>
<p>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. </p>
<p>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). </p>
<p>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). </p>
<p>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.</p></td>
</tr>
<tr class="">
<th scope="row">Syntax</th>
<td><pre>hint(<kbd>item</kbd>)</pre></td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">item</th>
<td>constant: name of the hint to be enabled or disabled</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
<tr class="">
<th scope="row">Related</th>
<td><a href="../PGraphics.1">PGraphics</a><br />
<a href="../createGraphics_.1">createGraphics()</a><br />
<a href="../size_.1">size()</a><br /></td>
</tr>
</table>
<div class="cclicense">
<p>This reference is licensed under the CC BY-NC-SA 2.0 license:</p>
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/">
<img alt="Creative Commons License" border="0" src="../../images/somerights20.gif" />
</a>
</div>
</div>
<div class="sidebar span4">
<h3><a href="http://processingjs.org/download/">Downloads</a></h3>
<ul>
<li><a href="http://processingjs.org/download/">Download the latest version of Processing.js!</a></li>
</ul>
<h3><a href="http://processingjs.org/articles/">Articles</a></h3>
<ul>
<li><a href="http://processingjs.org/articles/jsQuickStart.html">Quick Start - JavaScript Developer</a></li>
<li><a href="http://processingjs.org/articles/p5QuickStart.html">Quick Start - Processing Developer</a></li>
<li><a href="http://processingjs.org/articles/RenderingModes.html">Rendering Modes</a></li>
<li><a href="http://processingjs.org/articles/PomaxGuide.html">Pomax's Guide to processing-js</a></li>
</ul>
<h3><a>Web IDEs</a></h3>
<ul>
<li><a href="http://sketchpad.cc">Sketchpad.cc</a></li>
<li><a href="http://processingjs.org/tools/processing-helper.html">Processing.js Helper</a></li>
<li><a href="http://www.openprocessing.org">OpenProcessing.org</a></li>
</ul>
<h3><a href="http://processingjs.org/community/">Community</a></h3>
<ul>
<li><a href="irc://irc.mozilla.org/processing.js">IRC Channel</a></li>
<li><a href="http://processing-js.lighthouseapp.com/">Bug Tracker</a></li>
<li><a href="http://github.com/processing-js/processing-js/">Github Repository</a></li>
<li><a href="http://groups.google.com/group/processingjs">Google Group</a></li>
<li><a href="http://zenit.senecac.on.ca/wiki/index.php/">Open Source @ Seneca</a></li>
</ul>
<h3><a href="http://twitter.com/processingjs">Twitter Feed</a></h3>
<div class="twitter"></div>
</div>
</div>
<div class="footer">
Processing is an open visualization language developed by
<a href="http://benfry.com/">Ben Fry</a> &amp; <a href="http://reas.com/">Casey Reas</a>,
and originally ported to Javascript by
<a href="http://ejohn.org/blog/processingjs/">John Resig</a>.
Processing.js is maintained by the Processing.js team.
</div>
</div>
<a href="http://github.com/processing-js/processing-js/">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="../../images/forkme-right-orange.png" alt="Fork me on GitHub">
</a>
</body>
</html>