FileDocCategorySizeDatePackage
GL11.javaAPI DocphoneME MR2 API (J2ME)81207Wed May 02 18:00:48 BST 2007javax.microedition.khronos.opengles

GL11.java

/*
 * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 only, as published by the Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License version 2 for more details (a copy is
 * included at /legal/license.txt).
 * 
 * You should have received a copy of the GNU General Public License
 * version 2 along with this work; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 * 
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 or visit www.sun.com if you need additional
 * information or have any questions.
 */

package javax.microedition.khronos.opengles;

import java.nio.*;

/**

 * The <code>GL11</code> interface contains the Java(TM) programming
 * language bindings for OpenGL(R) ES 1.1 core functionality.
 *
 * <p> The <code>OES_matrix_get</code>, <code>OES_point_sprite</code> and
 * <code>OES_point_size_array</code> core extensions are defined as
 * part of this interface.
 *
 * <p> Methods that are also present in OpenGL ES 1.0 are included in
 * this interface by inheritance, but are not separately documented.
 * Instead, the documentation from the <code>GL10</code> interface
 * specifies the functional differences between 1.0 and 1.1.
 *
 * <p> See the <code>GL</code> interface for a description of how to
 * obtain an instance of this interface.
 */
public interface GL11 extends GL10 {

  // Begin GL 1.1

  // ClipPlaneName

  /** OpenGL ES 1.1 constant. */
  int GL_CLIP_PLANE0                          = 0x3000;
  /** OpenGL ES 1.1 constant. */
  int GL_CLIP_PLANE1                          = 0x3001;
  /** OpenGL ES 1.1 constant. */
  int GL_CLIP_PLANE2                          = 0x3002;
  /** OpenGL ES 1.1 constant. */
  /** OpenGL ES 1.1 constant. */
  int GL_CLIP_PLANE3                          = 0x3003;
  /** OpenGL ES 1.1 constant. */
  int GL_CLIP_PLANE4                          = 0x3004;
  /** OpenGL ES 1.1 constant. */
  int GL_CLIP_PLANE5                          = 0x3005;

  // GetPName

  /** OpenGL ES 1.1 constant. */
  int GL_CURRENT_COLOR                        = 0x0B00;
  /** OpenGL ES 1.1 constant. */
  int GL_CURRENT_NORMAL                       = 0x0B02;
  /** OpenGL ES 1.1 constant. */
  int GL_CURRENT_TEXTURE_COORDS               = 0x0B03;
  /** OpenGL ES 1.1 constant. */
  int GL_POINT_SIZE                           = 0x0B11;
  /** OpenGL ES 1.1 constant. */
  int GL_POINT_SIZE_MIN                       = 0x8126;
  /** OpenGL ES 1.1 constant. */
  int GL_POINT_SIZE_MAX                       = 0x8127;
  /** OpenGL ES 1.1 constant. */
  int GL_POINT_FADE_THRESHOLD_SIZE            = 0x8128;
  /** OpenGL ES 1.1 constant. */
  int GL_POINT_DISTANCE_ATTENUATION           = 0x8129;
  /** OpenGL ES 1.1 constant. */
  int GL_LINE_WIDTH                           = 0x0B21;
  /** OpenGL ES 1.1 constant. */
  int GL_CULL_FACE_MODE                       = 0x0B45;
  /** OpenGL ES 1.1 constant. */
  int GL_FRONT_FACE                           = 0x0B46;
  /** OpenGL ES 1.1 constant. */
  int GL_SHADE_MODEL                          = 0x0B54;
  /** OpenGL ES 1.1 constant. */
  int GL_DEPTH_RANGE                          = 0x0B70;
  /** OpenGL ES 1.1 constant. */
  int GL_DEPTH_WRITEMASK                      = 0x0B72;
  /** OpenGL ES 1.1 constant. */
  int GL_DEPTH_CLEAR_VALUE                    = 0x0B73;
  /** OpenGL ES 1.1 constant. */
  int GL_DEPTH_FUNC                           = 0x0B74;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_CLEAR_VALUE                  = 0x0B91;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_FUNC                         = 0x0B92;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_VALUE_MASK                   = 0x0B93;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_FAIL                         = 0x0B94;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_PASS_DEPTH_FAIL              = 0x0B95;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_PASS_DEPTH_PASS              = 0x0B96;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_REF                          = 0x0B97;
  /** OpenGL ES 1.1 constant. */
  int GL_STENCIL_WRITEMASK                    = 0x0B98;
  /** OpenGL ES 1.1 constant. */
  int GL_MATRIX_MODE                          = 0x0BA0;
  /** OpenGL ES 1.1 constant. */
  int GL_VIEWPORT                             = 0x0BA2;
  /** OpenGL ES 1.1 constant. */
  int GL_MODELVIEW_STACK_DEPTH                = 0x0BA3;
  /** OpenGL ES 1.1 constant. */
  int GL_PROJECTION_STACK_DEPTH               = 0x0BA4;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_STACK_DEPTH                  = 0x0BA5;
  /** OpenGL ES 1.1 constant. */
  int GL_MODELVIEW_MATRIX                     = 0x0BA6;
  /** OpenGL ES 1.1 constant. */
  int GL_PROJECTION_MATRIX                    = 0x0BA7;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_MATRIX                       = 0x0BA8;
  /** OpenGL ES 1.1 constant. */
  int GL_ALPHA_TEST_FUNC                      = 0x0BC1;
  /** OpenGL ES 1.1 constant. */
  int GL_ALPHA_TEST_REF                       = 0x0BC2;
  /** OpenGL ES 1.1 constant. */
  int GL_BLEND_DST                            = 0x0BE0;
  /** OpenGL ES 1.1 constant. */
  int GL_BLEND_SRC                            = 0x0BE1;
  /** OpenGL ES 1.1 constant. */
  int GL_LOGIC_OP_MODE                        = 0x0BF0;
  /** OpenGL ES 1.1 constant. */
  int GL_SCISSOR_BOX                          = 0x0C10;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_CLEAR_VALUE                    = 0x0C22;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_WRITEMASK                      = 0x0C23;
  /** OpenGL ES 1.1 constant. */
  int GL_MAX_CLIP_PLANES                      = 0x0D32;
  /** OpenGL ES 1.1 constant. */
  int GL_POLYGON_OFFSET_UNITS                 = 0x2A00;
  /** OpenGL ES 1.1 constant. */
  int GL_POLYGON_OFFSET_FACTOR                = 0x8038;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_BINDING_2D                   = 0x8069;
  /** OpenGL ES 1.1 constant. */
  int GL_VERTEX_ARRAY_SIZE                    = 0x807A;
  /** OpenGL ES 1.1 constant. */
  int GL_VERTEX_ARRAY_TYPE                    = 0x807B;
  /** OpenGL ES 1.1 constant. */
  int GL_VERTEX_ARRAY_STRIDE                  = 0x807C;
  /** OpenGL ES 1.1 constant. */
  int GL_NORMAL_ARRAY_TYPE                    = 0x807E;
  /** OpenGL ES 1.1 constant. */
  int GL_NORMAL_ARRAY_STRIDE                  = 0x807F;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_ARRAY_SIZE                     = 0x8081;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_ARRAY_TYPE                     = 0x8082;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_ARRAY_STRIDE                   = 0x8083;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_COORD_ARRAY_SIZE             = 0x8088;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_COORD_ARRAY_TYPE             = 0x8089;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_COORD_ARRAY_STRIDE           = 0x808A;

  /** OpenGL ES 1.1 constant. */
  int GL_VERTEX_ARRAY_POINTER                 = 0x808E;
  /** OpenGL ES 1.1 constant. */
  int GL_NORMAL_ARRAY_POINTER                 = 0x808F;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_ARRAY_POINTER                  = 0x8090;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_COORD_ARRAY_POINTER          = 0x8092;

  /** OpenGL ES 1.1 constant. */
  int GL_SAMPLE_BUFFERS                       = 0x80A8;
  /** OpenGL ES 1.1 constant. */
  int GL_SAMPLES                              = 0x80A9;
  /** OpenGL ES 1.1 constant. */
  int GL_SAMPLE_COVERAGE_VALUE                = 0x80AA;
  /** OpenGL ES 1.1 constant. */
  int GL_SAMPLE_COVERAGE_INVERT               = 0x80AB;

  // HintTarget

  /** OpenGL ES 1.1 constant. */
  int GL_GENERATE_MIPMAP_HINT                 = 0x8192;

  // TextureParameterName

  /** OpenGL ES 1.1 constant. */
  int GL_GENERATE_MIPMAP                      = 0x8191;

  // TextureUnit

  /** OpenGL ES 1.1 constant. */
  int GL_ACTIVE_TEXTURE                       = 0x84E0;
  /** OpenGL ES 1.1 constant. */
  int GL_CLIENT_ACTIVE_TEXTURE                = 0x84E1;

  // Buffer Objects

  /** OpenGL ES 1.1 constant. */
  int GL_ARRAY_BUFFER                         = 0x8892;
  /** OpenGL ES 1.1 constant. */
  int GL_ELEMENT_ARRAY_BUFFER                 = 0x8893;

  /** OpenGL ES 1.1 constant. */
  int GL_ARRAY_BUFFER_BINDING                 = 0x8894;
  /** OpenGL ES 1.1 constant. */
  int GL_ELEMENT_ARRAY_BUFFER_BINDING         = 0x8895;
  /** OpenGL ES 1.1 constant. */
  int GL_VERTEX_ARRAY_BUFFER_BINDING          = 0x8896;
  /** OpenGL ES 1.1 constant. */
  int GL_NORMAL_ARRAY_BUFFER_BINDING          = 0x8897;
  /** OpenGL ES 1.1 constant. */
  int GL_COLOR_ARRAY_BUFFER_BINDING           = 0x8898;
  /** OpenGL ES 1.1 constant. */
  int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING   = 0x889A;

  /** OpenGL ES 1.1 constant. */
  int GL_STATIC_DRAW                          = 0x88E4;
  /** OpenGL ES 1.1 constant. */
  int GL_DYNAMIC_DRAW                         = 0x88E8;

  /** OpenGL ES 1.1 constant. */
  int GL_WRITE_ONLY                           = 0x88B9;

  /** OpenGL ES 1.1 constant. */
  int GL_BUFFER_SIZE                          = 0x8764;
  /** OpenGL ES 1.1 constant. */
  int GL_BUFFER_USAGE                         = 0x8765;
  /** OpenGL ES 1.1 constant. */
  int GL_BUFFER_ACCESS                        = 0x88BB;

  // Texture combine + dot3

  /** OpenGL ES 1.1 constant. */
  int GL_SUBTRACT                             = 0x84E7;
  /** OpenGL ES 1.1 constant. */
  int GL_COMBINE                              = 0x8570;
  /** OpenGL ES 1.1 constant. */
  int GL_COMBINE_RGB                          = 0x8571;
  /** OpenGL ES 1.1 constant. */
  int GL_COMBINE_ALPHA                        = 0x8572;
  /** OpenGL ES 1.1 constant. */
  int GL_RGB_SCALE                            = 0x8573;
  /** OpenGL ES 1.1 constant. */
  int GL_ADD_SIGNED                           = 0x8574;
  /** OpenGL ES 1.1 constant. */
  int GL_INTERPOLATE                          = 0x8575;
  /** OpenGL ES 1.1 constant. */
  int GL_CONSTANT                             = 0x8576;
  /** OpenGL ES 1.1 constant. */
  int GL_PRIMARY_COLOR                        = 0x8577;
  /** OpenGL ES 1.1 constant. */
  int GL_PREVIOUS                             = 0x8578;
  /** OpenGL ES 1.1 constant. */
  int GL_OPERAND0_RGB                         = 0x8590;
  /** OpenGL ES 1.1 constant. */
  int GL_OPERAND1_RGB                         = 0x8591;
  /** OpenGL ES 1.1 constant. */
  int GL_OPERAND2_RGB                         = 0x8592;
  /** OpenGL ES 1.1 constant. */
  int GL_OPERAND0_ALPHA                       = 0x8598;
  /** OpenGL ES 1.1 constant. */
  int GL_OPERAND1_ALPHA                       = 0x8599;
  /** OpenGL ES 1.1 constant. */
  int GL_OPERAND2_ALPHA                       = 0x859A;

  /** OpenGL ES 1.1 constant. */
  int GL_ALPHA_SCALE                          = 0x0D1C;

  /** OpenGL ES 1.1 constant. */
  int GL_SRC0_RGB                             = 0x8580;
  /** OpenGL ES 1.1 constant. */
  int GL_SRC1_RGB                             = 0x8581;
  /** OpenGL ES 1.1 constant. */
  int GL_SRC2_RGB                             = 0x8582;
  /** OpenGL ES 1.1 constant. */
  int GL_SRC0_ALPHA                           = 0x8588;
  /** OpenGL ES 1.1 constant. */
  int GL_SRC1_ALPHA                           = 0x8589;
  /** OpenGL ES 1.1 constant. */
  int GL_SRC2_ALPHA                           = 0x858A;

  /** OpenGL ES 1.1 constant. */
  int GL_DOT3_RGB                             = 0x86AE;
  /** OpenGL ES 1.1 constant. */
  int GL_DOT3_RGBA                            = 0x86AF;

  // Functions

  // Buffers

  /**  
   * Generate buffer object names.
   *
   * <p><code>glGenBuffers</code> returns <code>n</code> buffer object
   * names in <code>buffers</code>.
   *
   * <p>These names are marked as used, for the purposes of
   * <code>glGenBuffers</code> only, but they acquire buffer state
   * only when they are first bound, just as if they were unused.
   *
   * <h4>Errors</h4>
   *
   * <p>GL_INVALID_VALUE is generated if <code>n</code> is negative.
   *
   * @param n Specifies the number of buffer object names to be generated.
   * @param buffers Specifies an array in which the generated buffer
   * object names are stored.
   * @param offset the starting offset within the
   * <code>buffers</code> array.
   *
   * @exception IllegalArgumentException if <code>buffers</code> is
   * <code>null</code>.
   * @exception IllegalArgumentException if <code>offset</code> is
   * less than 0.
   * @exception IllegalArgumentException if
   * <code>buffers.length - offset</code> is less than <code>n</code>.
   */
  void glGenBuffers(int n, int[] buffers, int offset);

  /**  
   * Integer <code>Buffer</code> version of
   * <code>glGenBuffers</code>.
   * 
   * @see #glGenBuffers(int n, int[] buffers, int offset)
   *
   * @exception IllegalArgumentException if <code>buffers</code> is
   * <code>null</code>.
   * @exception IllegalArgumentException if
   * <code>buffers.remaining()</code> is less than <code>n</code>.
   */
  void glGenBuffers(int n, IntBuffer buffers);

  /**  
   * Bind a named buffer to a target.
   *
   * <p><code>glBindBuffer</code> lets you create or use a named
   * buffer. Calling <code>glBindBuffer</code> with
   * <code>target</code> set to <code>GL_ARRAY_BUFFER</code> or
   * <code>GL_ELEMENT_ARRAY_BUFFER</code> and <code>buffer</code> set
   * to the buffer name, binds the buffer name to the target.
   *
   * <p>Buffer names are unsigned integers. The value 0 is reserved
   * for GL.
   *
   * <p>When a buffer is bound to a target, any previous binding for
   * that target is automatically broken.
   *
   * <p>If an unused buffer name is specified, a buffer object is
   * created. The resulting buffer object is a new state vector,
   * initialized with a zero-sized memory buffer, and with the
   * following state values.
   * 
   * <p><code>GL_BUFFER_SIZE</code> initialized to 0.
   * <p><code>GL_BUFFER_USAGE</code> initialized to
   * <code>GL_STATIC_DRAW</code>.
   * <p><code>GL_BUFFER_ACCESS</code>
   * initialized to <code>GL_WRITE_ONLY</code>.
   * <p><code>glBindBuffer</code> may also be used to bind an existing
   * buffer object. If the bind is successful no change is made to the
   * state of the newly bound buffer object.
   * 
   * <p>While a buffer is bound, GL operations on the target to which
   * it is bound affect the bound buffer object, and queries of the
   * target to which a buffer object is bound return state from the
   * bound object.
   * 
   * <h4>Notes</h4>
   * 
   * <p>In the initial state the reserved name zero is bound to
   * <code>GL_ARRAY_BUFFER</code> and
   * <code>GL_ELEMENT_ARRAY_BUFFER</code>. There is no buffer object
   * corresponding to the name zero, so client attempts to modify or
   * query buffer object state for the target
   * <code>GL_ARRAY_BUFFER</code> or
   * <code>GL_ELEMENT_ARRAY_BUFFER</code> while zero is bound will
   * generate GL errors.
   * 
   * <p>While a buffer object is bound, any GL operations on that
   * object affect any other bindings of that object.
   * 
   * <h4>Errors</h4>
   * 
   * <p><code>GL_INVALID_ENUM</code> is generated if
   * <code>target</code> is not one of the allowable values.
   * 
   * @param target Specifies the target to which the buffer is
   * bound. Which must be <code>GL_ARRAY_BUFFER</code> or
   * <code>GL_ELEMENT_ARRAY_BUFFER</code>.
   * @param buffer Specifies the name of a buffer.
   */
  void glBindBuffer(int target, int buffer);

  /**  
   * Creates and initializes the data store of a buffer object.
   *
   * <code>glBufferData</code> lets you create and initialize the data
   * store of a buffer object.
   * 
   * <p>If <code>data</code> is non-<code>null</code>, then the source
   * data is copied to the buffer object