summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform_win32.c16
-rw-r--r--sponge.h (renamed from softrender.h)16
2 files changed, 16 insertions, 16 deletions
diff --git a/platform_win32.c b/platform_win32.c
index 7ebd16c..06680e7 100644
--- a/platform_win32.c
+++ b/platform_win32.c
@@ -1,8 +1,8 @@
#define UNICODE
#include <windows.h>
-#define SOFTRENDER_IMPLEMENTATION
-#include "softrender.h"
+#define SPONGE_IMPLEMENTATION
+#include "sponge.h"
// TODO(kard): ofc some resizing stuff
#define WIDTH 256
@@ -27,7 +27,7 @@ int WinMain(
LPSTR lpCmdLine,
int nShowCmd
) {
- const wchar_t CLASS_NAME[] = L"softrender";
+ const wchar_t CLASS_NAME[] = L"sponge";
WNDCLASS wc = { 0 };
@@ -40,7 +40,7 @@ int WinMain(
HWND hwnd = CreateWindowEx(
0,
CLASS_NAME,
- L"softrender",
+ L"sponge",
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, // bla bla you can't resize window basically
CW_USEDEFAULT, CW_USEDEFAULT, WIDTH, HEIGHT,
NULL,
@@ -63,7 +63,7 @@ int WinMain(
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
- soft_Canvas canvas = {
+ sponge_Canvas canvas = {
.pixels = pixel_buffer,
.width = WIDTH,
.height = HEIGHT,
@@ -88,9 +88,9 @@ int WinMain(
// NOTE(kard): ACTUAL RENDERING CODE HERE !!!
- soft_clear(canvas, 0xFF000000);
- soft_draw_rect(canvas, 80, 70, 80 + 20, 70 + 40, 0xFFFF00FF);
- soft_draw_rect(canvas, 140, 70, 140 + 20, 70 + 40, 0xFFFF00FF);
+ sponge_clear(canvas, 0xFF000000);
+ sponge_draw_rect(canvas, 80, 70, 80 + 20, 70 + 40, 0xFFFF00FF);
+ sponge_draw_rect(canvas, 140, 70, 140 + 20, 70 + 40, 0xFFFF00FF);
HDC hdc = GetDC(hwnd);
diff --git a/softrender.h b/sponge.h
index e417ab2..dc50693 100644
--- a/softrender.h
+++ b/sponge.h
@@ -6,22 +6,22 @@ typedef struct {
uint32_t width;
uint32_t height;
uint32_t stride;
-} soft_Canvas;
+} sponge_Canvas;
-void soft_clear(soft_Canvas c, uint32_t color);
-void soft_draw_rect(soft_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t color);
+void sponge_clear(sponge_Canvas c, uint32_t color);
+void sponge_draw_rect(sponge_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t color);
// TODO(kard): prefix stripping
-#ifdef SOFTRENDER_IMPLEMENTATION
+#ifdef SPONGE_IMPLEMENTATION
-void soft_clear(soft_Canvas c, uint32_t color) {
- soft_draw_rect(c, 0, 0, c.width - 1, c.height - 1, color);
+void sponge_clear(sponge_Canvas c, uint32_t color) {
+ sponge_draw_rect(c, 0, 0, c.width - 1, c.height - 1, color);
}
// TODO(kard): probably bounds checking
// TODO(kard): alpha blending maybe
-void soft_draw_rect(soft_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t color) {
+void sponge_draw_rect(sponge_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t color) {
uint32_t *row = c.pixels + (y0 * c.stride);
for (uint32_t y = y0; y <= y1; y++, row += c.stride) {
@@ -31,5 +31,5 @@ void soft_draw_rect(soft_Canvas c, uint32_t x0, uint32_t y0, uint32_t x1, uint32
}
}
-#endif // SOFTRENDER_IMPLEMENTATION
+#endif // SPONGE_IMPLEMENTATION