Commit 7b58b89
committed
Add RTT (Render-to-Texture) support for RmlUi GridView
This enables 3D model previews for units/features without buildpics
in RmlUi mode, using OpenGL texture rendering.
RTT Implementation:
- Updated _UpdateRmlUiGrid() to handle both file paths and texture IDs
* String paths: regular image files (adjusted for LuaUI/ prefix)
* Number IDs: OpenGL textures using ":t{id}" format
* Table objects: extract texture ID from texID/id fields
- item.SetImage() now triggers grid refresh when texture changes
- item.Invalidate() triggers grid refresh for RTT updates
- Added throttling to prevent excessive DOM updates (max 10 FPS)
* Schedules delayed update if called too frequently
* Prevents performance issues from rapid RTT invalidations
The existing RTT rendering code (gl.CreateTexture, gl.RenderToTexture)
works identically in both modes since it's pure OpenGL. The only change
needed was to support texture ID references in RmlUi <img> tags.
Assumes RmlUi supports Spring's ":t<textureID>" format for OpenGL
texture references in image src attributes.1 parent 5605e26 commit 7b58b89
1 file changed
+45
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
| |||
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
277 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
278 | 288 | | |
279 | 289 | | |
280 | 290 | | |
| |||
403 | 413 | | |
404 | 414 | | |
405 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
406 | 435 | | |
407 | 436 | | |
408 | 437 | | |
| |||
427 | 456 | | |
428 | 457 | | |
429 | 458 | | |
430 | | - | |
431 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
432 | 474 | | |
433 | | - | |
434 | 475 | | |
435 | 476 | | |
436 | 477 | | |
| |||
0 commit comments