summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.c b/main.c
index 0f5f4c7..b3824f4 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include <SDL2/SDL.h>
#define WINDOW_W 1280
@@ -46,6 +47,7 @@ int main() {
// TODO:
// - Map has a mask generated by the game, of where the terrain (foregroud) exists
+ float *mask = calloc(WINDOW_W * WINDOW_H, 4);
int exit = 0;
while (!exit) {
@@ -55,7 +57,13 @@ int main() {
exit = 1;
}
}
- SDL_RenderCopy(context, foreground, 0, 0);
+ SDL_RenderCopy(context, background, 0, 0);
+ SDL_SetRenderTarget(context, foreground);
+
+ // TODO: Get masking right
+ SDL_SetTextureBlendMode(mask_texture, SDL_BLENDMODE_MUL);
+ SDL_RenderCopy(context, mask_texture, 0, 0);
+ SDL_SetRenderTarget(context, 0);
SDL_RenderPresent(context);
SDL_Delay(10);