Compare commits

...

3 Commits

Author SHA1 Message Date
Michael Savage
73c0126a9d
Merge 5e1e807358 into 982ade4cf9 2025-03-18 01:18:04 +01:00
Nic Barker
982ade4cf9 [Compilers] Add a dummy function to suppress unused variable warning in GCC
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
2025-03-18 11:21:23 +13:00
Michael Savage
5e1e807358 [Core] Make Clay_ImageElementConfig::imageData a pointer to const 2025-03-17 11:58:40 +00:00

8
clay.h
View File

@ -102,6 +102,10 @@
static uint8_t CLAY__ELEMENT_DEFINITION_LATCH;
// GCC marks the above CLAY__ELEMENT_DEFINITION_LATCH as an unused variable for files that include clay.h but don't declare any layout
// This is to suppress that warning
static inline void Clay__SuppressUnusedLatchDefinitionVariableWarning(void) { (void) CLAY__ELEMENT_DEFINITION_LATCH; }
// Publicly visible layout element macros -----------------------------------------------------
/* This macro looks scary on the surface, but is actually quite simple.
@ -392,7 +396,7 @@ CLAY__WRAPPER_STRUCT(Clay_TextElementConfig);
// Controls various settings related to image elements.
typedef struct {
void* imageData; // A transparent pointer used to pass image data through to the renderer.
const void* imageData; // A transparent pointer used to pass image data through to the renderer.
Clay_Dimensions sourceDimensions; // The original dimensions of the source image, used to control aspect ratio.
} Clay_ImageElementConfig;
@ -556,7 +560,7 @@ typedef struct {
// The original dimensions of the source image, used to control aspect ratio.
Clay_Dimensions sourceDimensions;
// A pointer transparently passed through from the original element definition, typically used to represent image data.
void* imageData;
const void* imageData;
} Clay_ImageRenderData;
// Render command data when commandType == CLAY_RENDER_COMMAND_TYPE_CUSTOM