Class JoGLTextureManager.JoGLTexture
- java.lang.Object
-
- org.scilab.forge.scirenderer.texture.AbstractTexture
-
- org.scilab.forge.scirenderer.implementation.jogl.texture.JoGLTextureManager.JoGLTexture
-
- Enclosing class:
- JoGLTextureManager
public class JoGLTextureManager.JoGLTexture extends AbstractTexture implements Texture
Inner class forTexture
implementation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.scilab.forge.scirenderer.texture.Texture
Texture.Filter, Texture.Wrap
-
-
Field Summary
-
Fields inherited from class org.scilab.forge.scirenderer.texture.AbstractTexture
textureDataProvider, upToDate
-
-
Constructor Summary
Constructors Constructor Description JoGLTexture()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(JoGLDrawingTools drawingTools)
Bind the texture in the OpenGl context.void
draw(JoGLDrawingTools drawingTools)
Draw the texture in XY plane.void
draw(JoGLDrawingTools drawingTools, AnchorPosition anchor, Vector3d position, double rotationAngle)
protected double
getAnchorDeltaX(AnchorPosition anchor)
Return the deltaX to apply to the sprite in regards to the given anchor.protected double
getAnchorDeltaY(AnchorPosition anchor)
Return the deltaY to apply to the sprite in regards to the given anchor.double
getSScaleFactor()
2D-Texture coordinates must be modified according to the real texture dimension which can differ from the textureSize (with certains GC, a texture must have a size which is a power-of-two).double
getTScaleFactor()
2D-Texture coordinates must be modified according to the real texture dimension which can differ from the textureSize (with certains GC, a texture must have a size which is a power-of-two).void
glReload()
Called when gl context is gone.void
postDraw(JoGLDrawingTools drawingTools)
void
preDraw(JoGLDrawingTools drawingTools)
-
Methods inherited from class org.scilab.forge.scirenderer.texture.AbstractTexture
dataUpdated, getDataProvider, getMagnificationFilter, getMinifyingFilter, getSWrappingMode, getTWrappingMode, isValid, setDataProvider, setDrawer, setMagnificationFilter, setMinifyingFilter, setSWrappingMode, setTWrappingMode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scilab.forge.scirenderer.data.DataUser
dataUpdated
-
Methods inherited from interface org.scilab.forge.scirenderer.texture.Texture
getDataProvider, getMagnificationFilter, getMinifyingFilter, getSWrappingMode, getTWrappingMode, isValid, setDataProvider, setDrawer, setMagnificationFilter, setMinifyingFilter, setSWrappingMode, setTWrappingMode
-
-
-
-
Method Detail
-
bind
public void bind(JoGLDrawingTools drawingTools) throws SciRendererException
Bind the texture in the OpenGl context.- Parameters:
drawingTools
- current drawing tools.- Throws:
SciRendererException
- if the texture is invalid.
-
preDraw
public void preDraw(JoGLDrawingTools drawingTools) throws SciRendererException
- Throws:
SciRendererException
-
draw
public void draw(JoGLDrawingTools drawingTools, AnchorPosition anchor, Vector3d position, double rotationAngle) throws SciRendererException
- Throws:
SciRendererException
-
postDraw
public void postDraw(JoGLDrawingTools drawingTools)
-
draw
public void draw(JoGLDrawingTools drawingTools) throws SciRendererException
Draw the texture in XY plane.- Parameters:
drawingTools
- the drawing tools.- Throws:
SciRendererException
- if the texture is invalid.
-
getSScaleFactor
public double getSScaleFactor()
Description copied from interface:Texture
2D-Texture coordinates must be modified according to the real texture dimension which can differ from the textureSize (with certains GC, a texture must have a size which is a power-of-two).- Specified by:
getSScaleFactor
in interfaceTexture
- Overrides:
getSScaleFactor
in classAbstractTexture
- Returns:
- the scale factor for the s-coordinate
-
getTScaleFactor
public double getTScaleFactor()
Description copied from interface:Texture
2D-Texture coordinates must be modified according to the real texture dimension which can differ from the textureSize (with certains GC, a texture must have a size which is a power-of-two).- Specified by:
getTScaleFactor
in interfaceTexture
- Overrides:
getTScaleFactor
in classAbstractTexture
- Returns:
- the scale factor for the t-coordinate
-
glReload
public void glReload()
Called when gl context is gone.
-
getAnchorDeltaX
protected double getAnchorDeltaX(AnchorPosition anchor)
Return the deltaX to apply to the sprite in regards to the given anchor.- Parameters:
anchor
- the given anchor.- Returns:
- the deltaX to apply to the sprite in regards to the given anchor.
-
getAnchorDeltaY
protected double getAnchorDeltaY(AnchorPosition anchor)
Return the deltaY to apply to the sprite in regards to the given anchor.- Parameters:
anchor
- the given anchor.- Returns:
- the deltaY to apply to the sprite in regards to the given anchor.
-
-