public interface ResourceManager
| 限定符和类型 | 接口 | 说明 |
|---|---|---|
static interface |
ResourceManager.ResourceInfo |
Provides methods of obtaining the URI, name, and resource handle of a resource.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
copyDataToImage(GpuResourceHandle destination,
ByteBuffer data,
int width,
int height) |
Copies CPU data into a GPU image.
|
int |
createExternalTextureOes() |
Creates an external OES texture.
|
ResourceHandle |
createMaterial(String uri,
String name) |
Creates a material with a specified URI and name.
|
ResourceHandle |
createMesh(String uri,
String name,
MeshBuilder meshBuilder) |
Creates a mesh.
|
Optional<AnimationPlayback> |
createPlayback(ResourceHandle animationHandle,
SceneNode node) |
Creates an animation playback object that can control the animation state.
|
RenderDataStorePod |
createRenderDataStorePod(String name) |
Creates a generic render data store for data of plain old data (POD) types.
|
GpuResourceHandle |
createTexture(String name,
int width,
int height,
ImageFormat format) |
Creates a texture based on the image name, width, height, and format.
|
GpuResourceHandle |
createTexture(String name,
String imageUri) |
Creates a texture based on the image name and URI.
|
GpuResourceHandle |
createTextureViewOes(String name,
int width,
int height,
int textureId) |
Creates a texture view wrapping an external OpenGL ES (OES) texture.
|
GpuResourceHandle |
createUniformRingBuffer(String name,
int byteSize) |
Creates a uniform GPU buffer.
|
void |
deleteExternalTextureOes(int textureId) |
Deletes a specified external OES texture.
|
List<ResourceManager.ResourceInfo> |
getAnimations() |
Obtains all animation resources.
|
GpuResourceHandle |
getEmptyGpuResourceHandle() |
Obtains an empty GPU resource handle.
|
ResourceHandle |
getEmptyResourceHandle() |
Obtains an empty resource handle.
|
List<ResourceManager.ResourceInfo> |
getImages() |
Obtains all image resources.
|
Optional<MaterialDesc> |
getMaterialDesc(ResourceHandle resource) |
Obtains a material descriptor using a specified handle.
|
List<ResourceManager.ResourceInfo> |
getMaterials() |
Obtains all material resources.
|
Optional<MeshDesc> |
getMeshDesc(ResourceHandle resource) |
Obtains a mesh descriptor using a specified handle.
|
List<ResourceManager.ResourceInfo> |
getMeshes() |
Obtains all mesh resources.
|
Optional<RenderDataStorePod> |
getRenderDataStorePod(String name) |
Obtains a generic render data store created for data of POD types using a specified data store name.
|
ResourceHandle |
getResourceHandle(String uri) |
Obtains a resource handle using a specified URI.
|
List<ResourceManager.ResourceInfo> |
getResources() |
Obtains all resources.
|
List<ResourceManager.ResourceInfo> |
getSkins() |
Obtains all skin resources.
|
void |
setMaterialDesc(ResourceHandle resource,
MaterialDesc materialDesc) |
Sets a material descriptor using a specified handle.
|
void |
updateBuffer(GpuResourceHandle buffer,
ByteBuffer data) |
Updates the contents of a specified dynamic GPU buffer.
|
List<ResourceManager.ResourceInfo> getResources()
ResourceInfo objects for all resources.List<ResourceManager.ResourceInfo> getMaterials()
ResourceInfo objects for all materials.List<ResourceManager.ResourceInfo> getMeshes()
ResourceInfo objects for all meshes.List<ResourceManager.ResourceInfo> getAnimations()
ResourceInfo objects for all animations.List<ResourceManager.ResourceInfo> getSkins()
ResourceInfo objects for all skins.List<ResourceManager.ResourceInfo> getImages()
ResourceInfo objects for all images.ResourceHandle getEmptyResourceHandle()
ResourceHandle getResourceHandle(String uri)
uri - Indicates the unique identifier of a resource.ResourceHandle createMaterial(String uri, String name)
uri - Indicates the unique identifier of the new material.name - Indicates the material name to set.Optional<MaterialDesc> getMaterialDesc(ResourceHandle resource)
resource - Indicates the resource handle to the material.Optional object otherwise.void setMaterialDesc(ResourceHandle resource, MaterialDesc materialDesc)
resource - Indicates the resource handle to the material.materialDesc - Indicates the material descriptor to set.ResourceHandle createMesh(String uri, String name, MeshBuilder meshBuilder)
uri - Indicates the unique identifier of the new mesh.name - Indicates the mesh name to set.meshBuilder - Indicates the data of the new mesh.Optional<MeshDesc> getMeshDesc(ResourceHandle resource)
resource - Indicates the resource handle to the mesh.Optional object otherwise.GpuResourceHandle getEmptyGpuResourceHandle()
GpuResourceHandle createTexture(String name, String imageUri)
name - Indicates the image name to set.imageUri - Indicates the URI of the image.GpuResourceHandle createTexture(String name, int width, int height, ImageFormat format)
name - Indicates the image name to set.width - Indicates the width of the texture.height - Indicates the height of the texture.format - Indicates the format of the texture.void copyDataToImage(GpuResourceHandle destination, ByteBuffer data, int width, int height)
destination - Indicates the GPU resource handle to the destination image.data - Indicates the data to copy.width - Indicates the width of the image.height - Indicates the height of the image.GpuResourceHandle createTextureViewOes(String name, int width, int height, int textureId)
name - Indicates the name of the texture.width - Indicates the width of the texture.height - Indicates the height of the texture.textureId - Indicates the OES texture ID.GpuResourceHandle createUniformRingBuffer(String name, int byteSize)
updateBuffer(ohos.agp.render.render3d.resources.GpuResourceHandle,java.nio.ByteBuffer)
to update contents in the buffer.name - Indicates the name of the buffer to create.byteSize - Indicates the size of the buffer, in bytes.void updateBuffer(GpuResourceHandle buffer, ByteBuffer data)
buffer - Indicates the handle to the GPU buffer whose contents are to be updated.data - Indicates the data to update.int createExternalTextureOes()
void deleteExternalTextureOes(int textureId)
textureId - Indicates the external OES texture ID.RenderDataStorePod createRenderDataStorePod(String name)
name - Indicates the name of the data store to create.RenderDataStorePod object.Optional<RenderDataStorePod> getRenderDataStorePod(String name)
name - Indicates the name of the data store.Optional object otherwise.Optional<AnimationPlayback> createPlayback(ResourceHandle animationHandle, SceneNode node)
animationHandle - Indicates the handle to the animation resource.node - Indicates the node where the animation is to be added.AnimationPlayback object if any;
returns an empty Optional object otherwise.