41package com.jogamp.opengl.test.junit.jogl.demos.es1;
43import com.jogamp.opengl.GL;
44import com.jogamp.opengl.GL2ES1;
45import com.jogamp.opengl.GLAutoDrawable;
46import com.jogamp.opengl.GLEventListener;
47import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
49import com.jogamp.opengl.util.ImmModeSink;
57 this.multisample = multisample;
77 gl.
glOrtho(-1, 1, -1, 1, -1, 1);
87 final int numSteps = 20;
88 final double increment = Math.PI / numSteps;
89 final double radius = 1;
91 for (
int i = numSteps - 1; i >= 0; i--) {
92 immModeSink.
glVertex3f((
float) (radius * Math.cos(i * increment)),
93 (
float) (radius * Math.sin(i * increment)),
95 immModeSink.
glVertex3f((
float) (-1.0 * radius * Math.cos(i * increment)),
96 (
float) (-1.0 * radius * Math.sin(i * increment)),
99 immModeSink.
glEnd(gl,
false);
113 immModeSink.
draw(gl,
true);
MultisampleDemoES1(final boolean multisample)
void dispose(final GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL resources per GLContext,...
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 displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged)
void display(final GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.
void init(final GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.
final void glVertex3f(final float x, final float y, final float z)
void destroy(final GL gl)
static ImmModeSink createFixed(final int initialElementCount, final int vComps, final int vDataType, final int cComps, final int cDataType, final int nComps, final int nDataType, final int tComps, final int tDataType, final int glBufferUsage)
Uses a GL2ES1, or ES2 fixed function emulation immediate mode sink.
void draw(final GL gl, final boolean disableBufferAfterDraw)
final void glEnd(final GL gl)
CapabilitiesImmutable getRequestedCapabilities()
Return the capabilities used to choose this graphics configuration.
AbstractGraphicsConfiguration getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window.
void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val)
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
GL2ES1 getGL2ES1()
Casts this object to the GL2ES1 interface.
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
static final int GL_MULTISAMPLE
Common in ES1, GL2 and GL3.
static final int GL_STATIC_DRAW
GL_VERSION_1_5, GL_ES_VERSION_2_0, GL_VERSION_ES_1_0, GL_ARB_vertex_buffer_object Alias for: GL_STATI...
static final int GL_FLOAT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_FLOAT" with expressio...
void glDisable(int cap)
Entry point to C language function: void {@native glDisable}(GLenum cap) Part of GL_ES_VERSION_2_0...
static final int GL_COLOR_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_COLOR_BUFFER_BIT" wit...
void glClearColor(float red, float green, float blue, float alpha)
Entry point to C language function: void {@native glClearColor}(GLfloat red, GLfloat green,...
void glEnable(int cap)
Entry point to C language function: void {@native glEnable}(GLenum cap) Part of GL_ES_VERSION_2_0,...
void glClear(int mask)
Entry point to C language function: void {@native glClear}(GLbitfield mask) Part of GL_ES_VERSION_...
static final int GL_DEPTH_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_BUFFER_BIT" wit...
static final int GL_LINES
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_LINES" with expressio...
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.