aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-09-16 12:17:31 +0200
committerRaymaekers Luca <luca@spacehb.net>2025-09-16 12:17:31 +0200
commit753406922ee9d0001c9ecc4f5ea3f4fcaa077e38 (patch)
tree0f7b5345c484490c3e99e7f222d95da8b57ee54e
parent86fe424f46f21a59ae871bb68ad20c998fe11b4a (diff)
checkpoint
-rw-r--r--.gitmodules3
-rwxr-xr-xbuild/handmade.sobin263840 -> 263840 bytes
-rwxr-xr-xbuild/linux_handmadebin88272 -> 88528 bytes
-rw-r--r--code/handmade.cpp20
4 files changed, 13 insertions, 10 deletions
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index f2e64bf..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "code/libs/linuxhmh"]
- path = code/libs/linuxhmh
- url = git@autumn:linuxhmh
diff --git a/build/handmade.so b/build/handmade.so
index c9e6fde..9a1d827 100755
--- a/build/handmade.so
+++ b/build/handmade.so
Binary files differ
diff --git a/build/linux_handmade b/build/linux_handmade
index 609ac5e..6ee8550 100755
--- a/build/linux_handmade
+++ b/build/linux_handmade
Binary files differ
diff --git a/code/handmade.cpp b/code/handmade.cpp
index ca64c27..932215d 100644
--- a/code/handmade.cpp
+++ b/code/handmade.cpp
@@ -659,6 +659,7 @@ extern "C" GAME_UPDATE_AND_RENDER(GameUpdateAndRender)
InitFont(Thread, &GameState->RegularFont, Memory, "../data/fonts/jetbrains_mono_regular.ttf");
InitFont(Thread, &GameState->ItalicFont, Memory, "../data/fonts/jetbrains_mono_italic.ttf");
InitFont(Thread, &GameState->BoldFont, Memory, "../data/fonts/jetbrains_mono_bold.ttf");
+ // TODO(luca): Italic & Bold font.
GameState->SelectedColor = SquareColor_Yellow;
GameState->ExportedPatternIndex = 0;
@@ -1055,7 +1056,7 @@ extern "C" GAME_UPDATE_AND_RENDER(GameUpdateAndRender)
// NOTE(luca): Debug code for drawing inputted text.
#if 1
{
- r32 FontScale = stbtt_ScaleForPixelHeight(&DefaultFont.Info, 20.0f);
+ r32 FontScale = stbtt_ScaleForPixelHeight(&DefaultFont.Info, 22.0);
v2 Offset = {100.0f, 30.0f};
@@ -1091,6 +1092,16 @@ extern "C" GAME_UPDATE_AND_RENDER(GameUpdateAndRender)
DrawRectangle(Buffer, vMin + -1, vMax + 1, ColorBG);
}
+ // TODO(luca): Placeholder text when text is empty.
+ // Draw the text
+ {
+ DrawText(Buffer, &DefaultFont, FontScale,
+ GameState->TextInputCount, (u8 *)GameState->TextInputText,
+ Offset, ColorFG, true);
+
+ Assert(GameState->TextInputCount <= ArrayCount(GameState->TextInputText));
+ }
+
// Draw cursor
{
v2 vMin = {Offset.X + TextWidth, Offset.Y - Baseline};
@@ -1098,13 +1109,8 @@ extern "C" GAME_UPDATE_AND_RENDER(GameUpdateAndRender)
DrawRectangle(Buffer, vMin, vMax, ColorFG);
}
- // Draw the text
- DrawText(Buffer, &DefaultFont, FontScale,
- GameState->TextInputCount, (u8 *)GameState->TextInputText,
- Offset, ColorFG, true);
-
- Assert(GameState->TextInputCount <= ArrayCount(GameState->TextInputText));
}
+
#endif
}