Class JoGLTextureManager.JoGLTexture
java.lang.Object
org.scilab.forge.scirenderer.texture.AbstractTexture
org.scilab.forge.scirenderer.implementation.jogl.texture.JoGLTextureManager.JoGLTexture
- Enclosing class:
JoGLTextureManager
Inner class for
Texture 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(JoGLDrawingTools drawingTools) Bind the texture in the OpenGl context.voiddraw(JoGLDrawingTools drawingTools) Draw the texture in XY plane.voiddraw(JoGLDrawingTools drawingTools, AnchorPosition anchor, Vector3d position, double rotationAngle) protected doublegetAnchorDeltaX(AnchorPosition anchor) Return the deltaX to apply to the sprite in regards to the given anchor.protected doublegetAnchorDeltaY(AnchorPosition anchor) Return the deltaY to apply to the sprite in regards to the given anchor.double2D-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).double2D-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).voidglReload()Called when gl context is gone.voidpostDraw(JoGLDrawingTools drawingTools) voidpreDraw(JoGLDrawingTools drawingTools) Methods inherited from class org.scilab.forge.scirenderer.texture.AbstractTexture
dataUpdated, getDataProvider, getMagnificationFilter, getMinifyingFilter, getSWrappingMode, getTWrappingMode, isValid, setDataProvider, setDrawer, setMagnificationFilter, setMinifyingFilter, setSWrappingMode, setTWrappingModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.scilab.forge.scirenderer.data.DataUser
dataUpdatedMethods inherited from interface org.scilab.forge.scirenderer.texture.Texture
getDataProvider, getMagnificationFilter, getMinifyingFilter, getSWrappingMode, getTWrappingMode, isValid, setDataProvider, setDrawer, setMagnificationFilter, setMinifyingFilter, setSWrappingMode, setTWrappingMode
-
Constructor Details
-
JoGLTexture
public JoGLTexture()Default constructor.
-
-
Method Details
-
bind
Bind the texture in the OpenGl context.- Parameters:
drawingTools- current drawing tools.- Throws:
SciRendererException- if the texture is invalid.
-
preDraw
- Throws:
SciRendererException
-
draw
public void draw(JoGLDrawingTools drawingTools, AnchorPosition anchor, Vector3d position, double rotationAngle) throws SciRendererException - Throws:
SciRendererException
-
postDraw
-
draw
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:Texture2D-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:
getSScaleFactorin interfaceTexture- Overrides:
getSScaleFactorin classAbstractTexture- Returns:
- the scale factor for the s-coordinate
-
getTScaleFactor
public double getTScaleFactor()Description copied from interface:Texture2D-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:
getTScaleFactorin interfaceTexture- Overrides:
getTScaleFactorin classAbstractTexture- Returns:
- the scale factor for the t-coordinate
-
glReload
public void glReload()Called when gl context is gone. -
getAnchorDeltaX
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
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.
-