Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
GlUtil

Class GlUtil

Hierarchy

java.lang.Object

Package
com.android.grafika.gles

Overview

Some OpenGL utility functions.

Fields

IDENTITY_MATRIX

public static final float IDENTITY_MATRIX

Methods

createProgram( String vertexSource, String fragmentSource )

Creates a new program from the supplied vertex and fragment shaders.

public static int createProgram(String vertexSource,String fragmentSource)

Method Parameters

vertexSource
fragmentSource

loadShader( int shaderType, String source )

Compiles the provided shader source.

public static int loadShader(int shaderType,String source)

Method Parameters

shaderType
source

checkGlError( String op )

Checks to see if a GLES error has been raised.

public static void checkGlError(String op)

Method Parameters

op

checkLocation( int location, String label )

Checks to see if the location we obtained is valid. GLES returns -1 if a label could not be found, but does not set the GL error.

Throws a RuntimeException if the location is invalid.

public static void checkLocation(int location,String label)

Method Parameters

location
label

createImageTexture( ByteBuffer data, int width, int height, int format )

Creates a texture from raw data.

public static int createImageTexture(ByteBuffer data,int width,int height,int format)

Method Parameters

data
Image data, in a "direct" ByteBuffer.
width
Texture width, in pixels (not bytes).
height
Texture height, in pixels.
format
Image data format (use constant appropriate for glTexImage2D(), e.g. GL_RGBA).

createFloatBuffer( float[] coords )

Allocates a direct float buffer, and populates it with the float array data.

public static java.nio.FloatBuffer createFloatBuffer(float[] coords)

Method Parameters

coords

logVersionInfo()

Writes GL version info to the log.

public static void logVersionInfo()

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section