Compare commits

...

4 commits

3 changed files with 16 additions and 15 deletions

View file

@ -8,7 +8,7 @@ project "Dice"
cdialect "c23"
location "build/"
files { "src/**.c" }
includedirs { "vendor/" }
includedirs { "include/" }
links { "m", "stdc++", "SDL3", "SDL3_ttf", "SDL3_image" }
buildoptions { "-Wall" }
targetdir "bin/"

View file

@ -52,8 +52,6 @@ static void SDL_Clay_RenderFillRoundedRect(Clay_SDL3RendererData *rendererData,
int totalVertices = 0;
for (int i = 0; i < 4; ++i) {
numCircleSegments[i] = SDL_clamp((int)radii[i] / 2, 1, NUM_CIRCLE_SEGMENTS);
SDL_Log("num segments %d: %d", i, numCircleSegments[i]);
SDL_Log("radius %d: %f", i, radii[i]);
totalVertices += numCircleSegments[i];
}
@ -152,7 +150,7 @@ void SDL_Clay_RenderClayCommands(Clay_SDL3RendererData *rendererData, Clay_Rende
Clay_RectangleRenderData *config = &rcmd->renderData.rectangle;
SDL_SetRenderDrawBlendMode(rendererData->renderer, SDL_BLENDMODE_BLEND);
SDL_SetRenderDrawColor(rendererData->renderer, config->backgroundColor.r, config->backgroundColor.g, config->backgroundColor.b, config->backgroundColor.a);
if (config->cornerRadius.topLeft > 0) {
if (config->cornerRadius.topLeft > 0 || config->cornerRadius.topRight > 0 || config->cornerRadius.bottomLeft > 0 || config->cornerRadius.bottomRight > 0) {
SDL_Clay_RenderFillRoundedRect(rendererData, rect, config->cornerRadius, config->backgroundColor);
} else {
SDL_RenderFillRect(rendererData->renderer, &rect);

View file

@ -3,24 +3,27 @@
#include <clay/clay.h>
constexpr float cornerRadius = 3.f;
constexpr Clay_CornerRadius cornerRadiusAll = CLAY_CORNER_RADIUS(cornerRadius);
constexpr float containerGap = 3.f;
constexpr float windowPadding = 0.f;
constexpr float cornerRadius = 20.f;
constexpr Clay_CornerRadius cornerRadiusAll = {
cornerRadius, cornerRadius,
cornerRadius, cornerRadius
};
constexpr float containerGap = 10.f;
constexpr float windowPadding = 10.f;
constexpr Clay_Color windowBackground = {
210, 210, 210, 255
255*0.35, 255*0.35, 255*0.35, 255
};
constexpr Clay_Color containerColors[] = {
{ 200, 200, 200, 255 },
{ 170, 170, 170, 255 },
{ 140, 140, 140, 255 },
{ 255*0.25, 255*0.25, 255*0.25, 255 },
{ 255*0.2, 255*0.2, 255*0.2, 255 },
{ 255*0.1, 255*0.1, 255*0.1, 255 },
};
constexpr Clay_Color textColors[] = {
{ 0, 0, 0, 255 },
{ 15, 15, 15, 255 },
{ 30, 30, 30, 255 },
{ 250, 250, 250, 255 },
{ 250, 250, 250, 255 },
{ 250, 250, 250, 255 },
};
constexpr Clay_Sizing layoutExpand = {