public final class GLHelper
extends java.lang.Object
| Constructor and Description |
|---|
GLHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkGlError(javax.microedition.khronos.opengles.GL10 gl,
java.lang.String op)
OpenGL|ESのエラーをチェックしてlogCatに出力する
|
static void |
checkGlError(java.lang.String op)
OpenGL|ESのエラーをチェックしてlogCatに出力する
|
static void |
checkLocation(int location,
java.lang.String label)
Checks to see if the location we obtained is valid.
|
static int |
createTextureWithTextContent(java.lang.String text) |
static void |
deleteTex(javax.microedition.khronos.opengles.GL10 gl,
int hTex)
delete specific texture
|
static void |
deleteTex(int hTex)
delete specific texture
|
static java.lang.String |
gluErrorString(int error)
Return an error string from a GL or GLU error code.
|
static void |
gluLookAt(float eyeX,
float eyeY,
float eyeZ,
float centerX,
float centerY,
float centerZ,
float upX,
float upY,
float upZ)
Define a viewing transformation in terms of an eye point, a center of
view, and an up vector.
|
static void |
gluOrtho2D(float left,
float right,
float bottom,
float top)
Set up a 2D orthographic projection matrix
|
static void |
gluPerspective(float fovy,
float aspect,
float zNear,
float zFar)
Set up a perspective projection matrix
|
static int |
gluProject(float objX,
float objY,
float objZ,
float[] model,
int modelOffset,
float[] project,
int projectOffset,
int[] view,
int viewOffset,
float[] win,
int winOffset)
Map object coordinates into window coordinates. gluProject transforms the
specified object coordinates into window coordinates using model, proj,
and view.
|
static int |
gluUnProject(float winX,
float winY,
float winZ,
float[] model,
int modelOffset,
float[] project,
int projectOffset,
int[] view,
int viewOffset,
float[] obj,
int objOffset)
Map window coordinates to object coordinates. gluUnProject maps the
specified window coordinates into object coordinates using model, proj,
and view.
|
static int |
initTex(javax.microedition.khronos.opengles.GL10 gl,
int texTarget,
int filter_param)
テクスチャ名を生成(GL_TEXTURE0のみ)
|
static int |
initTex(int texTarget,
int filter_param)
テクスチャ名を生成, テクスチャユニットはGL_TEXTURE0, クランプ方法はGL_CLAMP_TO_EDGE
|
static int |
initTex(int texTarget,
int texUnit,
int min_filter,
int mag_filter,
int wrap)
テクスチャ名を生成
|
static int |
loadTextureFromResource(android.content.Context context,
int resId) |
static void |
logVersionInfo()
Writes GL version info to the log.
|
public static void checkGlError(java.lang.String op)
op - public static void checkGlError(javax.microedition.khronos.opengles.GL10 gl,
java.lang.String op)
gl - op - public static int initTex(int texTarget,
int filter_param)
texTarget - filter_param - テクスチャの補完方法を指定, min/mag共に同じ値になる, GL_LINEARとかGL_NEARESTpublic static int initTex(int texTarget,
int texUnit,
int min_filter,
int mag_filter,
int wrap)
texTarget - texUnit - テクスチャユニット, GL_TEXTURE0...GL_TEXTURE31min_filter - テクスチャの補間方法を指定, GL_LINEARとかGL_NEARESTmag_filter - テクスチャの補間方法を指定, GL_LINEARとかGL_NEARESTwrap - テクスチャのクランプ方法, GL_CLAMP_TO_EDGEpublic static int initTex(javax.microedition.khronos.opengles.GL10 gl,
int texTarget,
int filter_param)
gl - texTarget - filter_param - テクスチャの補間方法を指定 GL_LINEARとかGL_NEARESTpublic static void deleteTex(int hTex)
public static void deleteTex(javax.microedition.khronos.opengles.GL10 gl,
int hTex)
public static int loadTextureFromResource(android.content.Context context,
int resId)
public static int createTextureWithTextContent(java.lang.String text)
public static void checkLocation(int location,
java.lang.String label)
Throws a RuntimeException if the location is invalid.
public static void logVersionInfo()
public static java.lang.String gluErrorString(int error)
error - - a GL or GLU error code.public static void gluLookAt(float eyeX,
float eyeY,
float eyeZ,
float centerX,
float centerY,
float centerZ,
float upX,
float upY,
float upZ)
eyeX - eye point XeyeY - eye point YeyeZ - eye point ZcenterX - center of view XcenterY - center of view YcenterZ - center of view ZupX - up vector XupY - up vector YupZ - up vector Zpublic static void gluOrtho2D(float left,
float right,
float bottom,
float top)
left - right - bottom - top - public static void gluPerspective(float fovy,
float aspect,
float zNear,
float zFar)
fovy - specifies the field of view angle, in degrees, in the Y
direction.aspect - specifies the aspect ration that determins the field of
view in the x direction. The aspect ratio is the ratio of x
(width) to y (height).zNear - specifies the distance from the viewer to the near clipping
plane (always positive).zFar - specifies the distance from the viewer to the far clipping
plane (always positive).public static int gluProject(float objX,
float objY,
float objZ,
float[] model,
int modelOffset,
float[] project,
int projectOffset,
int[] view,
int viewOffset,
float[] win,
int winOffset)
Note that you can use the OES_matrix_get extension, if present, to get the current modelView and projection matrices.
objX - object coordinates XobjY - object coordinates YobjZ - object coordinates Zmodel - the current modelview matrixmodelOffset - the offset into the model array where the modelview
maxtrix data starts.project - the current projection matrixprojectOffset - the offset into the project array where the project
matrix data starts.view - the current view, {x, y, width, height}viewOffset - the offset into the view array where the view vector
data starts.win - the output vector {winX, winY, winZ}, that returns the
computed window coordinates.winOffset - the offset into the win array where the win vector data
starts.public static int gluUnProject(float winX,
float winY,
float winZ,
float[] model,
int modelOffset,
float[] project,
int projectOffset,
int[] view,
int viewOffset,
float[] obj,
int objOffset)
Note that you can use the OES_matrix_get extension, if present, to get the current modelView and projection matrices.
winX - window coordinates XwinY - window coordinates YwinZ - window coordinates Zmodel - the current modelview matrixmodelOffset - the offset into the model array where the modelview
maxtrix data starts.project - the current projection matrixprojectOffset - the offset into the project array where the project
matrix data starts.view - the current view, {x, y, width, height}viewOffset - the offset into the view array where the view vector
data starts.obj - the output vector {objX, objY, objZ}, that returns the
computed object coordinates.objOffset - the offset into the obj array where the obj vector data
starts.