Interface IPainter
- All Known Implementing Classes:
AbstractPainter
public interface IPainter
An
) or rely
on pure java emulation of OpenGL1 (
). They are instanciated by their
factories (respectively
and
).
The
Using the complete OpenGL interface Note that you may still access the "real" OpenGL interface in case the Painter does not adress your need. To get it, simply downcast the
IPainter offers methods for drawing and viewing 3d objects.
It draws things by providing a generalization of the OpenGL interface to allow any
Drawable to be painted. The painter methods are named to both match the OpenGL function
naming and also match the Jzy3d primitives (Coord3d, Color, etc)
OpenGL naming conventions
Traditional OpenGL methods mapping- GL.glBegin() ->
invalid reference
IPainter#glBegin() - GLU.gluLookAt() ->
invalid reference
IPainter#gluLookAt() - GLUT.glutBitmapString() ->
invalid reference
IPainter#glutBitmapString()
- GL.glEnable(GL.GL_BLEND) ->
glEnable_Blend() - GL.glBegin(GL.GL_POLYGON) ->
glBegin_Polygon()
- GL.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT, float[], 0) ->
glMaterial(MaterialProperty, Color, boolean)
Jzy3d naming conventions
- GL.glNormal3f(x,y,z) ->
normal(Coord3d) - GL.glVertex3f(x,y,z) ->
vertex(Coord3d) - GL.glColor4f(r,g,b,a) ->
color(Color)
color(Color) and glColor4f(float, float, float, float) are both
available.
Native GL and Emulated GL
Implementations of this interface may use native rendering (invalid reference
NativeDeskopPainter
invalid reference
EmulGLPainter
invalid reference
AWTChartFactory
invalid reference
EmulGLChartFactory
IPainter is initialized by a View which provides a Camera. The
Camera allows drawing things based on the eye position and orientation. of the painter.
Last, there are utility methods for Jzy3d for easily configuring multiple OpenGL settings with
configureGL(Quality). Using the complete OpenGL interface Note that you may still access the "real" OpenGL interface in case the Painter does not adress your need. To get it, simply downcast the
IPainter to the concrete type you are using, and call the accessors as follow.
Emulated OpenGL interface
- GL gl =
; // jGL GL interface
invalid reference
EmulGLPainter#getGL() - GLU glu =
; // jGL GLU interface
invalid reference
EmulGLPainter#getGLU() - GLUT glut =
; // jGL GLUT interface
invalid reference
EmulGLPainter#getGLUT()
- GL gl =
; // JOGL GL interface
invalid reference
NativeDeskopPainter#getGL() - GLU glu =
; // JOGL GLU interface
invalid reference
NativeDeskopPainter#getGLU() - GLUT glut =
; // JOGL GLUT interface
invalid reference
NativeDeskopPainter#getGLUT()
Text
ThedrawText(Font, String, Coord3d, Color, float) and
getTextLengthInPixels(Font, String) are not OpenGL related and specific to
IPainter. They allows to draw 2D text easily and enabling rotation, which may not be
supported by all IPainter implementations (currently only supported with EmulGL).
Beside this, all implementation will provide support on glutBitmapString(int, String)
and glutBitmapLength(int, String) which are the base OpenGL primitives for drawing
strings.
Note that the View.configureHiDPIListener(ICanvas) will adapt the text size according to HiDPI to
ensure text does not appear to small on high resolution screens.-
Method Summary
Modifier and TypeMethodDescriptionIn the context of a multithreaded application, this method allows retrieving the GL context for the calling thread.voidbox(BoundingBox3d box, Color color, float width, SpaceTransformer spaceTransformer) A helper to draw a bounding box.voidvoidclearColor(Color color) voidA convenient shortcut to glClipPlanevoidclip(BoundingBox3d box) A convenient shortcut to glClipPlane that defines the 6 clipping planes according to the min/max values of the bounding box.voidclipOff()Disable all clipping planesvoidclipOn()Enable all clipping planesintclipPlaneId(int id) boolean[]Indicates status of clipping planes (on/off)voidA convenient shortcut to glColor4fvoidcolorAlphaFactor(Color color, float alphaFactor) A convenient shortcut to glColor4f which multiplies the color's alpha channel by the given factorvoidcolorAlphaOverride(Color color, float alpha) A convenient shortcut to glColor4f which overrides the color's alpha channelvoidconfigureGL(Quality quality) Apply quality settings as OpenGL commandsvoiddrawImage(ByteBuffer imageBuffer, int imageWidth, int imageHeight, Coord2d pixelZoom, Coord3d imagePosition) A high level and easy way of drawing images (non OpenGL).voidA high level and easy way of drawing texts (non OpenGL).double[]float[]getOS()double[]float[]Return the Quality setting of the chart, which may be different from the one given at theconfigureGL(Quality)step.intgetTextLengthInPixels(int font, String string) intgetTextLengthInPixels(Font font, String string) getView()int[]default voidglActiveTexture(int texture) default voidglAlphaFunc(int func, float ref) default voidglAttachShader(int program, int shader) voidglBegin(int type) voidvoidvoidvoidvoidvoidvoiddefault voidglBeginQuery(int target, int id) default voidglBindBuffer(int target, int buffer) default voidglBindFramebuffer(int target, int framebuffer) default voidglBindTexture(int target, int texture) voidglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, byte[] bitmap, int bitmap_offset) default voidglBlendEquation(int mode) voidglBlendFunc(int sfactor, int dfactor) default voidglBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) default voidglBufferData(int target, long size, Buffer data, int usage) default voidglBufferSubData(int target, long offset, long size, Buffer data) voidglCallList(int list) default intglCheckFramebufferStatus(int target) voidglClear(int mask) voidglClearColor(float red, float green, float blue, float alpha) voidvoidglClearDepth(double d) voidglClearStencil(int s) glClearStencil specifies the index used by glClear to clear the stencil buffer.voidglClipPlane(int plane, double[] equation) voidglColor3f(float r, float g, float b) voidglColor4f(float r, float g, float b, float a) default voidglColorPointer(int size, int type, int stride, long pointerOffset) default voidglCompileShader(int shader) default intdefault intglCreateShader(int type) voidglCullFace(int mode) voiddefault voidglDeleteBuffers(int n, int[] buffers, int offset) default voidglDeleteFramebuffers(int n, int[] framebuffers, int offset) voidglDeleteLists(int list, int range) default voidglDeleteProgram(int program) default voidglDeleteQueries(int n, int[] ids, int offset) default voidglDeleteShader(int shader) default voidglDeleteTextures(int n, int[] textures, int offset) voidglDepthFunc(int func) voidglDepthFunc(DepthFunc func) voidglDepthRangef(float near, float far) default voidglDetachShader(int program, int shader) voidglDisable(int type) voidvoidglDisable_ClipPlane(int plane) voidvoidvoidglDisable_Light(int light) voidvoidvoidvoidvoiddefault voidglDisableClientState(int array) default voidglDrawArrays(int mode, int first, int count) default voidglDrawBuffer(int mode) default voidglDrawBuffers(int n, int[] buffers, int offset) default voidglDrawElements(int mode, int count, int type, long indicesOffset) voidglDrawPixels(int width, int height, int format, int type, Buffer pixels) voidglEnable(int type) voidvoidglEnable_ClipPlane(int plane) voidvoidvoidvoidglEnable_Light(int light) voidvoidvoidvoidvoidvoiddefault voidglEnableClientState(int array) voidglEnd()voiddefault voidglEndQuery(int target) voidglEvalCoord2f(float u, float v) voidglFeedbackBuffer(int size, int type, FloatBuffer buffer) voidglFlush()default voidglFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level) voidglFrontFace(int mode) voidvoidglFrustum(double left, double right, double bottom, double top, double zNear, double zFar) default voidglGenBuffers(int n, int[] buffers, int offset) default voidglGenFramebuffers(int n, int[] framebuffers, int offset) intglGenLists(int range) default voidglGenQueries(int n, int[] ids, int offset) default voidglGenTextures(int n, int[] textures, int offset) voidglGetDoublev(int pname, double[] params, int params_offset) default intvoidglGetFloatv(int pname, float[] data, int data_offset) voidglGetIntegerv(int pname, int[] data, int data_offset) default StringglGetProgramInfoLog(int program) default voidglGetProgramiv(int program, int pname, int[] params, int offset) default voidglGetQueryObjectuiv(int id, int pname, int[] params, int offset) default StringglGetShaderInfoLog(int shader) default voidglGetShaderiv(int shader, int pname, int[] params, int offset) default StringglGetString(int name) default intglGetUniformLocation(int program, String name) voidglHint(int target, int mode) voidvoidbooleanglIsList(int list) voidglLight_Ambiant(int lightId, Color ambiantColor) voidglLight_Diffuse(int lightId, Color diffuseColor) voidglLight_Position(int lightId, float[] positionZero) voidglLight_Shininess(int lightId, float value) voidglLight_Specular(int lightId, Color specularColor) voidglLightf(int light, int pname, float value) voidglLightf(int light, Attenuation.Type type, float value) voidglLightfv(int light, int pname, float[] params, int params_offset) voidglLightModel(LightModel model, boolean value) voidglLightModel(LightModel model, Color color) voidglLightModelfv(int mode, float[] value) voidglLightModeli(int mode, int value) voidglLineStipple(int factor, short pattern) voidglLineWidth(float width) default voidglLinkProgram(int program) voidvoidglLoadName(int name) voidglMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points) voidglMaterial(MaterialProperty material, float[] value, boolean b) voidglMaterial(MaterialProperty material, Color color, boolean b) voidglMaterialfv(int face, int pname, float[] params, int params_offset) voidglMatrixMode(int mode) voidvoiddefault voidglMultiDrawArrays(int mode, IntBuffer first, IntBuffer count, int drawcount) default voidglMultiDrawElements(int mode, IntBuffer count, int type, LongBuffer indicesOffsets, int drawcount) voidglNewList(int list, int mode) voidvoidglNormal3f(float nx, float ny, float nz) default voidglNormalPointer(int type, int stride, long pointerOffset) voidglOrtho(double left, double right, double bottom, double top, double near_val, double far_val) voidglPassThrough(float token) voidglPixelStore(PixelStore unpackAlignment, int param) voidglPixelStorei(int pname, int param) voidglPixelZoom(float xfactor, float yfactor) voidglPointSize(float width) voidglPolygonMode(int frontOrBack, int fill) voidglPolygonMode(PolygonMode mode, PolygonFill fill) voidglPolygonOffset(float factor, float units) voidvoiddefault voidglPrimitiveRestartIndex(int index) voidvoidglPushName(int name) voidglRasterPos3f(float x, float y, float z) default voidglReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels) intglRenderMode(int mode) intglRenderMode(RenderMode mode) voidglRotatef(float angle, float x, float y, float z) voidglScalef(float x, float y, float z) voidglSelectBuffer(int size, IntBuffer buffer) voidglShadeModel(int mode) voidglShadeModel(ColorModel colorModel) voidvoiddefault voidglShaderSource(int shader, String[] sources) voidglStencilFunc(StencilFunc func, int ref, int mask) Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis.voidglStencilMask(int mask) glStencilMask controls the writing of individual bits in the stencil planes.voidvoidvoidglStencilOp(StencilOp fail, StencilOp zfail, StencilOp zpass) The glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass) contains three options of which we can specify for each option what action to take:voidglTexCoord2f(float s, float t) default voidglTexCoord3f(float s, float t, float r) default voidglTexCoordPointer(int size, int type, int stride, long pointerOffset) voidglTexEnvf(int target, int pname, float param) voidglTexEnvi(int target, int pname, int param) default voidglTexImage1D(int target, int level, int internalFormat, int width, int border, int format, int type, Buffer pixels) default voidglTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, Buffer pixels) default voidglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, Buffer pixels) default voidglTexParameteri(int target, int pname, int param) default voidglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, Buffer pixels) voidglTranslatef(float x, float y, float z) voidgluCylinder(double base, double top, double height, int slices, int stacks) voidgluDisk(double inner, double outer, int slices, int loops) voidgluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) default voidglUniform1f(int location, float v0) default voidglUniform1fv(int location, int count, float[] value, int offset) default voidglUniform1i(int location, int v0) default voidglUniform2fv(int location, int count, float[] value, int offset) default voidglUniform3fv(int location, int count, float[] value, int offset) default voidglUniform4fv(int location, int count, float[] value, int offset) default voidglUniformMatrix4fv(int location, int count, boolean transpose, float[] value, int offset) voidgluOrtho2D(double left, double right, double bottom, double top) voidgluPerspective(double fovy, double aspect, double zNear, double zFar) voidgluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset) booleangluProject(float objX, float objY, float objZ, float[] model, float[] proj, int[] view, float[] winPos) Project 3D (world) coordinates in the 2D screenbooleangluProject(float objX, float objY, float objZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] winPos, int winPos_offset) Project 3D (world) coordinates in the 2D screendefault voidglUseProgram(int program) voidgluSphere(double radius, int slices, int stacks) intglutBitmapLength(int font, String string) voidglutBitmapString(int font, String string) voidglutBitmapString(Font axisFont, String label, Coord3d p, Color c) An interface for AWT user, jGL only @since 2.0.0voidglutSolidCube(float size) voidglutSolidSphere(double radius, int slices, int stacks) voidglutSolidTeapot(float scale) voidglutWireTeapot(float scale) booleangluUnProject(float winX, float winY, float winZ, float[] model, float[] proj, int[] view, float[] objPos) Project 2D (screen) coordinates in the 3D worldbooleangluUnProject(float winX, float winY, float winZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, int objPos_offset) Project 2D (screen) coordinates in the 3D worlddefault voidglValidateProgram(int program) voidglVertex3d(double x, double y, double z) voidglVertex3f(float x, float y, float z) default voidglVertexPointer(int size, int type, int stride, long pointerOffset) voidglViewport(int x, int y, int width, int height) booleanVerify if pixel scale of JVM is different than the one return by the canvasbooleanisJVMScaleLargerThanNativeScale(Coord2d scaleHardware, Coord2d scaleJVM) voidmodelToScreen(ArrayList<ArrayList<Coord3d>> polygons) modelToScreen(List<Coord3d> points) modelToScreen(Coord3d point) Coord3d[]modelToScreen(Coord3d[] points) Coord3d[][]modelToScreen(Coord3d[][] points) modelToScreen(Coord3d point, int[] viewport, float[] modelView, float[] projection) modelToScreen(PolygonArray polygon) PolygonArray[][]modelToScreen(PolygonArray[][] polygons) voidA convenient shortcut to glNormal3fvoidraster(Coord3d coord, SpaceTransformer transform) voidIn the context of a multithreaded application, this method allows releasing the GL context by the calling thread to let other thread use it.screenToModel(Coord3d screen) screenToModel(Coord3d screen, int[] viewport, float[] modelView, float[] projection) voidvoidvoidvoidvoidvertex(float x, float y, float z, SpaceTransformer transform) A convenient shortcut to glVertex3f, able to apply a space transform in case it is not nullvoidA convenient shortcut to glVertex3fvoidvertex(Coord3d coord, SpaceTransformer transform) A convenient shortcut to glVertex3f, able to apply a space transform in case it is not null
-
Method Details
-
acquireGL
Object acquireGL()In the context of a multithreaded application, this method allows retrieving the GL context for the calling thread. Once work is done the caller should callreleaseGL() -
releaseGL
void releaseGL()In the context of a multithreaded application, this method allows releasing the GL context by the calling thread to let other thread use it.acquireGL() -
clearCache
void clearCache() -
getCamera
Camera getCamera() -
setCamera
-
getView
View getView() -
setView
-
getCanvas
ICanvas getCanvas() -
setCanvas
-
getOS
OperatingSystem getOS() -
getWindowingToolkit
WindowingToolkit getWindowingToolkit() -
getQuality
Quality getQuality()Return the Quality setting of the chart, which may be different from the one given at theconfigureGL(Quality)step. -
configureGL
Apply quality settings as OpenGL commands -
normal
A convenient shortcut to glNormal3f -
vertex
A convenient shortcut to glVertex3f -
vertex
A convenient shortcut to glVertex3f, able to apply a space transform in case it is not null -
vertex
A convenient shortcut to glVertex3f, able to apply a space transform in case it is not null -
color
A convenient shortcut to glColor4f -
box
A helper to draw a bounding box. -
clip
A convenient shortcut to glClipPlane -
clip
A convenient shortcut to glClipPlane that defines the 6 clipping planes according to the min/max values of the bounding box. Then requires to enable clipping withclipOn(). -
clipOn
void clipOn()Enable all clipping planes -
clipOff
void clipOff()Disable all clipping planes -
clipStatus
boolean[] clipStatus()Indicates status of clipping planes (on/off) -
colorAlphaOverride
A convenient shortcut to glColor4f which overrides the color's alpha channel -
colorAlphaFactor
A convenient shortcut to glColor4f which multiplies the color's alpha channel by the given factor -
transform
-
raster
-
clearColor
-
material
-
glMaterial
-
glMaterial
-
getViewPortAsInt
int[] getViewPortAsInt() -
getProjectionAsDouble
double[] getProjectionAsDouble() -
getProjectionAsFloat
float[] getProjectionAsFloat() -
getModelViewAsDouble
double[] getModelViewAsDouble() -
getModelViewAsFloat
float[] getModelViewAsFloat() -
screenToModel
-
screenToModel
-
modelToScreen
-
modelToScreen
-
modelToScreen
-
modelToScreen
-
modelToScreen
-
modelToScreen
-
modelToScreen
-
modelToScreen
-
glLoadIdentity
void glLoadIdentity() -
glPushMatrix
void glPushMatrix() -
glPopMatrix
void glPopMatrix() -
glMatrixMode
void glMatrixMode(int mode) -
glScalef
void glScalef(float x, float y, float z) -
glTranslatef
void glTranslatef(float x, float y, float z) -
glRotatef
void glRotatef(float angle, float x, float y, float z) -
glDepthFunc
void glDepthFunc(int func) -
glDepthRangef
void glDepthRangef(float near, float far) -
glBlendFunc
void glBlendFunc(int sfactor, int dfactor) -
glBegin
void glBegin(int type) -
glEnd
void glEnd() -
glColor3f
void glColor3f(float r, float g, float b) -
glColor4f
void glColor4f(float r, float g, float b, float a) -
glVertex3f
void glVertex3f(float x, float y, float z) -
glVertex3d
void glVertex3d(double x, double y, double z) -
glEnable
void glEnable(int type) -
glDisable
void glDisable(int type) -
glFrontFace
void glFrontFace(int mode) -
glCullFace
void glCullFace(int mode) -
glPolygonMode
-
glPolygonMode
void glPolygonMode(int frontOrBack, int fill) -
glPolygonOffset
void glPolygonOffset(float factor, float units) -
glLineStipple
void glLineStipple(int factor, short pattern) -
glLineWidth
void glLineWidth(float width) -
glPointSize
void glPointSize(float width) -
glTexCoord2f
void glTexCoord2f(float s, float t) -
glTexEnvf
void glTexEnvf(int target, int pname, float param) -
glTexEnvi
void glTexEnvi(int target, int pname, int param) -
glGenLists
int glGenLists(int range) -
glNewList
void glNewList(int list, int mode) -
glNewList
-
glEndList
void glEndList() -
glCallList
void glCallList(int list) -
glIsList
boolean glIsList(int list) -
glDeleteLists
void glDeleteLists(int list, int range) -
glDrawPixels
-
glPixelZoom
void glPixelZoom(float xfactor, float yfactor) -
glPixelStorei
void glPixelStorei(int pname, int param) -
glPixelStore
-
glRasterPos3f
void glRasterPos3f(float x, float y, float z) -
glBitmap
void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, byte[] bitmap, int bitmap_offset) -
drawImage
void drawImage(ByteBuffer imageBuffer, int imageWidth, int imageHeight, Coord2d pixelZoom, Coord3d imagePosition) A high level and easy way of drawing images (non OpenGL). -
glutBitmapString
-
glutBitmapLength
-
glutBitmapString
-
getTextLengthInPixels
-
getTextLengthInPixels
-
drawText
-
glOrtho
void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) -
gluOrtho2D
void gluOrtho2D(double left, double right, double bottom, double top) -
gluPerspective
void gluPerspective(double fovy, double aspect, double zNear, double zFar) -
glFrustum
void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) -
gluLookAt
void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) -
glViewport
void glViewport(int x, int y, int width, int height) -
glClipPlane
void glClipPlane(int plane, double[] equation) -
glEnable_ClipPlane
void glEnable_ClipPlane(int plane) -
glDisable_ClipPlane
void glDisable_ClipPlane(int plane) -
clipPlaneId
int clipPlaneId(int id) -
gluUnProject
boolean gluUnProject(float winX, float winY, float winZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, int objPos_offset) Project 2D (screen) coordinates in the 3D world -
gluProject
boolean gluProject(float objX, float objY, float objZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] winPos, int winPos_offset) Project 3D (world) coordinates in the 2D screen -
gluUnProject
boolean gluUnProject(float winX, float winY, float winZ, float[] model, float[] proj, int[] view, float[] objPos) Project 2D (screen) coordinates in the 3D world -
gluProject
boolean gluProject(float objX, float objY, float objZ, float[] model, float[] proj, int[] view, float[] winPos) Project 3D (world) coordinates in the 2D screen -
gluDisk
void gluDisk(double inner, double outer, int slices, int loops) -
gluSphere
void gluSphere(double radius, int slices, int stacks) -
gluCylinder
void gluCylinder(double base, double top, double height, int slices, int stacks) -
glutSolidSphere
void glutSolidSphere(double radius, int slices, int stacks) -
glutSolidCube
void glutSolidCube(float size) -
glutSolidTeapot
void glutSolidTeapot(float scale) -
glutWireTeapot
void glutWireTeapot(float scale) -
glFeedbackBuffer
-
glRenderMode
int glRenderMode(int mode) -
glRenderMode
-
glPassThrough
void glPassThrough(float token) -
glGetIntegerv
void glGetIntegerv(int pname, int[] data, int data_offset) -
glGetDoublev
void glGetDoublev(int pname, double[] params, int params_offset) -
glGetFloatv
void glGetFloatv(int pname, float[] data, int data_offset) -
glStencilFunc
Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. Stencil planes are first drawn into using GL drawing primitives, then geometry and images are rendered using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the reference value and the value in the stencil buffer. To enable and disable the test, call glEnable and glDisable with argument GL_STENCIL_TEST. To specify actions based on the outcome of the stencil test, call glStencilOp or glStencilOpSeparate. There can be two separate sets of func, ref, and mask parameters; one affects back-facing polygons, and the other affects front-facing polygons as well as other non-polygon primitives. glStencilFunc sets both front and back stencil state to the same values. Use glStencilFuncSeparate to set front and back stencil state to different values. func is a symbolic constant that determines the stencil comparison function. It accepts one of eight values, shown in the following list. ref is an integer reference value that is used in the stencil comparison. It is clamped to the range 0 2 n - 1 , where n is the number of bitplanes in the stencil buffer. mask is bitwise ANDed with both the reference value and the stored stencil value, with the ANDed values participating in the comparison. If stencil represents the value stored in the corresponding stencil buffer location, the following list shows the effect of each comparison function that can be specified by func. Only if the comparison succeeds is the pixel passed through to the next stage in the rasterization process (see glStencilOp). All tests treat stencil values as unsigned integers in the range 0 2 n - 1 , where n is the number of bitplanes in the stencil buffer. The following values are accepted by func:- GL_NEVER Always fails.
- GL_LESS Passes if ( ref invalid input: '&' mask ) invalid input: '<' ( stencil invalid input: '&' mask ).
- GL_LEQUAL Passes if ( ref invalid input: '&' mask ) invalid input: '<'= ( stencil invalid input: '&' mask ).
- GL_GREATER Passes if ( ref invalid input: '&' mask ) > ( stencil invalid input: '&' mask ).
- GL_GEQUAL Passes if ( ref invalid input: '&' mask ) >= ( stencil invalid input: '&' mask ).
- GL_EQUAL Passes if ( ref invalid input: '&' mask ) = ( stencil invalid input: '&' mask ).
- GL_NOTEQUAL Passes if ( ref invalid input: '&' mask ) != ( stencil invalid input: '&' mask ).
- GL_ALWAYS Always passes.
- Parameters:
func- sets the stencil test function that determines whether a fragment passes or is discarded. This test function is applied to the stored stencil value and the glStencilFunc's ref value. Possible options are: GL_NEVER, GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL, GL_EQUAL, GL_NOTEQUAL and GL_ALWAYS. The semantic meaning of these is similar to the depth buffer's functions.ref- specifies the reference value for the stencil test. The stencil buffer's content is compared to this value.mask- specifies a mask that is ANDed with both the reference value and the stored stencil value before the test compares them. Initially set to all 1s.
-
glStencilMask
void glStencilMask(int mask) glStencilMask controls the writing of individual bits in the stencil planes. The least significant n bits of mask, where n is the number of bits in the stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing. There can be two separate mask writemasks; one affects back-facing polygons, and the other affects front-facing polygons as well as other non-polygon primitives. glStencilMask sets both front and back stencil writemasks to the same values. Use glStencilMaskSeparate to set front and back stencil writemasks to different values.- Parameters:
mask-
-
glStencilMask_True
void glStencilMask_True() -
glStencilMask_False
void glStencilMask_False() -
glStencilOp
The glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass) contains three options of which we can specify for each option what action to take:- Parameters:
fail- action to take if the stencil test fails.zfail- action to take if the stencil test passes, but the depth test fails.zpass- action to take if both the stencil and the depth test pass. Then for each of the options you can take any of the following actions:- Action : Description
- GL_KEEP : The currently stored stencil value is kept.
- GL_ZERO : The stencil value is set to 0.
- GL_REPLACE : The stencil value is replaced with the reference value set with glStencilFunc.
- GL_INCR : The stencil value is increased by 1 if it is lower than the maximum value.
- GL_INCR_WRAP : Same as GL_INCR, but wraps it back to 0 as soon as the maximum value is exceeded.
- GL_DECR : The stencil value is decreased by 1 if it is higher than the minimum value.
- GL_DECR_WRAP : Same as GL_DECR, but wraps it to the maximum value if it ends up lower than 0.
- GL_INVERT : Bitwise inverts the current stencil buffer value.
-
glClearStencil
void glClearStencil(int s) glClearStencil specifies the index used by glClear to clear the stencil buffer. s is masked with 2 m - 1 , where m is the number of bits in the stencil buffer.- Parameters:
s-
-
glNormal3f
void glNormal3f(float nx, float ny, float nz) -
glShadeModel
void glShadeModel(int mode) -
glShadeModel
-
glShadeModel_Smooth
void glShadeModel_Smooth() -
glShadeModel_Flat
void glShadeModel_Flat() -
glLightf
-
glLightf
void glLightf(int light, int pname, float value) -
glLightfv
void glLightfv(int light, int pname, float[] params, int params_offset) -
glLightModeli
void glLightModeli(int mode, int value) -
glLightModelfv
void glLightModelfv(int mode, float[] value) -
glLightModel
-
glLightModel
-
glLight_Position
void glLight_Position(int lightId, float[] positionZero) -
glLight_Ambiant
-
glLight_Diffuse
-
glLight_Specular
-
glLight_Shininess
void glLight_Shininess(int lightId, float value) -
glMaterialfv
void glMaterialfv(int face, int pname, float[] params, int params_offset) -
glHint
void glHint(int target, int mode) -
glClearColor
void glClearColor(float red, float green, float blue, float alpha) -
glClearDepth
void glClearDepth(double d) -
glClear
void glClear(int mask) -
glClearColorAndDepthBuffers
void glClearColorAndDepthBuffers() -
glInitNames
void glInitNames() -
glLoadName
void glLoadName(int name) -
glPushName
void glPushName(int name) -
glPopName
void glPopName() -
glSelectBuffer
-
gluPickMatrix
void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset) -
glFlush
void glFlush() -
glEvalCoord2f
void glEvalCoord2f(float u, float v) -
glMap2f
void glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points) -
glEnable_Blend
void glEnable_Blend() -
glDisable_Blend
void glDisable_Blend() -
glMatrixMode_ModelView
void glMatrixMode_ModelView() -
glMatrixMode_Projection
void glMatrixMode_Projection() -
glBegin_Polygon
void glBegin_Polygon() -
glBegin_Quad
void glBegin_Quad() -
glBegin_Triangle
void glBegin_Triangle() -
glBegin_Point
void glBegin_Point() -
glBegin_LineStrip
void glBegin_LineStrip() -
glBegin_LineLoop
void glBegin_LineLoop() -
glBegin_Line
void glBegin_Line() -
glEnable_LineStipple
void glEnable_LineStipple() -
glDisable_LineStipple
void glDisable_LineStipple() -
glEnable_PolygonOffsetFill
void glEnable_PolygonOffsetFill() -
glDisable_PolygonOffsetFill
void glDisable_PolygonOffsetFill() -
glEnable_PolygonOffsetLine
void glEnable_PolygonOffsetLine() -
glDisable_PolygonOffsetLine
void glDisable_PolygonOffsetLine() -
glEnable_CullFace
void glEnable_CullFace() -
glDisable_CullFace
void glDisable_CullFace() -
glFrontFace_ClockWise
void glFrontFace_ClockWise() -
glCullFace_Front
void glCullFace_Front() -
glDisable_Lighting
void glDisable_Lighting() -
glEnable_Lighting
void glEnable_Lighting() -
glEnable_Light
void glEnable_Light(int light) -
glDisable_Light
void glDisable_Light(int light) -
glEnable_ColorMaterial
void glEnable_ColorMaterial() -
glEnable_PointSmooth
void glEnable_PointSmooth() -
glHint_PointSmooth_Nicest
void glHint_PointSmooth_Nicest() -
glEnable_DepthTest
void glEnable_DepthTest() -
glDisable_DepthTest
void glDisable_DepthTest() -
glDepthFunc
-
glEnable_Stencil
void glEnable_Stencil() -
glDisable_Stencil
void glDisable_Stencil() -
isJVMScaleLargerThanNativeScale
-
isJVMScaleLargerThanNativeScale
boolean isJVMScaleLargerThanNativeScale()Verify if pixel scale of JVM is different than the one return by the canvas -
glGenBuffers
default void glGenBuffers(int n, int[] buffers, int offset) -
glDeleteBuffers
default void glDeleteBuffers(int n, int[] buffers, int offset) -
glBindBuffer
default void glBindBuffer(int target, int buffer) -
glBufferData
-
glBufferSubData
-
glEnableClientState
default void glEnableClientState(int array) -
glDisableClientState
default void glDisableClientState(int array) -
glVertexPointer
default void glVertexPointer(int size, int type, int stride, long pointerOffset) -
glNormalPointer
default void glNormalPointer(int type, int stride, long pointerOffset) -
glColorPointer
default void glColorPointer(int size, int type, int stride, long pointerOffset) -
glTexCoordPointer
default void glTexCoordPointer(int size, int type, int stride, long pointerOffset) -
glDrawArrays
default void glDrawArrays(int mode, int first, int count) -
glDrawElements
default void glDrawElements(int mode, int count, int type, long indicesOffset) -
glMultiDrawArrays
-
glMultiDrawElements
default void glMultiDrawElements(int mode, IntBuffer count, int type, LongBuffer indicesOffsets, int drawcount) -
glPrimitiveRestartIndex
default void glPrimitiveRestartIndex(int index) -
glCreateShader
default int glCreateShader(int type) -
glShaderSource
-
glCompileShader
default void glCompileShader(int shader) -
glGetShaderiv
default void glGetShaderiv(int shader, int pname, int[] params, int offset) -
glGetShaderInfoLog
-
glDeleteShader
default void glDeleteShader(int shader) -
glCreateProgram
default int glCreateProgram() -
glAttachShader
default void glAttachShader(int program, int shader) -
glDetachShader
default void glDetachShader(int program, int shader) -
glLinkProgram
default void glLinkProgram(int program) -
glValidateProgram
default void glValidateProgram(int program) -
glGetProgramiv
default void glGetProgramiv(int program, int pname, int[] params, int offset) -
glGetProgramInfoLog
-
glUseProgram
default void glUseProgram(int program) -
glDeleteProgram
default void glDeleteProgram(int program) -
glGetUniformLocation
-
glUniform1i
default void glUniform1i(int location, int v0) -
glUniform1f
default void glUniform1f(int location, float v0) -
glUniform1fv
default void glUniform1fv(int location, int count, float[] value, int offset) -
glUniform2fv
default void glUniform2fv(int location, int count, float[] value, int offset) -
glUniform3fv
default void glUniform3fv(int location, int count, float[] value, int offset) -
glUniform4fv
default void glUniform4fv(int location, int count, float[] value, int offset) -
glUniformMatrix4fv
default void glUniformMatrix4fv(int location, int count, boolean transpose, float[] value, int offset) -
glGenTextures
default void glGenTextures(int n, int[] textures, int offset) -
glDeleteTextures
default void glDeleteTextures(int n, int[] textures, int offset) -
glBindTexture
default void glBindTexture(int target, int texture) -
glActiveTexture
default void glActiveTexture(int texture) -
glTexParameteri
default void glTexParameteri(int target, int pname, int param) -
glTexImage1D
default void glTexImage1D(int target, int level, int internalFormat, int width, int border, int format, int type, Buffer pixels) -
glTexImage2D
default void glTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, Buffer pixels) -
glTexImage3D
default void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, Buffer pixels) -
glTexSubImage3D
default void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, Buffer pixels) -
glTexCoord3f
default void glTexCoord3f(float s, float t, float r) -
glGenFramebuffers
default void glGenFramebuffers(int n, int[] framebuffers, int offset) -
glDeleteFramebuffers
default void glDeleteFramebuffers(int n, int[] framebuffers, int offset) -
glBindFramebuffer
default void glBindFramebuffer(int target, int framebuffer) -
glFramebufferTexture2D
default void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level) -
glCheckFramebufferStatus
default int glCheckFramebufferStatus(int target) -
glDrawBuffer
default void glDrawBuffer(int mode) -
glDrawBuffers
default void glDrawBuffers(int n, int[] buffers, int offset) -
glGenQueries
default void glGenQueries(int n, int[] ids, int offset) -
glDeleteQueries
default void glDeleteQueries(int n, int[] ids, int offset) -
glBeginQuery
default void glBeginQuery(int target, int id) -
glEndQuery
default void glEndQuery(int target) -
glGetQueryObjectuiv
default void glGetQueryObjectuiv(int id, int pname, int[] params, int offset) -
glAlphaFunc
default void glAlphaFunc(int func, float ref) -
glBlendEquation
default void glBlendEquation(int mode) -
glBlendFuncSeparate
default void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) -
glGetError
default int glGetError() -
glGetString
-
glReadPixels
-