diff options
author | Sven Gothel <[email protected]> | 2014-09-19 01:15:07 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-09-19 01:15:07 +0200 |
commit | 3ed6ec6515635b1c67b89539ad0e02625ef3813d (patch) | |
tree | 38aefa29842f0e301ef0b87980fe0b20c6d3d79f /src/jogl/classes/com | |
parent | 3bd43982daecda2d8a7062e7340449d71c9e89f7 (diff) |
GLContextImpl.setRendererQuirks(..): Use GLRendererQuirks.addQuirk(int), dropping usage of .addQuirks(int[] quirks, offset, len)
Directly adding a quirk allows dropping usage of erroneous fixed-sized int[] array for accumulated quirks.
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index 83fceeb2f..f6e671c88 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -358,6 +358,17 @@ public class GLRendererQuirks { } /** + * {@link #addQuirk(int) Adding given quirk} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}. + * <p> + * Not thread safe. + * </p> + * @see #getStickyDeviceQuirks(AbstractGraphicsDevice) + */ + public static void addStickyDeviceQuirk(final AbstractGraphicsDevice device, final int quirk) throws IllegalArgumentException { + final GLRendererQuirks sq = getStickyDeviceQuirks(device); + sq.addQuirk(quirk); + } + /** * {@link #addQuirks(int[], int, int) Adding given quirks} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}. * <p> * Not thread safe. @@ -419,6 +430,15 @@ public class GLRendererQuirks { } /** + * @param quirk valid quirk to be added + * @throws IllegalArgumentException if the quirk is out of range + */ + public final void addQuirk(final int quirk) throws IllegalArgumentException { + validateQuirk(quirk); + _bitmask |= 1 << quirk; + } + + /** * @param quirks an array of valid quirks to be added * @param offset offset in quirks array to start reading * @param len number of quirks to read from offset within quirks array |