Package org.jzy3d.painters
Class NativeDesktopPainter
- java.lang.Object
-
- org.jzy3d.painters.AbstractPainter
-
- org.jzy3d.painters.NativeDesktopPainter
-
- All Implemented Interfaces:
IPainter
public class NativeDesktopPainter extends AbstractPainter implements IPainter
-
-
Field Summary
Fields Modifier and Type Field Description protected com.jogamp.opengl.GL
gl
static int
GL_RGBA
static int
GL_UNSIGNED_BYTE
protected com.jogamp.opengl.glu.GLU
glu
protected com.jogamp.opengl.util.gl2.GLUT
glut
-
Fields inherited from class org.jzy3d.painters.AbstractPainter
camera, canvas, os, view
-
-
Constructor Summary
Constructors Constructor Description NativeDesktopPainter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
acquireGL()
In the context of a multithreaded application, this method allows retrieving the GL context for the calling thread.int
clipPlaneId(int id)
Return the GL clip plane ID according to an ID in [0;5]void
configureGL(Quality quality)
Apply quality settings as OpenGL commandsvoid
drawImage(ByteBuffer imageBuffer, int imageWidth, int imageHeight, Coord2d pixelZoom, Coord3d imagePosition)
A high level and easy way of drawing images (non OpenGL).void
drawText(Font font, String label, Coord3d position, Color color, float rotation)
Render 2D text at the given 3D position.com.jogamp.opengl.GLContext
getCurrentContext(ICanvas canvas)
com.jogamp.opengl.GL
getCurrentGL(ICanvas canvas)
Get the current GL context of the canvas and make it current.com.jogamp.opengl.GL
getGL()
com.jogamp.opengl.GL2
getGL2()
com.jogamp.opengl.glu.GLU
getGLU()
com.jogamp.opengl.util.gl2.GLUT
getGLUT()
double[]
getModelViewAsDouble()
float[]
getModelViewAsFloat()
protected com.jogamp.opengl.util.awt.TextRenderer
getOrCreateTextRenderer(Font font)
double[]
getProjectionAsDouble()
float[]
getProjectionAsFloat()
int
getTextLengthInPixels(int font, String string)
int
getTextLengthInPixels(Font font, String string)
int[]
getViewPortAsInt()
WindowingToolkit
getWindowingToolkit()
void
glBegin(int type)
void
glBegin_Line()
void
glBegin_LineLoop()
void
glBegin_LineStrip()
void
glBegin_Point()
void
glBegin_Polygon()
void
glBegin_Quad()
void
glBegin_Triangle()
void
glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, byte[] bitmap, int bitmap_offset)
void
glBlendFunc(int sfactor, int dfactor)
void
glCallList(int list)
void
glClear(int mask)
void
glClearColor(float red, float green, float blue, float alpha)
void
glClearColorAndDepthBuffers()
void
glClearDepth(double d)
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.void
glClipPlane(int plane, double[] equation)
void
glColor3f(float r, float g, float b)
void
glColor4f(float r, float g, float b, float a)
void
glCullFace(int mode)
void
glCullFace_Front()
void
glDeleteLists(int list, int range)
void
glDepthFunc(int func)
void
glDepthFunc(DepthFunc func)
void
glDepthRangef(float near, float far)
void
glDisable(int type)
void
glDisable_Blend()
void
glDisable_ClipPlane(int plane)
void
glDisable_CullFace()
void
glDisable_DepthTest()
void
glDisable_Light(int light)
void
glDisable_Lighting()
void
glDisable_LineStipple()
void
glDisable_PolygonOffsetFill()
void
glDisable_PolygonOffsetLine()
void
glDisable_Stencil()
void
glDrawPixels(int width, int height, int format, int type, Buffer pixels)
void
glEnable(int type)
void
glEnable_Blend()
void
glEnable_ClipPlane(int plane)
void
glEnable_ColorMaterial()
void
glEnable_CullFace()
void
glEnable_DepthTest()
void
glEnable_Light(int light)
void
glEnable_Lighting()
void
glEnable_LineStipple()
void
glEnable_PointSmooth()
void
glEnable_PolygonOffsetFill()
void
glEnable_PolygonOffsetLine()
void
glEnable_Stencil()
void
glEnd()
void
glEndList()
void
glEvalCoord2f(float u, float v)
void
glFeedbackBuffer(int size, int type, FloatBuffer buffer)
void
glFlush()
void
glFrontFace(int mode)
void
glFrontFace_ClockWise()
void
glFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
int
glGenLists(int range)
void
glGetDoublev(int pname, double[] params, int params_offset)
void
glGetFloatv(int pname, float[] data, int data_offset)
void
glGetIntegerv(int pname, int[] data, int data_offset)
void
glHint(int target, int mode)
void
glHint_PointSmooth_Nicest()
void
glInitNames()
boolean
glIsList(int list)
void
glLight_Ambiant(int lightId, Color ambiantColor)
void
glLight_Diffuse(int lightId, Color diffuseColor)
void
glLight_Position(int lightId, float[] positionZero)
void
glLight_Shininess(int lightId, float value)
void
glLight_Specular(int lightId, Color specularColor)
void
glLightf(int light, int pname, float value)
void
glLightf(int light, Attenuation.Type attenuationType, float value)
void
glLightfv(int light, int pname, float[] params, int params_offset)
void
glLightModel(LightModel model, boolean value)
void
glLightModel(LightModel model, Color color)
void
glLightModelfv(int mode, float[] value)
void
glLightModeli(int mode, int value)
void
glLineStipple(int factor, short pattern)
void
glLineWidth(float width)
void
glLoadIdentity()
void
glLoadName(int name)
void
glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points)
void
glMaterial(MaterialProperty material, float[] color, boolean isFront)
void
glMaterial(MaterialProperty material, Color color, boolean isFront)
void
glMaterialfv(int face, int pname, float[] params, int params_offset)
void
glMatrixMode(int mode)
void
glMatrixMode_ModelView()
void
glMatrixMode_Projection()
void
glNewList(int list, int mode)
void
glNewList(int list, ListMode mode)
void
glNormal3f(float nx, float ny, float nz)
void
glOrtho(double left, double right, double bottom, double top, double near_val, double far_val)
void
glPassThrough(float token)
void
glPixelStore(PixelStore store, int param)
void
glPixelStorei(int pname, int param)
void
glPixelZoom(float xfactor, float yfactor)
void
glPointSize(float width)
void
glPolygonMode(int frontOrBack, int fill)
void
glPolygonMode(PolygonMode mode, PolygonFill fill)
void
glPolygonOffset(float factor, float units)
void
glPopMatrix()
void
glPopName()
void
glPushMatrix()
OPEN GL Interfacevoid
glPushName(int name)
void
glRasterPos3f(float x, float y, float z)
int
glRenderMode(int mode)
int
glRenderMode(RenderMode mode)
void
glRotatef(float angle, float x, float y, float z)
void
glScalef(float x, float y, float z)
void
glSelectBuffer(int size, IntBuffer buffer)
void
glShadeModel(int mode)
void
glShadeModel(ColorModel colorModel)
void
glShadeModel_Flat()
void
glShadeModel_Smooth()
void
glStencilFunc(StencilFunc func, int ref, int mask)
Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis.void
glStencilMask(int mask)
glStencilMask controls the writing of individual bits in the stencil planes.void
glStencilMask_False()
void
glStencilMask_True()
void
glStencilOp(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:void
glTexCoord2f(float s, float t)
void
glTexEnvf(int target, int pname, float param)
void
glTexEnvi(int target, int pname, int param)
void
glTranslatef(float x, float y, float z)
void
gluCylinder(double base, double top, double height, int slices, int stacks)
void
gluDisk(double inner, double outer, int slices, int loops)
void
gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
void
gluOrtho2D(double left, double right, double bottom, double top)
void
gluPerspective(double fovy, double aspect, double zNear, double zFar)
void
gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset)
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)
void
gluSphere(double radius, int slices, int stacks)
int
glutBitmapLength(int font, String string)
void
glutBitmapString(int font, String string)
void
glutBitmapString(Font axisFont, String label, Coord3d p, Color c)
Render 2D text at the given 3D position using a font as supported byglutBitmapString(int, String)
.void
glutSolidCube(float size)
void
glutSolidSphere(double radius, int slices, int stacks)
void
glutSolidTeapot(float scale)
void
glutWireTeapot(float scale)
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)
void
glVertex3d(double x, double y, double z)
void
glVertex3f(float x, float y, float z)
void
glViewport(int x, int y, int width, int height)
protected int
lightId(int id)
protected int
materialProperty(MaterialProperty material)
protected int
polygonFillValue(PolygonFill mode)
protected int
polygonModeValue(PolygonMode mode)
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.void
setGL(com.jogamp.opengl.GL gl)
void
setGLU(com.jogamp.opengl.glu.GLU glu)
void
setGLUT(com.jogamp.opengl.util.gl2.GLUT glut)
protected int
toInt(StencilOp fail)
-
Methods inherited from class org.jzy3d.painters.AbstractPainter
box, clearColor, clip, clip, clipOff, clipOn, color, colorAlphaFactor, colorAlphaOverride, equation, getCamera, getCanvas, getOS, getQuality, getView, isJVMScaleLargerThanNativeScale, isJVMScaleLargerThanNativeScale, material, modelToScreen, modelToScreen, modelToScreen, modelToScreen, modelToScreen, modelToScreen, modelToScreen, normal, raster, screenToModel, setCamera, setCanvas, setView, transform, vertex, vertex, vertex
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jzy3d.painters.IPainter
box, clearColor, clip, clip, clipOff, clipOn, color, colorAlphaFactor, colorAlphaOverride, getCamera, getCanvas, getOS, getQuality, getView, isJVMScaleLargerThanNativeScale, isJVMScaleLargerThanNativeScale, material, modelToScreen, modelToScreen, modelToScreen, modelToScreen, modelToScreen, modelToScreen, modelToScreen, normal, raster, screenToModel, setCamera, setCanvas, setView, transform, vertex, vertex, vertex
-
-
-
-
Field Detail
-
gl
protected com.jogamp.opengl.GL gl
-
glu
protected com.jogamp.opengl.glu.GLU glu
-
glut
protected com.jogamp.opengl.util.gl2.GLUT glut
-
GL_RGBA
public static final int GL_RGBA
- See Also:
- Constant Field Values
-
GL_UNSIGNED_BYTE
public static final int GL_UNSIGNED_BYTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getGL
public com.jogamp.opengl.GL getGL()
-
getGL2
public com.jogamp.opengl.GL2 getGL2()
-
setGL
public void setGL(com.jogamp.opengl.GL gl)
-
getGLU
public com.jogamp.opengl.glu.GLU getGLU()
-
setGLU
public void setGLU(com.jogamp.opengl.glu.GLU glu)
-
getGLUT
public com.jogamp.opengl.util.gl2.GLUT getGLUT()
-
setGLUT
public void setGLUT(com.jogamp.opengl.util.gl2.GLUT glut)
-
acquireGL
public Object acquireGL()
Description copied from interface:IPainter
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 callIPainter.releaseGL()
-
releaseGL
public void releaseGL()
Description copied from interface:IPainter
In the context of a multithreaded application, this method allows releasing the GL context by the calling thread to let other thread use it.IPainter.acquireGL()
-
getCurrentGL
public com.jogamp.opengl.GL getCurrentGL(ICanvas canvas)
Get the current GL context of the canvas and make it current. This is usefull when needing to get a GL instance outside of the context of theGLEventListener
, e.g. when clicking the frame with mouse.
-
getCurrentContext
public com.jogamp.opengl.GLContext getCurrentContext(ICanvas canvas)
-
configureGL
public void configureGL(Quality quality)
Description copied from interface:IPainter
Apply quality settings as OpenGL commands- Specified by:
configureGL
in interfaceIPainter
-
getWindowingToolkit
public WindowingToolkit getWindowingToolkit()
- Specified by:
getWindowingToolkit
in interfaceIPainter
- Overrides:
getWindowingToolkit
in classAbstractPainter
-
getViewPortAsInt
public int[] getViewPortAsInt()
- Specified by:
getViewPortAsInt
in interfaceIPainter
-
getProjectionAsDouble
public double[] getProjectionAsDouble()
- Specified by:
getProjectionAsDouble
in interfaceIPainter
-
getProjectionAsFloat
public float[] getProjectionAsFloat()
- Specified by:
getProjectionAsFloat
in interfaceIPainter
-
getModelViewAsDouble
public double[] getModelViewAsDouble()
- Specified by:
getModelViewAsDouble
in interfaceIPainter
-
getModelViewAsFloat
public float[] getModelViewAsFloat()
- Specified by:
getModelViewAsFloat
in interfaceIPainter
-
glPushMatrix
public void glPushMatrix()
OPEN GL Interface- Specified by:
glPushMatrix
in interfaceIPainter
-
glPopMatrix
public void glPopMatrix()
- Specified by:
glPopMatrix
in interfaceIPainter
-
glMatrixMode
public void glMatrixMode(int mode)
- Specified by:
glMatrixMode
in interfaceIPainter
-
glLoadIdentity
public void glLoadIdentity()
- Specified by:
glLoadIdentity
in interfaceIPainter
-
glScalef
public void glScalef(float x, float y, float z)
-
glTranslatef
public void glTranslatef(float x, float y, float z)
- Specified by:
glTranslatef
in interfaceIPainter
-
glRotatef
public void glRotatef(float angle, float x, float y, float z)
-
glPointSize
public void glPointSize(float width)
- Specified by:
glPointSize
in interfaceIPainter
-
glLineWidth
public void glLineWidth(float width)
- Specified by:
glLineWidth
in interfaceIPainter
-
glColor3f
public void glColor3f(float r, float g, float b)
-
glColor4f
public void glColor4f(float r, float g, float b, float a)
-
glVertex3f
public void glVertex3f(float x, float y, float z)
- Specified by:
glVertex3f
in interfaceIPainter
-
glVertex3d
public void glVertex3d(double x, double y, double z)
- Specified by:
glVertex3d
in interfaceIPainter
-
glFrontFace
public void glFrontFace(int mode)
- Specified by:
glFrontFace
in interfaceIPainter
-
glCullFace
public void glCullFace(int mode)
- Specified by:
glCullFace
in interfaceIPainter
-
glPolygonMode
public void glPolygonMode(PolygonMode mode, PolygonFill fill)
- Specified by:
glPolygonMode
in interfaceIPainter
-
polygonModeValue
protected int polygonModeValue(PolygonMode mode)
-
polygonFillValue
protected int polygonFillValue(PolygonFill mode)
-
glPolygonMode
public void glPolygonMode(int frontOrBack, int fill)
- Specified by:
glPolygonMode
in interfaceIPainter
-
glPolygonOffset
public void glPolygonOffset(float factor, float units)
- Specified by:
glPolygonOffset
in interfaceIPainter
-
glLineStipple
public void glLineStipple(int factor, short pattern)
- Specified by:
glLineStipple
in interfaceIPainter
-
glTexCoord2f
public void glTexCoord2f(float s, float t)
- Specified by:
glTexCoord2f
in interfaceIPainter
-
glTexEnvf
public void glTexEnvf(int target, int pname, float param)
-
glTexEnvi
public void glTexEnvi(int target, int pname, int param)
-
glRasterPos3f
public void glRasterPos3f(float x, float y, float z)
- Specified by:
glRasterPos3f
in interfaceIPainter
-
glDrawPixels
public void glDrawPixels(int width, int height, int format, int type, Buffer pixels)
- Specified by:
glDrawPixels
in interfaceIPainter
-
glPixelZoom
public void glPixelZoom(float xfactor, float yfactor)
- Specified by:
glPixelZoom
in interfaceIPainter
-
glPixelStorei
public void glPixelStorei(int pname, int param)
- Specified by:
glPixelStorei
in interfaceIPainter
-
glPixelStore
public void glPixelStore(PixelStore store, int param)
- Specified by:
glPixelStore
in interfaceIPainter
-
glBitmap
public void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, byte[] bitmap, int bitmap_offset)
-
drawImage
public void drawImage(ByteBuffer imageBuffer, int imageWidth, int imageHeight, Coord2d pixelZoom, Coord3d imagePosition)
Description copied from interface:IPainter
A high level and easy way of drawing images (non OpenGL).
-
glutBitmapString
public void glutBitmapString(int font, String string)
- Specified by:
glutBitmapString
in interfaceIPainter
-
drawText
public void drawText(Font font, String label, Coord3d position, Color color, float rotation)
Render 2D text at the given 3D position. TheFont
can be any font name and size supported by AWT. Rotation is in radian and is applied at the center of the text to avoid messing up text layout.
-
getOrCreateTextRenderer
protected com.jogamp.opengl.util.awt.TextRenderer getOrCreateTextRenderer(Font font)
-
glutBitmapString
public void glutBitmapString(Font axisFont, String label, Coord3d p, Color c)
Render 2D text at the given 3D position using a font as supported byglutBitmapString(int, String)
.- Specified by:
glutBitmapString
in interfaceIPainter
-
glutBitmapLength
public int glutBitmapLength(int font, String string)
- Specified by:
glutBitmapLength
in interfaceIPainter
-
getTextLengthInPixels
public int getTextLengthInPixels(int font, String string)
- Specified by:
getTextLengthInPixels
in interfaceIPainter
-
getTextLengthInPixels
public int getTextLengthInPixels(Font font, String string)
- Specified by:
getTextLengthInPixels
in interfaceIPainter
-
glGenLists
public int glGenLists(int range)
- Specified by:
glGenLists
in interfaceIPainter
-
glNewList
public void glNewList(int list, ListMode mode)
-
glCallList
public void glCallList(int list)
- Specified by:
glCallList
in interfaceIPainter
-
glDeleteLists
public void glDeleteLists(int list, int range)
- Specified by:
glDeleteLists
in interfaceIPainter
-
gluDisk
public void gluDisk(double inner, double outer, int slices, int loops)
-
glutSolidSphere
public void glutSolidSphere(double radius, int slices, int stacks)
- Specified by:
glutSolidSphere
in interfaceIPainter
-
gluSphere
public void gluSphere(double radius, int slices, int stacks)
-
gluCylinder
public void gluCylinder(double base, double top, double height, int slices, int stacks)
- Specified by:
gluCylinder
in interfaceIPainter
-
glutSolidCube
public void glutSolidCube(float size)
- Specified by:
glutSolidCube
in interfaceIPainter
-
glutSolidTeapot
public void glutSolidTeapot(float scale)
- Specified by:
glutSolidTeapot
in interfaceIPainter
-
glutWireTeapot
public void glutWireTeapot(float scale)
- Specified by:
glutWireTeapot
in interfaceIPainter
-
glFeedbackBuffer
public void glFeedbackBuffer(int size, int type, FloatBuffer buffer)
- Specified by:
glFeedbackBuffer
in interfaceIPainter
-
glRenderMode
public int glRenderMode(int mode)
- Specified by:
glRenderMode
in interfaceIPainter
-
glRenderMode
public int glRenderMode(RenderMode mode)
- Specified by:
glRenderMode
in interfaceIPainter
-
glPassThrough
public void glPassThrough(float token)
- Specified by:
glPassThrough
in interfaceIPainter
-
glStencilFunc
public void glStencilFunc(StencilFunc func, int ref, int mask)
Description copied from interface:IPainter
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 & mask ) < ( stencil & mask ).
- GL_LEQUAL Passes if ( ref & mask ) <= ( stencil & mask ).
- GL_GREATER Passes if ( ref & mask ) > ( stencil & mask ).
- GL_GEQUAL Passes if ( ref & mask ) >= ( stencil & mask ).
- GL_EQUAL Passes if ( ref & mask ) = ( stencil & mask ).
- GL_NOTEQUAL Passes if ( ref & mask ) != ( stencil & mask ).
- GL_ALWAYS Always passes.
- Specified by:
glStencilFunc
in interfaceIPainter
- 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
public void glStencilMask(int mask)
Description copied from interface:IPainter
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.- Specified by:
glStencilMask
in interfaceIPainter
-
glStencilMask_True
public void glStencilMask_True()
- Specified by:
glStencilMask_True
in interfaceIPainter
-
glStencilMask_False
public void glStencilMask_False()
- Specified by:
glStencilMask_False
in interfaceIPainter
-
glStencilOp
public void glStencilOp(StencilOp fail, StencilOp zfail, StencilOp zpass)
Description copied from interface:IPainter
The glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass) contains three options of which we can specify for each option what action to take:- Specified by:
glStencilOp
in interfaceIPainter
- 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
public void glClearStencil(int s)
Description copied from interface:IPainter
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.- Specified by:
glClearStencil
in interfaceIPainter
-
toInt
protected int toInt(StencilOp fail)
-
glOrtho
public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val)
-
gluOrtho2D
public void gluOrtho2D(double left, double right, double bottom, double top)
- Specified by:
gluOrtho2D
in interfaceIPainter
-
gluPerspective
public void gluPerspective(double fovy, double aspect, double zNear, double zFar)
- Specified by:
gluPerspective
in interfaceIPainter
-
glFrustum
public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
-
gluLookAt
public void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
-
glViewport
public void glViewport(int x, int y, int width, int height)
- Specified by:
glViewport
in interfaceIPainter
-
glClipPlane
public void glClipPlane(int plane, double[] equation)
- Specified by:
glClipPlane
in interfaceIPainter
-
glEnable_ClipPlane
public void glEnable_ClipPlane(int plane)
- Specified by:
glEnable_ClipPlane
in interfaceIPainter
-
clipPlaneId
public int clipPlaneId(int id)
Return the GL clip plane ID according to an ID in [0;5]- Specified by:
clipPlaneId
in interfaceIPainter
-
glDisable_ClipPlane
public void glDisable_ClipPlane(int plane)
- Specified by:
glDisable_ClipPlane
in interfaceIPainter
-
gluUnProject
public 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)
- Specified by:
gluUnProject
in interfaceIPainter
-
gluProject
public 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)
- Specified by:
gluProject
in interfaceIPainter
-
glGetIntegerv
public void glGetIntegerv(int pname, int[] data, int data_offset)
- Specified by:
glGetIntegerv
in interfaceIPainter
-
glGetDoublev
public void glGetDoublev(int pname, double[] params, int params_offset)
- Specified by:
glGetDoublev
in interfaceIPainter
-
glGetFloatv
public void glGetFloatv(int pname, float[] data, int data_offset)
- Specified by:
glGetFloatv
in interfaceIPainter
-
glDepthFunc
public void glDepthFunc(int func)
- Specified by:
glDepthFunc
in interfaceIPainter
-
glDepthRangef
public void glDepthRangef(float near, float far)
- Specified by:
glDepthRangef
in interfaceIPainter
-
glBlendFunc
public void glBlendFunc(int sfactor, int dfactor)
- Specified by:
glBlendFunc
in interfaceIPainter
-
glShadeModel
public void glShadeModel(ColorModel colorModel)
- Specified by:
glShadeModel
in interfaceIPainter
-
glShadeModel
public void glShadeModel(int mode)
- Specified by:
glShadeModel
in interfaceIPainter
-
glShadeModel_Smooth
public void glShadeModel_Smooth()
- Specified by:
glShadeModel_Smooth
in interfaceIPainter
-
glShadeModel_Flat
public void glShadeModel_Flat()
- Specified by:
glShadeModel_Flat
in interfaceIPainter
-
glMaterialfv
public void glMaterialfv(int face, int pname, float[] params, int params_offset)
- Specified by:
glMaterialfv
in interfaceIPainter
-
glNormal3f
public void glNormal3f(float nx, float ny, float nz)
- Specified by:
glNormal3f
in interfaceIPainter
-
glLightModeli
public void glLightModeli(int mode, int value)
- Specified by:
glLightModeli
in interfaceIPainter
-
glLightModelfv
public void glLightModelfv(int mode, float[] value)
- Specified by:
glLightModelfv
in interfaceIPainter
-
glLightModel
public void glLightModel(LightModel model, boolean value)
- Specified by:
glLightModel
in interfaceIPainter
-
glLightModel
public void glLightModel(LightModel model, Color color)
- Specified by:
glLightModel
in interfaceIPainter
-
glLightf
public void glLightf(int light, Attenuation.Type attenuationType, float value)
-
glLightf
public void glLightf(int light, int pname, float value)
-
glLightfv
public void glLightfv(int light, int pname, float[] params, int params_offset)
-
glLight_Position
public void glLight_Position(int lightId, float[] positionZero)
- Specified by:
glLight_Position
in interfaceIPainter
-
glLight_Ambiant
public void glLight_Ambiant(int lightId, Color ambiantColor)
- Specified by:
glLight_Ambiant
in interfaceIPainter
-
glLight_Diffuse
public void glLight_Diffuse(int lightId, Color diffuseColor)
- Specified by:
glLight_Diffuse
in interfaceIPainter
-
glLight_Specular
public void glLight_Specular(int lightId, Color specularColor)
- Specified by:
glLight_Specular
in interfaceIPainter
-
glLight_Shininess
public void glLight_Shininess(int lightId, float value)
- Specified by:
glLight_Shininess
in interfaceIPainter
-
glEnable_Light
public void glEnable_Light(int light)
- Specified by:
glEnable_Light
in interfaceIPainter
-
glDisable_Light
public void glDisable_Light(int light)
- Specified by:
glDisable_Light
in interfaceIPainter
-
lightId
protected int lightId(int id)
-
glClearColor
public void glClearColor(float red, float green, float blue, float alpha)
- Specified by:
glClearColor
in interfaceIPainter
-
glClearDepth
public void glClearDepth(double d)
- Specified by:
glClearDepth
in interfaceIPainter
-
glClearColorAndDepthBuffers
public void glClearColorAndDepthBuffers()
- Specified by:
glClearColorAndDepthBuffers
in interfaceIPainter
-
glInitNames
public void glInitNames()
- Specified by:
glInitNames
in interfaceIPainter
-
glLoadName
public void glLoadName(int name)
- Specified by:
glLoadName
in interfaceIPainter
-
glPushName
public void glPushName(int name)
- Specified by:
glPushName
in interfaceIPainter
-
glSelectBuffer
public void glSelectBuffer(int size, IntBuffer buffer)
- Specified by:
glSelectBuffer
in interfaceIPainter
-
gluPickMatrix
public void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset)
- Specified by:
gluPickMatrix
in interfaceIPainter
-
glEvalCoord2f
public void glEvalCoord2f(float u, float v)
- Specified by:
glEvalCoord2f
in interfaceIPainter
-
glMap2f
public void glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points)
-
glEnable_PolygonOffsetFill
public void glEnable_PolygonOffsetFill()
- Specified by:
glEnable_PolygonOffsetFill
in interfaceIPainter
-
glDisable_PolygonOffsetFill
public void glDisable_PolygonOffsetFill()
- Specified by:
glDisable_PolygonOffsetFill
in interfaceIPainter
-
glEnable_PolygonOffsetLine
public void glEnable_PolygonOffsetLine()
- Specified by:
glEnable_PolygonOffsetLine
in interfaceIPainter
-
glDisable_PolygonOffsetLine
public void glDisable_PolygonOffsetLine()
- Specified by:
glDisable_PolygonOffsetLine
in interfaceIPainter
-
glEnable_Blend
public void glEnable_Blend()
- Specified by:
glEnable_Blend
in interfaceIPainter
-
glDisable_Blend
public void glDisable_Blend()
- Specified by:
glDisable_Blend
in interfaceIPainter
-
glMatrixMode_ModelView
public void glMatrixMode_ModelView()
- Specified by:
glMatrixMode_ModelView
in interfaceIPainter
-
glMatrixMode_Projection
public void glMatrixMode_Projection()
- Specified by:
glMatrixMode_Projection
in interfaceIPainter
-
glBegin_Polygon
public void glBegin_Polygon()
- Specified by:
glBegin_Polygon
in interfaceIPainter
-
glBegin_Quad
public void glBegin_Quad()
- Specified by:
glBegin_Quad
in interfaceIPainter
-
glBegin_Triangle
public void glBegin_Triangle()
- Specified by:
glBegin_Triangle
in interfaceIPainter
-
glBegin_Point
public void glBegin_Point()
- Specified by:
glBegin_Point
in interfaceIPainter
-
glBegin_LineStrip
public void glBegin_LineStrip()
- Specified by:
glBegin_LineStrip
in interfaceIPainter
-
glBegin_LineLoop
public void glBegin_LineLoop()
- Specified by:
glBegin_LineLoop
in interfaceIPainter
-
glBegin_Line
public void glBegin_Line()
- Specified by:
glBegin_Line
in interfaceIPainter
-
glEnable_LineStipple
public void glEnable_LineStipple()
- Specified by:
glEnable_LineStipple
in interfaceIPainter
-
glDisable_LineStipple
public void glDisable_LineStipple()
- Specified by:
glDisable_LineStipple
in interfaceIPainter
-
glEnable_CullFace
public void glEnable_CullFace()
- Specified by:
glEnable_CullFace
in interfaceIPainter
-
glDisable_CullFace
public void glDisable_CullFace()
- Specified by:
glDisable_CullFace
in interfaceIPainter
-
glFrontFace_ClockWise
public void glFrontFace_ClockWise()
- Specified by:
glFrontFace_ClockWise
in interfaceIPainter
-
glCullFace_Front
public void glCullFace_Front()
- Specified by:
glCullFace_Front
in interfaceIPainter
-
glDisable_Lighting
public void glDisable_Lighting()
- Specified by:
glDisable_Lighting
in interfaceIPainter
-
glEnable_Lighting
public void glEnable_Lighting()
- Specified by:
glEnable_Lighting
in interfaceIPainter
-
glEnable_ColorMaterial
public void glEnable_ColorMaterial()
- Specified by:
glEnable_ColorMaterial
in interfaceIPainter
-
glMaterial
public void glMaterial(MaterialProperty material, Color color, boolean isFront)
- Specified by:
glMaterial
in interfaceIPainter
-
glMaterial
public void glMaterial(MaterialProperty material, float[] color, boolean isFront)
- Specified by:
glMaterial
in interfaceIPainter
-
materialProperty
protected int materialProperty(MaterialProperty material)
-
glEnable_PointSmooth
public void glEnable_PointSmooth()
- Specified by:
glEnable_PointSmooth
in interfaceIPainter
-
glHint_PointSmooth_Nicest
public void glHint_PointSmooth_Nicest()
- Specified by:
glHint_PointSmooth_Nicest
in interfaceIPainter
-
glDepthFunc
public void glDepthFunc(DepthFunc func)
- Specified by:
glDepthFunc
in interfaceIPainter
-
glEnable_DepthTest
public void glEnable_DepthTest()
- Specified by:
glEnable_DepthTest
in interfaceIPainter
-
glDisable_DepthTest
public void glDisable_DepthTest()
- Specified by:
glDisable_DepthTest
in interfaceIPainter
-
glEnable_Stencil
public void glEnable_Stencil()
- Specified by:
glEnable_Stencil
in interfaceIPainter
-
glDisable_Stencil
public void glDisable_Stencil()
- Specified by:
glDisable_Stencil
in interfaceIPainter
-
-