/******************************************************************************* * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.badlogic.gdx.graphics.glutils; import com.badlogic.gdx.graphics.VertexAttribute; import com.badlogic.gdx.graphics.VertexAttributes; /** <p> * A {@link VertexData} implementation based on OpenGL vertex buffer objects. * </p> * * <p> * If the OpenGL ES context was lost you can call {@link #invalidate()} to recreate a new OpenGL vertex buffer object. This class * can be used seamlessly with OpenGL ES 1.x and 2.0. * </p> * * <p> * In case OpenGL ES 2.0 is used in the application the data is bound via glVertexAttribPointer() according to the attribute * aliases specified via {@link VertexAttributes} in the constructor. * </p> * * <p> * Uses indirect Buffers on Android 1.5/1.6 to fix GC invocation due to leaking PlatformAddress instances. * </p> * * <p> * VertexBufferObjects must be disposed via the {@link #dispose()} method when no longer needed * </p> * * @author mzechner, Dave Clayton <contact@redskyforge.com> */ public class VertexArray extends VertexBufferObject { public VertexArray (int numVertices, VertexAttribute... attributes) { this(numVertices, new VertexAttributes(attributes)); } /** Constructs a new interleaved VertexArray * * @param numVertices the maximum number of vertices * @param attributes the {@link VertexAttributes} */ public VertexArray (int numVertices, VertexAttributes attributes) { super(false, numVertices, attributes); } }