Added unproject
Broken and buggy font stuff Fixed some typos Fixed draw rect not using dim properly
This commit is contained in:
29
code/first.c
29
code/first.c
@@ -5,6 +5,12 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION 1
|
||||
#include <stb_image.h>
|
||||
|
||||
#define STB_RECT_PACK_IMPLEMENTATION 1
|
||||
#include <stb_rect_pack.h>
|
||||
|
||||
#define STB_TRUETYPE_IMPLEMENTATION 1
|
||||
#include <stb_truetype.h>
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/types.h"
|
||||
#include "game/npc.h"
|
||||
@@ -44,6 +50,7 @@ int main(int argc, char **argv) {
|
||||
game = M_ArenaPush(arena, G_State);
|
||||
|
||||
game->arena = arena;
|
||||
game->draw.arena = arena;
|
||||
|
||||
G_ImagesLoad(game);
|
||||
G_PipelinesLoad(game);
|
||||
@@ -99,6 +106,24 @@ int main(int argc, char **argv) {
|
||||
{
|
||||
running = false;
|
||||
}
|
||||
else if (e.type == SDL_EVENT_KEY_DOWN) {
|
||||
if (e.key.key == SDLK_W) {
|
||||
game->camera.p.y -= 0.2f;
|
||||
}
|
||||
|
||||
if (e.key.key == SDLK_S) {
|
||||
game->camera.p.y += 0.2f;
|
||||
}
|
||||
|
||||
if (e.key.key == SDLK_A) {
|
||||
game->camera.p.x -= 0.2f;
|
||||
}
|
||||
|
||||
if (e.key.key == SDLK_D) {
|
||||
game->camera.p.x += 0.2f;
|
||||
}
|
||||
}
|
||||
|
||||
ProcessEvents(&e, &world);
|
||||
}
|
||||
|
||||
@@ -140,10 +165,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
D_Begin(&game->draw, frame, D_MAX_RECTS);
|
||||
|
||||
D_Rect(&game->draw, 0.0f, 0.0f, .texture = 1);
|
||||
D_Rect(&game->draw, -8.0f, 0.0f, .texture = 2, .scale = 2.0f);
|
||||
D_Rect(&game->draw, 6.0f, 0.0f, .texture = 3);
|
||||
|
||||
D_End(&game->draw, frame);
|
||||
|
||||
vk.CmdEndRendering(cmd);
|
||||
|
||||
Reference in New Issue
Block a user