Added filesystem stuff on Linux
More includes for Linux Update build script to copy assets and compile shaders Added base code directory as include path Added FS_SystemPath Made asset loading work directory agnostic
This commit is contained in:
12
code/first.c
12
code/first.c
@@ -32,6 +32,7 @@ int main(int argc, char **argv) {
|
||||
Vk_Setup(window);
|
||||
|
||||
G_State *game = 0;
|
||||
G_Image *img = 0;
|
||||
{
|
||||
M_Arena *arena = M_ArenaAlloc(GB(64), .initial = MB(4));
|
||||
game = M_ArenaPush(arena, G_State);
|
||||
@@ -41,6 +42,15 @@ int main(int argc, char **argv) {
|
||||
G_ImagesLoad(game);
|
||||
G_PipelinesLoad(game);
|
||||
|
||||
for (U32 it = 0; it < game->n_images; ++it) {
|
||||
if (Str8_Equal(game->images[it].name, S("saloon_ext"), 0)) {
|
||||
img = &game->images[it];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!img) { img = &game->images[0]; }
|
||||
|
||||
Vk_Buffer *vbo = &game->vbo;
|
||||
vbo->size = KB(4096);
|
||||
vbo->usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
|
||||
@@ -126,7 +136,7 @@ int main(int argc, char **argv) {
|
||||
vbo_info.range = 256;
|
||||
|
||||
VkDescriptorImageInfo image_info = { 0 };
|
||||
image_info.imageView = game->images[6].image.view;
|
||||
image_info.imageView = img->image.view;
|
||||
image_info.sampler = vk.sampler;
|
||||
image_info.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user