21package com.jogamp.opengl.test.junit.jogl.demos.es1;
23import java.nio.FloatBuffer;
25import com.jogamp.opengl.GL;
26import com.jogamp.opengl.GL2ES1;
27import com.jogamp.opengl.GLBufferStorage;
28import com.jogamp.opengl.GLException;
29import com.jogamp.opengl.fixedfunc.GLLightingFunc;
30import com.jogamp.opengl.fixedfunc.GLPointerFunc;
32import com.jogamp.opengl.test.junit.jogl.demos.GearsObject;
33import com.jogamp.opengl.util.GLArrayDataServer;
42 final float outer_radius,
final float width,
final int teeth,
final float tooth_depth,
final boolean validateBuffers) {
51 public GLArrayDataServer createInterleaved(
final boolean useMappedBuffers,
final int comps,
final int dataType,
final boolean normalized,
final int initialSize,
final int vboUsage) {
52 if( useMappedBuffers ) {
74 final boolean ok = bufferName == hasBufferName &&
75 bufferName == hasStorage.
getName() &&
76 bufferSize == hasStorage.
getSize();
78 throw new GLException(
"GLBufferStorage Validation Error: Target[exp 0x"+Integer.toHexString(bufferTarget)+
", has 0x"+Integer.toHexString(bufferTarget)+
79 ", Name[exp "+bufferName+
", has "+hasBufferName+
", Size exp "+bufferSize+
", Storage "+hasStorage+
"]");
88 public void draw(
final GL _gl,
final float x,
final float y,
final float angle) {
OpenGL buffer storage object reflecting it's.
final int getName()
Return the buffer name.
final long getSize()
Return the buffer's storage size.
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
GLArrayDataServer frontSide
final FloatBuffer gearColor
GLArrayDataServer backFace
GLArrayDataServer frontFace
GLArrayDataServer outwardFace
GLArrayDataServer backSide
GLArrayDataServer insideRadiusCyl
void draw(final GL _gl, final float x, final float y, final float angle)
GearsObjectES1(final GearsObject shared)
void addInterleavedVertexAndNormalArrays(final GLArrayDataServer array, final int components)
GLArrayDataServer createInterleaved(final boolean useMappedBuffers, final int comps, final int dataType, final boolean normalized, final int initialSize, final int vboUsage)
GearsObjectES1(final GL gl, final boolean useMappedBuffers, final FloatBuffer gearColor, final float inner_radius, final float outer_radius, final float width, final int teeth, final float tooth_depth, final boolean validateBuffers)
void enableBuffer(final GL gl, final boolean enable)
Enables the buffer if enable is true, and transfers the data if required.
static GLArrayDataServer createFixedInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount, final int vboUsage)
Create a VBO for fixed function interleaved array data starting with a new created Buffer object with...
GLArrayData addFixedSubArray(final int index, final int comps, final int vboTarget)
Configure a segment of this fixed function interleaved array (see createFixedInterleaved(int,...
static GLArrayDataServer createFixedInterleavedMapped(final int compsPerElement, final int dataType, final boolean normalized, final int mappedElementCount, final int vboUsage)
Create a VBO for fixed function interleaved array data intended for GPU buffer storage mapping,...
final int getByteCount()
Returns the byte position (written elements) if not sealed() or the byte limit (available to read) af...
final int getElemCount()
Returns the element position (written elements) if not sealed() or the element limit (available to re...
final int getVBOName()
The VBO name or 0 if not a VBO.
final int getVBOTarget()
The VBO target or 0 if not a VBO.
GL2ES1 getGL2ES1()
Casts this object to the GL2ES1 interface.
int getBoundBuffer(int target)
GLBufferStorage getBufferStorage(int bufferName)
void glDrawArrays(int mode, int first, int count)
Entry point to C language function: void {@native glDrawArrays}(GLenum mode, GLint first,...
static final int GL_TRIANGLES
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TRIANGLES" with expre...
boolean glIsBuffer(int buffer)
Entry point to C language function: GLboolean {@native glIsBuffer}(GLuint buffer) Part of GL_VERSI...
static final int GL_FRONT_AND_BACK
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_FRONT_AND_BACK" with ...
static final int GL_TRIANGLE_STRIP
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TRIANGLE_STRIP" with ...
static final int GL_ARRAY_BUFFER
GL_VERSION_1_5, GL_ES_VERSION_2_0, GL_VERSION_ES_1_0, GL_ARB_vertex_buffer_object Alias for: GL_ARRAY...
void glMaterialfv(int face, int pname, java.nio.FloatBuffer params)
static final int GL_SMOOTH
static final int GL_AMBIENT_AND_DIFFUSE
void glShadeModel(int mode)
void glPushMatrix()
Push the current matrix to it's stack, while preserving it's values.
void glPopMatrix()
Pop the current matrix from it's stack.
void glTranslatef(float x, float y, float z)
Translate the current matrix.
void glRotatef(float angle, float x, float y, float z)
Rotate the current matrix.
static final int GL_VERTEX_ARRAY
static final int GL_NORMAL_ARRAY