29package com.jogamp.opengl.test.junit.jogl.demos.gl2;
31import com.jogamp.opengl.test.junit.jogl.demos.TextureDraw01Accessor;
32import com.jogamp.opengl.util.texture.Texture;
33import com.jogamp.opengl.util.texture.TextureCoords;
34import com.jogamp.opengl.util.texture.TextureData;
35import com.jogamp.opengl.util.texture.TextureIO;
37import com.jogamp.opengl.GL;
38import com.jogamp.opengl.GL2ES1;
39import com.jogamp.opengl.GL2;
40import com.jogamp.opengl.GL2GL3;
41import com.jogamp.opengl.GLAutoDrawable;
42import com.jogamp.opengl.GLEventListener;
43import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
44import com.jogamp.opengl.glu.GLU;
47 private final GLU glu =
new GLU();
50 boolean keepTextureBound;
53 this.textureData = td;
54 this.keepTextureBound =
false;
59 this.keepTextureBound = v;
69 if(
null!=textureData) {
71 if( keepTextureBound ) {
79 public void reshape(
final GLAutoDrawable drawable,
final int x,
final int y,
final int width,
final int height) {
95 if(
null!=textureData) {
106 if( !keepTextureBound ) {
122 if( !keepTextureBound ) {
Provides access to the OpenGL Utility Library (GLU).
void gluOrtho2D(float left, float right, float bottom, float top)
void display(final GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.
TextureDraw01GL2Listener(final TextureData td)
void dispose(final GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL resources per GLContext,...
void setKeepTextureBound(final boolean v)
void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height)
Called by the drawable during the first repaint after the component has been resized.
void init(final GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.
Specifies texture coordinates for a rectangular area of a texture.
Represents the data for an OpenGL texture.
void destroy()
Calls flush()
static Texture newTexture(final TextureData data)
Creates an OpenGL texture object from the specified TextureData using the current OpenGL context.
Represents an OpenGL texture object.
TextureCoords getImageTexCoords()
Returns the set of texture coordinates corresponding to the entire image.
void bind(final GL gl)
Binds this texture to the given GL context.
void disable(final GL gl)
Disables this texture's target (e.g., GL_TEXTURE_2D) in the given GL state.
void enable(final GL gl)
Enables this texture's target (e.g., GL_TEXTURE_2D) in the given GL context's state.
void destroy(final GL gl)
Destroys and nulls the underlying native texture used by this Texture instance if owned,...
static final int GL_TEXTURE_ENV_MODE
GL_VERSION_ES_1_0, GL_VERSION_1_0 Define "GL_TEXTURE_ENV_MODE" with expression '0x2200',...
void glTexEnvi(int target, int pname, int param)
Entry point to C language function: void {@native glTexEnvi}(GLenum target, GLenum pname,...
static final int GL_TEXTURE_ENV
GL_VERSION_ES_1_0, GL_VERSION_1_0 Define "GL_TEXTURE_ENV" with expression '0x2300',...
static final int GL_QUADS
GL_ES_VERSION_3_2, GL_VERSION_1_1, GL_VERSION_1_0, GL_OES_tessellation_shader, GL_EXT_tessellation_sh...
void glTexCoord2f(float s, float t)
Entry point to C language function: void {@native glTexCoord2f}(GLfloat s, GLfloat t) Part of GL_V...
void glBegin(int mode)
Entry point to C language function: void {@native glBegin}(GLenum mode) Part of GL_VERSION_1_0
void glVertex3f(float x, float y, float z)
Entry point to C language function: void {@native glVertex3f}(GLfloat x, GLfloat y,...
void glEnd()
Entry point to C language function: void {@native glEnd}() Part of GL_VERSION_1_0
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
GL2 getGL2()
Casts this object to the GL2 interface.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
static final int GL_REPLACE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0, GL_EXT_texture Alias for: GL_RE...
Subset of OpenGL fixed function pipeline's matrix operations.
static final int GL_PROJECTION
Matrix mode projection.
static final int GL_MODELVIEW
Matrix mode modelview.
void glLoadIdentity()
Load the current matrix with the identity matrix.
void glMatrixMode(int mode)
Sets the current matrix mode.