Compare commits

..

No commits in common. "456921e66bac3793c64ae8dfad0dd86964a1531e" and "1fe25fb235aab6cf1022ca0c158985596b0ce24e" have entirely different histories.

3 changed files with 15 additions and 16 deletions

View file

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

View file

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

View file

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