https://github.com/matcool/gd-render-texture
custom render texture for gd, with an easy to use api
https://github.com/matcool/gd-render-texture
Last synced: over 1 year ago
JSON representation
custom render texture for gd, with an easy to use api
- Host: GitHub
- URL: https://github.com/matcool/gd-render-texture
- Owner: matcool
- License: mit
- Created: 2024-12-06T15:16:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-12T21:40:10.000Z (over 1 year ago)
- Last Synced: 2025-02-10T15:17:38.919Z (over 1 year ago)
- Language: C++
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gd-render-texture
Custom render texture class for GD, with an easy to use interface
```cpp
// can be reused and stored
RenderTexture render(1920, 1080);
std::uniqure_ptr data = render.captureData(scene /* format = RenderTexture::PixelFormat::RGBA */);
// IMPORTANT: image data is currently upside down, so you'll have to flip it yourself :P
// this may change in a future version
```
## use as a sprite
```cpp
auto m_sprite = RenderTexture(1920, 1080).intoManagedSprite();
this->addChild(m_sprite.sprite);
// on update() {
m_sprite.render.capture(this);
// sprite node will now show the new capture
```