(
images: Array<{ file: File; name: string }>,
onProgress?: (progress: number) => void
)
| 186 | * This caches resized bitmaps, not actual GPU textures. |
| 187 | */ |
| 188 | export async function prefetchFrustumTextures( |
| 189 | images: Array<{ file: File; name: string }>, |
| 190 | onProgress?: (progress: number) => void |
| 191 | ): Promise<void> { |
| 192 | if (images.length === 0) { |
| 193 | onProgress?.(1); |
| 194 | return; |
| 195 | } |
| 196 | |
| 197 | let completed = 0; |
| 198 | for (const { file, name } of images) { |
| 199 | await loadFrustumBitmapFromFile(file, name); |
| 200 | completed++; |
| 201 | onProgress?.(completed / images.length); |
| 202 | } |
| 203 | notifyFrustumTextureCacheChanged(); |
| 204 | } |
| 205 | |
| 206 | export interface BackgroundFrustumTexturePrefetchOptions { |
| 207 | batchSize?: number; |
nothing calls this directly
no test coverage detected