[Renderers/Raylib] Convert Image usage to Texture (#266)

This commit is contained in:
Thomas Anderson 2025-02-16 13:56:26 -06:00 committed by GitHub
parent 47c8e9178e
commit 28a8f59733
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View file

@ -1240,7 +1240,7 @@ Used to perform **aspect ratio scaling** on the image element. As of this versio
```C
// Load an image somewhere in your code
Image profilePicture = LoadImage("profilePicture.png");
YourImage profilePicture = LoadYourImage("profilePicture.png");
// Note that when rendering, .imageData will be void* type.
CLAY({ .image = { .imageData = &profilePicture, .sourceDimensions = { 60, 60 } } }) {}
```
@ -1249,7 +1249,7 @@ CLAY({ .image = { .imageData = &profilePicture, .sourceDimensions = { 60, 60 } }
```C
// Load an image somewhere in your code
Image profilePicture = LoadImage("profilePicture.png");
YourImage profilePicture = LoadYourImage("profilePicture.png");
// Declare a reusable image config
Clay_ImageElementConfig imageConfig = (Clay_ImageElementConfig) { .imageData = &profilePicture, .sourceDimensions = {60, 60} };
// Declare an image element using a reusable config
@ -1257,7 +1257,7 @@ CLAY({ .image = imageConfig }) {}
// Declare an image element using an inline config
CLAY({ .image = { .imageData = &profilePicture, .sourceDimensions = {60, 60} } }) {}
// Rendering example
Image *imageToRender = renderCommand->elementConfig.imageElementConfig->imageData;
YourImage *imageToRender = renderCommand->elementConfig.imageElementConfig->imageData;
```
**Rendering**