Class SharedTexture
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.textures.SharedTexture
-
- All Implemented Interfaces:
IGLBindedResource
- Direct Known Subclasses:
BufferedImageTexture
public class SharedTexture extends Object implements IGLBindedResource
-
-
Field Summary
Fields Modifier and Type Field Description protected com.jogamp.opengl.util.texture.TextureCoords
coords
protected String
file
protected float
halfHeight
protected float
halfWidth
protected com.jogamp.opengl.util.texture.Texture
texture
protected int
textureMagnificationFilter
protected int
textureMinificationFilter
protected boolean
useMipMap
-
Constructor Summary
Constructors Modifier Constructor Description protected
SharedTexture()
SharedTexture(String file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.jogamp.opengl.util.texture.TextureCoords
getCoords()
String
getFile()
float
getHalfHeight()
float
getHalfWidth()
com.jogamp.opengl.util.texture.Texture
getTexture(IPainter painter)
int
getTextureMagnificationFilter()
int
getTextureMinificationFilter()
boolean
hasMountedOnce()
Return true if mount(...) has been called at least one timeboolean
isUseMipMap()
protected void
load(com.jogamp.opengl.GL gl, String fileName)
void
mount(IPainter painter)
A GL2 context MUST be current.void
setTextureMagnificationFilter(int textureMagnificationFilter)
Will apply if set before actually loading the texture.void
setTextureMinificationFilter(int textureMinificationFilter)
Will apply if set before actually loading the texture.void
setUseMipMap(boolean useMipMap)
Will apply if set before actually loading the texture.
-
-
-
Field Detail
-
texture
protected com.jogamp.opengl.util.texture.Texture texture
-
file
protected String file
-
coords
protected com.jogamp.opengl.util.texture.TextureCoords coords
-
halfWidth
protected float halfWidth
-
halfHeight
protected float halfHeight
-
useMipMap
protected boolean useMipMap
-
textureMagnificationFilter
protected int textureMagnificationFilter
-
textureMinificationFilter
protected int textureMinificationFilter
-
-
Constructor Detail
-
SharedTexture
protected SharedTexture()
-
SharedTexture
public SharedTexture(String file)
-
-
Method Detail
-
getTexture
public com.jogamp.opengl.util.texture.Texture getTexture(IPainter painter)
-
mount
public void mount(IPainter painter)
A GL2 context MUST be current.- Specified by:
mount
in interfaceIGLBindedResource
-
hasMountedOnce
public boolean hasMountedOnce()
Description copied from interface:IGLBindedResource
Return true if mount(...) has been called at least one time- Specified by:
hasMountedOnce
in interfaceIGLBindedResource
-
load
protected void load(com.jogamp.opengl.GL gl, String fileName) throws com.jogamp.opengl.GLException, IOException
- Throws:
com.jogamp.opengl.GLException
IOException
-
getFile
public String getFile()
-
getCoords
public com.jogamp.opengl.util.texture.TextureCoords getCoords()
-
getHalfWidth
public float getHalfWidth()
-
getHalfHeight
public float getHalfHeight()
-
isUseMipMap
public boolean isUseMipMap()
-
setUseMipMap
public void setUseMipMap(boolean useMipMap)
Will apply if set before actually loading the texture.- Parameters:
useMipMap
-
-
getTextureMagnificationFilter
public int getTextureMagnificationFilter()
-
setTextureMagnificationFilter
public void setTextureMagnificationFilter(int textureMagnificationFilter)
Will apply if set before actually loading the texture. Possible values documented in https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml (see parameter GL_TEXTURE_MAG_FILTER) Use -1 to avoid magnification- Parameters:
textureMagnificationFilter
-
-
getTextureMinificationFilter
public int getTextureMinificationFilter()
-
setTextureMinificationFilter
public void setTextureMinificationFilter(int textureMinificationFilter)
Will apply if set before actually loading the texture. Possible values documented in https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml (see parameter GL_TEXTURE_MIN_FILTER) Use -1 to avoid minification- Parameters:
textureMinificationFilter
-
-
-