fixing issue with swapchain recreation

This commit is contained in:
Kbz-8
2024-01-16 07:19:27 +01:00
parent 575ee21c7a
commit a832c3ca40
550 changed files with 102 additions and 115 deletions

0
.github/dependabot.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.github/workflows/fetch_dependencies.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.github/workflows/greetings.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.github/workflows/linux_clang.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.github/workflows/linux_gcc.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.github/workflows/macos_x86.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.github/workflows/windows.yml vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
.gitignore vendored git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
CONTRIBUTING.md git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
LICENSE git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
Makefile git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
README.md git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
XMAKE_BUILD.md git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
compile_commands.json git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
example/42_logo.bmp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

0
example/42_logo.jpg git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
example/42_logo.png git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

0
example/font.ttf git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

153
example/main.c git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

@@ -6,155 +6,160 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
/* Updated: 2024/01/11 20:09:56 by maldavid ### ########.fr */
/* Updated: 2024/01/16 06:41:48 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <string.h>
#include "../includes/mlx.h"
typedef struct s_mlx
typedef struct
{
void *mlx;
void *win;
void *logo_png;
void *logo_jpg;
void *logo_bmp;
void *img;
} t_mlx;
void* mlx;
void* win;
void* logo_png;
void* logo_jpg;
void* logo_bmp;
void* img;
} mlx_t;
int update(void *param)
int update(void* param)
{
static int i = 0;
int j;
int k;
t_mlx *mlx;
mlx_t* mlx = (mlx_t*)param;
mlx = (t_mlx *)param;
mlx_set_font_scale(mlx->mlx, mlx->win, "default", 6.f);
mlx_string_put(mlx->mlx, mlx->win, 160, 120, 0xFFFF2066, "this text should be hidden");
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_png, 100, 100);
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_jpg, 210, 150);
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_bmp, 220, 40);
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->img, 150, 60);
if (i == 0)
mlx_set_font_scale(mlx->mlx, mlx->win, "font.ttf", 16.f);
mlx_string_put(mlx->mlx, mlx->win, 20, 50, 0xFFFFFFFF, "that's a text");
j = 0;
k = 0;
while (j++ < 400)
int color = 0;
for(int j = 0; j < 400; j++)
{
mlx_pixel_put(mlx->mlx, mlx->win, j, j, 0xFFFF0000 + k);
mlx_pixel_put(mlx->mlx, mlx->win, j, j, 0xFFFF0000 + color);
mlx_pixel_put(mlx->mlx, mlx->win, 399 - j, j, 0xFF0000FF);
k += (k < 255);
color += (color < 255);
}
if (++i == 5000)
if(++i == 5000)
mlx_clear_window(mlx->mlx, mlx->win);
if (i == 7000)
if(i == 7000)
mlx_set_font_scale(mlx->mlx, mlx->win, "default", 16.f);
return (0);
return 0;
}
void *create_image(t_mlx *mlx)
void* create_image(mlx_t* mlx)
{
unsigned char pixel[4];
int i[3];
void *img;
memset(i, 0, sizeof(int) * 3);
img = mlx_new_image(mlx->mlx, 100, 100);
while (i[0] < (100 * 100) * 4)
void* img = mlx_new_image(mlx->mlx, 100, 100);
for(int i = 0, j = 0, k = 0; i < (100 * 100) * 4; i += 4, j++)
{
if (i[0] < 10000 || i[0] > 20000)
if(j >= 100)
{
pixel[0] = i[0];
pixel[1] = i[1];
pixel[2] = i[2];
j = 0;
k++;
}
if(i < 10000 || i > 20000)
{
pixel[0] = i;
pixel[1] = j;
pixel[2] = k;
pixel[3] = 0x99;
mlx_set_image_pixel(mlx->mlx, img, i[1], i[2], *((int *)pixel));
}
i[0] += 4;
i[1]++;
if (i[1] >= 100)
{
i[1] = 0;
i[2]++;
mlx_set_image_pixel(mlx->mlx, img, j, k, *((int *)pixel));
}
}
return (img);
return img;
}
int key_hook(int key, void *param)
int key_hook(int key, void* param)
{
int x;
int y;
mlx_t* mlx = (mlx_t*)param;
mlx_mouse_get_pos(((t_mlx *)param)->mlx, &x, &y);
switch (key)
mlx_mouse_get_pos(mlx->mlx, &x, &y);
switch(key)
{
case 41: // ESCAPE
mlx_loop_end(((t_mlx *)param)->mlx);
case 41 : // ESCAPE
mlx_loop_end(mlx->mlx);
break;
case 22: // (S)how
case 22 : // (S)how
mlx_mouse_show();
break;
case 11: // (H)ide
case 11 : // (H)ide
mlx_mouse_hide();
break;
case 6:// (C)lear
mlx_clear_window(((t_mlx *)param)->mlx, ((t_mlx *)param)->win);
case 6 : // (C)lear
mlx_clear_window(mlx->mlx, mlx->win);
break;
case 79: // RIGHT KEY
mlx_mouse_move(((t_mlx *)param)->mlx, ((t_mlx *)param)->win, x + 10, y);
case 79 : // RIGHT KEY
mlx_mouse_move(mlx->mlx, mlx->win, x + 10, y);
break;
case 80: // LEFT KEY
mlx_mouse_move(((t_mlx *)param)->mlx, ((t_mlx *)param)->win, x - 10, y);
case 80 : // LEFT KEY
mlx_mouse_move(mlx->mlx, mlx->win, x - 10, y);
break;
case 81: // UP KEY
mlx_mouse_move(((t_mlx *)param)->mlx, ((t_mlx *)param)->win, x, y + 10);
case 81 : // UP KEY
mlx_mouse_move(mlx->mlx, mlx->win, x, y + 10);
break;
case 82:// DOWN KEY
mlx_mouse_move(((t_mlx *)param)->mlx, ((t_mlx *)param)->win, x, y - 10);
case 82 : // DOWN KEY
mlx_mouse_move(mlx->mlx, mlx->win, x, y - 10);
break;
default : break;
}
return (0);
return 0;
}
int window_hook(int event, void *param)
int window_hook(int event, void* param)
{
if (event == 0)
mlx_loop_end(((t_mlx *)param)->mlx);
return (0);
if(event == 0)
mlx_loop_end(((mlx_t*)param)->mlx);
return 0;
}
int main(void)
{
t_mlx mlx;
mlx_t mlx;
int w;
int h;
int dummy;
mlx.mlx = mlx_init();
mlx.win = mlx_new_window(mlx.mlx, 400, 400, "My window");
mlx_on_event(mlx.mlx, mlx.win, MLX_KEYDOWN, key_hook, &mlx);
mlx_on_event(mlx.mlx, mlx.win, MLX_WINDOW_EVENT, window_hook, &mlx);
mlx.logo_png = mlx_png_file_to_image(mlx.mlx, "42_logo.png", &w, &h);
mlx.logo_bmp = mlx_bmp_file_to_image(mlx.mlx, "42_logo.bmp", &w, &h);
mlx.logo_jpg = mlx_jpg_file_to_image(mlx.mlx, "42_logo.jpg", &w, &h);
mlx.logo_png = mlx_png_file_to_image(mlx.mlx, "42_logo.png", &dummy, &dummy);
mlx.logo_bmp = mlx_bmp_file_to_image(mlx.mlx, "42_logo.bmp", &dummy, &dummy);
mlx.logo_jpg = mlx_jpg_file_to_image(mlx.mlx, "42_logo.jpg", &dummy, &dummy);
mlx_pixel_put(mlx.mlx, mlx.win, 200, 10, 0xFFFF00FF);
mlx_put_image_to_window(mlx.mlx, mlx.win, mlx.logo_png, 10, 190);
mlx.img = create_image(&mlx);
mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, \
"that text will disappear");
mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, "that text will disappear");
mlx_set_font_scale(mlx.mlx, mlx.win, "font.ttf", 16.f);
mlx_loop_hook(mlx.mlx, update, &mlx);
mlx_loop(mlx.mlx);
mlx_get_screens_size(mlx.mlx, &w, &h);
printf("screen size : %dx%d", w, h);
mlx_destroy_image(mlx.mlx, mlx.logo_png);
mlx_destroy_image(mlx.mlx, mlx.logo_jpg);
mlx_destroy_image(mlx.mlx, mlx.logo_bmp);
mlx_destroy_image(mlx.mlx, mlx.img);
mlx_destroy_window(mlx.mlx, mlx.win);
mlx_destroy_display(mlx.mlx);
return (0);
return 0;
}

0
includes/mlx.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
includes/mlx_profile.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
res/logo.png git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

0
res/screenshot_test.png git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
res/screenshot_test_windows.png git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
scripts/fetch_dependencies.sh git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/UUID.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/UUID.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/application.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/application.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/application.inl git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/bridge.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/errors.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/errors.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/graphics.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/graphics.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/graphics.inl git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/memory.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/memory.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/profiler.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/core/profiler.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/platform/inputs.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/platform/inputs.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/platform/window.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/platform/window.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_buffer.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_buffer.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_ibo.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_ubo.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_ubo.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_vbo.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/buffers/vk_vbo.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/cmd_manager.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/cmd_manager.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/single_time_cmd_manager.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/single_time_cmd_manager.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/vk_cmd_buffer.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/vk_cmd_buffer.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/vk_cmd_pool.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/command/vk_cmd_pool.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/cmd_resource.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/drawable_resource.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/memory.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/memory.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/render_core.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/render_core.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_device.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_device.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_fence.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_fence.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_instance.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_instance.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_queues.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_queues.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_semaphore.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_semaphore.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_surface.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_surface.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_validation_layers.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/core/vk_validation_layers.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/descriptors/vk_descriptor_pool.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/descriptors/vk_descriptor_pool.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/descriptors/vk_descriptor_set.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/descriptors/vk_descriptor_set.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/descriptors/vk_descriptor_set_layout.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/descriptors/vk_descriptor_set_layout.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/texture.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/texture.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/texture_atlas.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/texture_atlas.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/texture_descriptor.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/texture_manager.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/vk_image.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/images/vk_image.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/pipeline/pipeline.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/pipeline/pipeline.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/pixel_put.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/pixel_put.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

12
src/renderer/renderer.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/18 17:25:16 by maldavid #+# #+# */
/* Updated: 2024/01/10 14:18:35 by maldavid ### ########.fr */
/* Updated: 2024/01/16 07:14:19 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -83,6 +83,11 @@ namespace mlx
if(result == VK_ERROR_OUT_OF_DATE_KHR)
{
_swapchain.recreate();
_pass.destroy();
_pass.init(_swapchain.getImagesFormat(), VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
_framebuffers.clear();
for(std::size_t i = 0; i < _swapchain.getImagesNumber(); i++)
_framebuffers.emplace_back().init(_pass, _swapchain.getImage(i));
return false;
}
else if(result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR)
@@ -146,6 +151,11 @@ namespace mlx
{
_framebufferResized = false;
_swapchain.recreate();
_pass.destroy();
_pass.init(_swapchain.getImagesFormat(), VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
_framebuffers.clear();
for(std::size_t i = 0; i < _swapchain.getImagesNumber(); i++)
_framebuffers.emplace_back().init(_pass, _swapchain.getImage(i));
}
else if(result != VK_SUCCESS)
core::error::report(e_kind::fatal_error, "Vulkan error : failed to present swap chain image");

0
src/renderer/renderer.h git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

0
src/renderer/renderpass/vk_framebuffer.cpp git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

Some files were not shown because too many files have changed in this diff Show More