MCPcopy Index your code
hub / github.com/benfry/processing4 / hint

Method hint

core/src/processing/opengl/PGraphicsOpenGL.java:1810–1870  ·  view source on GitHub ↗
(int which)

Source from the content-addressed store, hash-verified

1808
1809
1810 @Override
1811 public void hint(int which) {
1812 boolean oldValue = hints[PApplet.abs(which)];
1813 super.hint(which);
1814 boolean newValue = hints[PApplet.abs(which)];
1815
1816 if (oldValue == newValue) {
1817 return;
1818 }
1819
1820 if (which == DISABLE_DEPTH_TEST) {
1821 flush();
1822 pgl.disable(PGL.DEPTH_TEST);
1823 } else if (which == ENABLE_DEPTH_TEST) {
1824 flush();
1825 pgl.enable(PGL.DEPTH_TEST);
1826 } else if (which == DISABLE_DEPTH_MASK) {
1827 flush();
1828 pgl.depthMask(false);
1829 } else if (which == ENABLE_DEPTH_MASK) {
1830 flush();
1831 pgl.depthMask(true);
1832 } else if (which == ENABLE_OPTIMIZED_STROKE) {
1833 flush();
1834 setFlushMode(FLUSH_WHEN_FULL);
1835 } else if (which == DISABLE_OPTIMIZED_STROKE) {
1836 if (is2D()) {
1837 PGraphics.showWarning("Optimized strokes can only be disabled in 3D");
1838 } else {
1839 flush();
1840 setFlushMode(FLUSH_CONTINUOUSLY);
1841 }
1842 } else if (which == DISABLE_STROKE_PERSPECTIVE) {
1843 if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) {
1844 // We flush the geometry using the previous line setting.
1845 flush();
1846 }
1847 } else if (which == ENABLE_STROKE_PERSPECTIVE) {
1848 if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) {
1849 // We flush the geometry using the previous line setting.
1850 flush();
1851 }
1852 } else if (which == ENABLE_DEPTH_SORT) {
1853 if (is3D()) {
1854 flush();
1855 if (sorter == null) sorter = new DepthSorter(this);
1856 isDepthSortingEnabled = true;
1857 } else {
1858 PGraphics.showWarning("Depth sorting can only be enabled in 3D");
1859 }
1860 } else if (which == DISABLE_DEPTH_SORT) {
1861 if (is3D()) {
1862 flush();
1863 isDepthSortingEnabled = false;
1864 }
1865 } else if (which == ENABLE_BUFFER_READING) {
1866 restartPGL();
1867 } else if (which == DISABLE_BUFFER_READING) {

Callers

nothing calls this directly

Calls 10

absMethod · 0.95
flushMethod · 0.95
setFlushModeMethod · 0.95
showWarningMethod · 0.95
restartPGLMethod · 0.95
disableMethod · 0.45
enableMethod · 0.45
depthMaskMethod · 0.45
is2DMethod · 0.45
is3DMethod · 0.45

Tested by

no test coverage detected