Package org.oscim.renderer
Class GLUtils
java.lang.Object
org.oscim.renderer.GLUtils
Utility functions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeSaturation(float[] color, float change) public-domain function by Darel Rex Finley from http://alienryderflex.com/saturation.htmlstatic intCheck the status of current framebuffer.static voidcheckGlError(String op) Check GL error.static booleancheckGlError(String op, int id) Check GL error.checkGlErrors(String op) Check GL errors.static float[]colorToFloat(int color) static float[]colorToFloatP(int color) static StringgetFramebufferStatusString(int status) static StringgetGlErrorString(int error) static voidglDeleteBuffers(int num, int[] ids) static voidglDeleteFrameBuffers(int num, int[] ids) static voidglDeleteRenderBuffers(int num, int[] ids) static voidglDeleteTextures(int num, int[] ids) static voidglDrawBuffers(int num, int[] glEnum) Specifies a list of color buffers to be drawn into.static int[]glGenBuffers(int num) static int[]glGenFrameBuffers(int num) static int[]glGenRenderBuffers(int num) static int[]glGenTextures(int num) static voidglUniform3fv(int location, int count, float[] val) static voidglUniform4fv(int location, int count, float[] val) static intloadTexture(byte[] pixel, int width, int height, int format, int min_filter, int mag_filter, int wrap_s, int wrap_t) static voidsetColor(int handle, float[] c, float alpha) static voidsetColor(int location, int color) Set int color argb to uniform wxyz.static voidsetColor(int location, int color, float alpha) static voidsetColorBlend(int location, int color1, int color2, float mix) static voidsetTextureParameter(int min_filter, int mag_filter, int wrap_s, int wrap_t)
-
Constructor Details
-
GLUtils
public GLUtils()
-
-
Method Details
-
setColor
public static void setColor(int location, int color) Set int color argb to uniform wxyz. -
setColor
public static void setColor(int location, int color, float alpha) -
setColorBlend
public static void setColorBlend(int location, int color1, int color2, float mix) -
setTextureParameter
public static void setTextureParameter(int min_filter, int mag_filter, int wrap_s, int wrap_t) -
loadTexture
public static int loadTexture(byte[] pixel, int width, int height, int format, int min_filter, int mag_filter, int wrap_s, int wrap_t) -
checkFramebufferStatus
Check the status of current framebuffer. See: https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glCheckFramebufferStatus.xml- Parameters:
op- the operation which should be debugged- Returns:
- the status code
-
getFramebufferStatusString
- Parameters:
status- the status code of a framebuffer- Returns:
- the status code as string
-
checkGlError
Check GL error. See: https://www.khronos.org/opengl/wiki/OpenGL_Error- Parameters:
op- the operation which should be debugged
-
checkGlError
Check GL error. See: https://www.khronos.org/opengl/wiki/OpenGL_Error- Parameters:
op- the operation which should be debuggedid- the error to be found- Returns:
- true if error was found
-
checkGlErrors
Check GL errors. See: https://www.khronos.org/opengl/wiki/OpenGL_Error- Parameters:
op- the operation which should be debugged- Returns:
- the OpenGL error codes
-
getGlErrorString
- Parameters:
error- the error code of OpenGL- Returns:
- the error code as string
-
setColor
public static void setColor(int handle, float[] c, float alpha) -
colorToFloat
public static float[] colorToFloat(int color) -
colorToFloatP
public static float[] colorToFloatP(int color) -
changeSaturation
public static void changeSaturation(float[] color, float change) public-domain function by Darel Rex Finley from http://alienryderflex.com/saturation.html- Parameters:
color- The passed-in RGB values can be on any desired scale, such as 0 to 1, or 0 to 255.change- 0.0 creates a black-and-white image. 0.5 reduces the color saturation by half. 1.0 causes no change. 2.0 doubles the color saturation.
-
glUniform3fv
public static void glUniform3fv(int location, int count, float[] val) -
glUniform4fv
public static void glUniform4fv(int location, int count, float[] val) -
glGenBuffers
public static int[] glGenBuffers(int num) -
glDeleteBuffers
public static void glDeleteBuffers(int num, int[] ids) -
glGenFrameBuffers
public static int[] glGenFrameBuffers(int num) -
glDeleteFrameBuffers
public static void glDeleteFrameBuffers(int num, int[] ids) -
glGenRenderBuffers
public static int[] glGenRenderBuffers(int num) -
glDeleteRenderBuffers
public static void glDeleteRenderBuffers(int num, int[] ids) -
glGenTextures
public static int[] glGenTextures(int num) -
glDeleteTextures
public static void glDeleteTextures(int num, int[] ids) -
glDrawBuffers
public static void glDrawBuffers(int num, int[] glEnum) Specifies a list of color buffers to be drawn into.- Parameters:
num- Specifies the number of buffers in bufs.glEnum- Points to an array of symbolic constants specifying the buffers into which fragment colors or data values will be written.
-