Minor cleanup and texture update
This commit is contained in:
1 parent
2d230d7280
commit
3bd14b20c2
9 files changed
+8
-16
No files matched your search
@@ -25,17 +25,6 @@ function(compile_shader)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Replace CMAKE_IMAGE_MAX_COUNT in both source file and shader
|
|
||||||
# TODO: Please do better
|
|
||||||
file(READ src/rse_vulkan_image.c FILE_CONTENTS)
|
|
||||||
string(REPLACE "<CMAKE_IMAGE_MAX_COUNT>" "1" FILE_CONTENTS "${FILE_CONTENTS}")
|
|
||||||
file(WRITE src/rse_vulkan_image.c "${FILE_CONTENTS}")
|
|
||||||
|
|
||||||
file(READ shaders/shader.frag FILE_CONTENTS)
|
|
||||||
string(REPLACE "<CMAKE_IMAGE_MAX_COUNT>" "1" FILE_CONTENTS "${FILE_CONTENTS}")
|
|
||||||
file(WRITE src/shaders/shader.frag "${FILE_CONTENTS}")
|
|
||||||
|
|
||||||
|
|
||||||
compile_shader(rse_graphics
|
compile_shader(rse_graphics
|
||||||
ENV opengl
|
ENV opengl
|
||||||
FORMAT num
|
FORMAT num
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -36,7 +36,7 @@ void rse_graphics_test_function(void)
|
|||||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||||
uint16_t tex_id_2 = 0;
|
uint16_t tex_id_2 = 0;
|
||||||
|
|
||||||
status = rse_load_texture("../../test_image.png", &tex_id_2);
|
status = rse_load_texture("../../test_image.jpg", &tex_id_2);
|
||||||
if (status != RSE_ERROR_NO_ERROR) {
|
if (status != RSE_ERROR_NO_ERROR) {
|
||||||
LOGE("Failed to do something. Check error messages");
|
LOGE("Failed to do something. Check error messages");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const char* g_enabled_instance_layers_names[] = {"VK_LAYER_KHRONOS_validation"};
|
|||||||
#else
|
#else
|
||||||
#define ENABLED_EXTENSIONS_COUT 3
|
#define ENABLED_EXTENSIONS_COUT 3
|
||||||
#define ENABLED_INSTANCE_LAYERS_COUNT 0
|
#define ENABLED_INSTANCE_LAYERS_COUNT 0
|
||||||
const char* g_enabled_instance_layers_names = {};
|
const char* g_enabled_instance_layers_names[] = {};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* g_enabled_instance_extensions_names[ENABLED_EXTENSIONS_COUT] = {};
|
const char* g_enabled_instance_extensions_names[ENABLED_EXTENSIONS_COUT] = {};
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.0 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 522 B |
@@ -179,5 +179,5 @@ TestSuite(rse_textures);
|
|||||||
|
|
||||||
Test(rse_textures, load_png_image)
|
Test(rse_textures, load_png_image)
|
||||||
{
|
{
|
||||||
rse_load_texture("../../miotacz_piorunów.png");
|
rse_load_texture("../../test_image.jpg");
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,10 @@ void rse_read_file(const char* file_name, long* bytes_count, char* buffer)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(buffer, *bytes_count, 1, file);
|
if (fread(buffer, *bytes_count, 1, file)) {
|
||||||
|
perror("Empty file read");
|
||||||
|
}
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,4 +32,4 @@ void rse_write_to_file(const char* file_name, long bytes_count, char* buffer)
|
|||||||
|
|
||||||
fwrite(buffer, bytes_count, 1, file);
|
fwrite(buffer, bytes_count, 1, file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user