page.title=RenderScript Graphics Functions and Types @jd:body
The graphics subsystem of RenderScript was removed at API level 23.
Deprecated Types | |
---|---|
rs_blend_dst_func | Deprecated. Blend destination function |
rs_blend_src_func | Deprecated. Blend source function |
rs_cull_mode | Deprecated. Culling mode |
rs_depth_func | Deprecated. Depth function |
rs_font | Deprecated. Handle to a Font |
rs_mesh | Deprecated. Handle to a Mesh |
rs_primitive | Deprecated. How to intepret mesh vertex data |
rs_program_fragment | Deprecated. Handle to a ProgramFragment |
rs_program_raster | Deprecated. Handle to a ProgramRaster |
rs_program_store | Deprecated. Handle to a ProgramStore |
rs_program_vertex | Deprecated. Handle to a ProgramVertex |
Deprecated Functions | |
---|---|
rsgAllocationSyncAll | Deprecated. Sync the contents of an allocation |
rsgBindColorTarget | Deprecated. Set the color target |
rsgBindConstant | Deprecated. Bind a constant allocation |
rsgBindDepthTarget | Deprecated. Set the depth target |
rsgBindFont | Deprecated. Bind a font object |
rsgBindProgramFragment | Deprecated. Bind a ProgramFragment |
rsgBindProgramRaster | Deprecated. Bind a ProgramRaster |
rsgBindProgramStore | Deprecated. Bind a ProgramStore |
rsgBindProgramVertex | Deprecated. Bind a ProgramVertex |
rsgBindSampler | Deprecated. Bind a sampler |
rsgBindTexture | Deprecated. Bind a texture allocation |
rsgClearAllRenderTargets | Deprecated. Clear all color and depth targets |
rsgClearColor | Deprecated. Clear the specified color from the surface |
rsgClearColorTarget | Deprecated. Clear the color target |
rsgClearDepth | Deprecated. Clear the depth surface |
rsgClearDepthTarget | Deprecated. Clear the depth target |
rsgDrawMesh | Deprecated. Draw a mesh |
rsgDrawQuad | Deprecated. Draw a quad |
rsgDrawQuadTexCoords | Deprecated. Draw a textured quad |
rsgDrawRect | Deprecated. Draw a rectangle |
rsgDrawSpriteScreenspace | Deprecated. Draw rectangles in screenspace |
rsgDrawText | Deprecated. Draw a text string |
rsgFinish | Deprecated. End rendering commands |
rsgFontColor | Deprecated. Set the font color |
rsgGetHeight | Deprecated. Get the surface height |
rsgGetWidth | Deprecated. Get the surface width |
rsgMeasureText | Deprecated. Get the bounding box for a text string |
rsgMeshComputeBoundingBox | Deprecated. Compute a bounding box |
rsgMeshGetIndexAllocation | Deprecated. Return an allocation containing index data |
rsgMeshGetPrimitive | Deprecated. Return the primitive |
rsgMeshGetPrimitiveCount | Deprecated. Return the number of index sets |
rsgMeshGetVertexAllocation | Deprecated. Return a vertex allocation |
rsgMeshGetVertexAllocationCount | Deprecated. Return the number of vertex allocations |
rsgProgramFragmentConstantColor | Deprecated. Set the constant color for a fixed function emulation program |
rsgProgramRasterGetCullMode | Deprecated. Get program raster cull mode |
rsgProgramRasterIsPointSpriteEnabled | Deprecated. Get program raster point sprite state |
rsgProgramStoreGetBlendDstFunc | Deprecated. Get program store blend destination function |
rsgProgramStoreGetBlendSrcFunc | Deprecated. Get program store blend source function |
rsgProgramStoreGetDepthFunc | Deprecated. Get program store depth function |
rsgProgramStoreIsColorMaskAlphaEnabled | Deprecated. Get program store alpha component color mask |
rsgProgramStoreIsColorMaskBlueEnabled | Deprecated. Get program store blur component color mask |
rsgProgramStoreIsColorMaskGreenEnabled | Deprecated. Get program store green component color mask |
rsgProgramStoreIsColorMaskRedEnabled | Deprecated. Get program store red component color mask |
rsgProgramStoreIsDepthMaskEnabled | Deprecated. Get program store depth mask |
rsgProgramStoreIsDitherEnabled | Deprecated. Get program store dither state |
rsgProgramVertexGetProjectionMatrix | Deprecated. Get the projection matrix for a fixed function vertex program |
rsgProgramVertexLoadModelMatrix | Deprecated. Load the model matrix for a bound fixed function vertex program |
rsgProgramVertexLoadProjectionMatrix | Deprecated. Load the projection matrix for a bound fixed function vertex program |
rsgProgramVertexLoadTextureMatrix | Deprecated. Load the texture matrix for a bound fixed function vertex program |
An enum with the following values: When compiling for 32 bits. API level 16 - 22
RS_BLEND_DST_ZERO = 0 | |
---|---|
RS_BLEND_DST_ONE = 1 | |
RS_BLEND_DST_SRC_COLOR = 2 | |
RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3 | |
RS_BLEND_DST_SRC_ALPHA = 4 | |
RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5 | |
RS_BLEND_DST_DST_ALPHA = 6 | |
RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7 | |
RS_BLEND_DST_INVALID = 100 |
Deprecated. Do not use.
An enum with the following values: When compiling for 32 bits. API level 16 - 22
RS_BLEND_SRC_ZERO = 0 | |
---|---|
RS_BLEND_SRC_ONE = 1 | |
RS_BLEND_SRC_DST_COLOR = 2 | |
RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3 | |
RS_BLEND_SRC_SRC_ALPHA = 4 | |
RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5 | |
RS_BLEND_SRC_DST_ALPHA = 6 | |
RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7 | |
RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8 | |
RS_BLEND_SRC_INVALID = 100 |
Deprecated. Do not use.
An enum with the following values: When compiling for 32 bits. API level 16 - 22
RS_CULL_BACK = 0 | |
---|---|
RS_CULL_FRONT = 1 | |
RS_CULL_NONE = 2 | |
RS_CULL_INVALID = 100 |
Deprecated. Do not use.
An enum with the following values: When compiling for 32 bits. API level 16 - 22
RS_DEPTH_FUNC_ALWAYS = 0 | Always drawn |
---|---|
RS_DEPTH_FUNC_LESS = 1 | Drawn if the incoming depth value is less than that in the depth buffer |
RS_DEPTH_FUNC_LEQUAL = 2 | Drawn if the incoming depth value is less or equal to that in the depth buffer |
RS_DEPTH_FUNC_GREATER = 3 | Drawn if the incoming depth value is greater than that in the depth buffer |
RS_DEPTH_FUNC_GEQUAL = 4 | Drawn if the incoming depth value is greater or equal to that in the depth buffer |
RS_DEPTH_FUNC_EQUAL = 5 | Drawn if the incoming depth value is equal to that in the depth buffer |
RS_DEPTH_FUNC_NOTEQUAL = 6 | Drawn if the incoming depth value is not equal to that in the depth buffer |
RS_DEPTH_FUNC_INVALID = 100 | Invalid depth function |
Deprecated. Do not use.
Specifies conditional drawing depending on the comparison of the incoming depth to that found in the depth buffer.
When compiling for 32 bits. Removed from API level 23 and higher
Deprecated. Do not use.
Opaque handle to a RenderScript font object. See: android.renderscript.Font
When compiling for 32 bits. Removed from API level 23 and higher
Deprecated. Do not use.
Opaque handle to a RenderScript mesh object. See: android.renderscript.Mesh
An enum with the following values: When compiling for 32 bits. API level 16 - 22
RS_PRIMITIVE_POINT = 0 | Vertex data will be rendered as a series of points |
---|---|
RS_PRIMITIVE_LINE = 1 | Vertex pairs will be rendered as lines |
RS_PRIMITIVE_LINE_STRIP = 2 | Vertex data will be rendered as a connected line strip |
RS_PRIMITIVE_TRIANGLE = 3 | Vertices will be rendered as individual triangles |
RS_PRIMITIVE_TRIANGLE_STRIP = 4 | Vertices will be rendered as a connected triangle strip defined by the first three vertices with each additional triangle defined by a new vertex |
RS_PRIMITIVE_TRIANGLE_FAN = 5 | Vertices will be rendered as a sequence of triangles that all share first vertex as the origin |
RS_PRIMITIVE_INVALID = 100 | Invalid primitive |
Deprecated. Do not use.
Describes the way mesh vertex data is interpreted when rendering
When compiling for 32 bits. Removed from API level 23 and higher
Deprecated. Do not use.
Opaque handle to a RenderScript ProgramFragment object. See: android.renderscript.ProgramFragment
When compiling for 32 bits. Removed from API level 23 and higher
Deprecated. Do not use.
Opaque handle to a RenderScript ProgramRaster object. See: android.renderscript.ProgramRaster
When compiling for 32 bits. Removed from API level 23 and higher
Deprecated. Do not use.
Opaque handle to a RenderScript ProgramStore object. See: android.renderscript.ProgramStore
When compiling for 32 bits. Removed from API level 23 and higher
Deprecated. Do not use.
Opaque handle to a RenderScript ProgramVertex object. See: android.renderscript.ProgramVertex
void rsgAllocationSyncAll(rs_allocation alloc); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgAllocationSyncAll(rs_allocation alloc, rs_allocation_usage_type source); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Sync the contents of an allocation.
If the source is specified, sync from memory space specified by source.
If the source is not specified, sync from its SCRIPT memory space to its HW memory spaces.
void rsgBindColorTarget(rs_allocation colorTarget, uint slot); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Set the color target used for all subsequent rendering calls
void rsgBindConstant(rs_program_fragment ps, uint slot, rs_allocation c); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgBindConstant(rs_program_vertex pv, uint slot, rs_allocation c); | When compiling for 32 bits. Removed from API level 23 and higher |
ps | program fragment object |
---|---|
slot | index of the constant buffer on the program |
c | constants to bind |
pv | program vertex object |
Deprecated. Do not use.
Bind a new Allocation object to a ProgramFragment or ProgramVertex. The Allocation must be a valid constant input for the Program.
void rsgBindDepthTarget(rs_allocation depthTarget); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Set the depth target used for all subsequent rendering calls
void rsgBindFont(rs_font font); | When compiling for 32 bits. Removed from API level 23 and higher |
font | object to bind |
---|
Deprecated. Do not use.
Binds the font object to be used for all subsequent font rendering calls
void rsgBindProgramFragment(rs_program_fragment pf); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Bind a new ProgramFragment to the rendering context.
void rsgBindProgramRaster(rs_program_raster pr); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Bind a new ProgramRaster to the rendering context.
void rsgBindProgramStore(rs_program_store ps); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Bind a new ProgramStore to the rendering context.
void rsgBindProgramVertex(rs_program_vertex pv); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Bind a new ProgramVertex to the rendering context.
void rsgBindSampler(rs_program_fragment fragment, uint slot, rs_sampler sampler); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Bind a new Sampler object to a ProgramFragment. The sampler will operate on the texture bound at the matching slot.
void rsgBindTexture(rs_program_fragment v, uint slot, rs_allocation alloc); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Bind a new Allocation object to a ProgramFragment. The Allocation must be a valid texture for the Program. The sampling of the texture will be controled by the Sampler bound at the matching slot.
void rsgClearAllRenderTargets(); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Clear all color and depth targets and resume rendering into the framebuffer
void rsgClearColor(float r, float g, float b, float a); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Clears the rendering surface to the specified color.
void rsgClearColorTarget(uint slot); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Clear the previously set color target
void rsgClearDepth(float value); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Clears the depth suface to the specified value.
void rsgClearDepthTarget(); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Clear the previously set depth target
void rsgDrawMesh(rs_mesh ism); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgDrawMesh(rs_mesh ism, uint primitiveIndex); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len); | When compiling for 32 bits. Removed from API level 23 and higher |
ism | mesh object to render |
---|---|
primitiveIndex | for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. |
start | starting index in the range |
len | number of indices to draw |
Deprecated. Do not use.
Draw a mesh using the current context state.
If primitiveIndex is specified, draw part of a mesh using the current context state.
If start and len are also specified, draw specified index range of part of a mesh using the current context state.
Otherwise the whole mesh is rendered.
void rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Low performance utility function for drawing a simple quad. Not intended for drawing large quantities of geometry.
void rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Low performance utility function for drawing a textured quad. Not intended for drawing large quantities of geometry.
void rsgDrawRect(float x1, float y1, float x2, float y2, float z); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Low performance utility function for drawing a simple rectangle. Not intended for drawing large quantities of geometry.
void rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Low performance function for drawing rectangles in screenspace. This function uses the default passthough ProgramVertex. Any bound ProgramVertex is ignored. This function has considerable overhead and should not be used for drawing in shipping applications.
void rsgDrawText(const char* text, int x, int y); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgDrawText(rs_allocation alloc, int x, int y); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Draws text given a string and location
uint rsgFinish(); | When compiling for 32 bits. API level 14 - 22 |
Deprecated. Do not use.
Force RenderScript to finish all rendering commands
void rsgFontColor(float r, float g, float b, float a); | When compiling for 32 bits. Removed from API level 23 and higher |
r | red component |
---|---|
g | green component |
b | blue component |
a | alpha component |
Deprecated. Do not use.
Sets the font color for all subsequent rendering calls
uint rsgGetHeight(); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Get the height of the current rendering surface.
uint rsgGetWidth(); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Get the width of the current rendering surface.
void rsgMeasureText(const char* text, int* left, int* right, int* top, int* bottom); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgMeasureText(rs_allocation alloc, int* left, int* right, int* top, int* bottom); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Returns the bounding box of the text relative to (0, 0) Any of left, right, top, bottom could be NULL
void rsgMeshComputeBoundingBox(rs_mesh mesh, float* minX, float* minY, float* min, float* maxX, float* maxY, float* maxZ); | When compiling for 32 bits. Removed from API level 23 and higher |
void rsgMeshComputeBoundingBox(rs_mesh mesh, float3* bBoxMin, float3* bBoxMax); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Computes an axis aligned bounding box of a mesh object
rs_allocation rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index); | When compiling for 32 bits. API level 16 - 22 |
m | mesh to get data from |
---|---|
index | index of the index allocation |
allocation containing index data |
Deprecated. Do not use.
Returns an allocation containing index data or a null allocation if only the primitive is specified
rs_primitive rsgMeshGetPrimitive(rs_mesh m, uint32_t index); | When compiling for 32 bits. API level 16 - 22 |
m | mesh to get data from |
---|---|
index | index of the primitive |
primitive describing how the mesh is rendered |
Deprecated. Do not use.
Returns the primitive describing how a part of the mesh is rendered
uint32_t rsgMeshGetPrimitiveCount(rs_mesh m); | When compiling for 32 bits. API level 16 - 22 |
m | mesh to get data from |
---|
number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data |
Deprecated. Do not use.
Meshes could have multiple index sets, this function returns the number.
rs_allocation rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index); | When compiling for 32 bits. API level 16 - 22 |
m | mesh to get data from |
---|---|
index | index of the vertex allocation |
allocation containing vertex data |
Deprecated. Do not use.
Returns an allocation that is part of the mesh and contains vertex data, e.g. positions, normals, texcoords
uint32_t rsgMeshGetVertexAllocationCount(rs_mesh m); | When compiling for 32 bits. API level 16 - 22 |
m | mesh to get data from |
---|
number of allocations in the mesh that contain vertex data |
Deprecated. Do not use.
Returns the number of allocations in the mesh that contain vertex data
void rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a); | When compiling for 32 bits. Removed from API level 23 and higher |
Deprecated. Do not use.
Set the constant color for a fixed function emulation program.
rs_cull_mode rsgProgramRasterGetCullMode(rs_program_raster pr); | When compiling for 32 bits. API level 16 - 22 |
pr | program raster to query |
---|
Deprecated. Do not use.
Get program raster cull mode
bool rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr); | When compiling for 32 bits. API level 16 - 22 |
pr | program raster to query |
---|
Deprecated. Do not use.
Get program raster point sprite state
rs_blend_dst_func rsgProgramStoreGetBlendDstFunc(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store blend destination function
rs_blend_src_func rsgProgramStoreGetBlendSrcFunc(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store blend source function
rs_depth_func rsgProgramStoreGetDepthFunc(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store depth function
bool rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store alpha component color mask
bool rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store blur component color mask
bool rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store green component color mask
bool rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store red component color mask
bool rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store depth mask
bool rsgProgramStoreIsDitherEnabled(rs_program_store ps); | When compiling for 32 bits. API level 16 - 22 |
ps | program store to query |
---|
Deprecated. Do not use.
Get program store dither state
void rsgProgramVertexGetProjectionMatrix(rs_matrix4x4* proj); | When compiling for 32 bits. Removed from API level 23 and higher |
proj | matrix to store the current projection matrix into |
---|
Deprecated. Do not use.
Get the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
void rsgProgramVertexLoadModelMatrix(const rs_matrix4x4* model); | When compiling for 32 bits. Removed from API level 23 and higher |
model | model matrix |
---|
Deprecated. Do not use.
Load the model matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
void rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4* proj); | When compiling for 32 bits. Removed from API level 23 and higher |
proj | projection matrix |
---|
Deprecated. Do not use.
Load the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
void rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4* tex); | When compiling for 32 bits. Removed from API level 23 and higher |
tex | texture matrix |
---|
Deprecated. Do not use.
Load the texture matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.