补充错误日志
This commit is contained in:
parent
9dfc4f2fed
commit
755fe590a1
@ -87,9 +87,9 @@ void dx_window::begin_frame() {
|
|||||||
context.draw_rounded_rectangle({ 100, 100 }, { 200, 200 }, { 1, 0, 0, 1 }, radius);
|
context.draw_rounded_rectangle({ 100, 100 }, { 200, 200 }, { 1, 0, 0, 1 }, radius);
|
||||||
|
|
||||||
auto height = sin(get_total_time().count()) * 100;
|
auto height = sin(get_total_time().count()) * 100;
|
||||||
context.draw_line({ 600, 600 - height }, { 700, 600 + height }, { 0, 0, 1, 1 }, 0.1);
|
context.draw_line({ 600, 600 - height }, { 700, 600 + height }, { 0, 0, 1, 1 }, 0.5);
|
||||||
|
|
||||||
context.draw_texture({0, 0}, test_texture->size(), test_texture);
|
if (test_texture) context.draw_texture({ 0, 0 }, test_texture->size(), test_texture);
|
||||||
|
|
||||||
context.flush();
|
context.flush();
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "renderer_texture.h"
|
#include "renderer_texture.h"
|
||||||
#include "core/window/renderer_window.h"
|
#include "core/window/renderer_window.h"
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
#define STBI_FAILURE_USERMSG
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
|
|
||||||
#if DX_BACKEND
|
#if DX_BACKEND
|
||||||
@ -24,12 +25,12 @@ void renderer::destroy_texture(renderer_texture* texture) { delete texture; }
|
|||||||
|
|
||||||
renderer_texture* renderer::load_image(const std::string& file_path, texture_format in_format) {
|
renderer_texture* renderer::load_image(const std::string& file_path, texture_format in_format) {
|
||||||
int width, height, channels;
|
int width, height, channels;
|
||||||
auto result = stbi_load(file_path.c_str(), &width, &height, &channels, 0);
|
const auto result = stbi_load(file_path.c_str(), &width, &height, &channels, 0);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
spdlog::critical("Failed to load image: {0}", file_path);
|
const char* reason = stbi_failure_reason();
|
||||||
|
spdlog::critical("加载图片 {0} 失败: {1}", file_path, reason);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int target_channel_count = get_format_channel_count(in_format);
|
int target_channel_count = get_format_channel_count(in_format);
|
||||||
unsigned int row_pitch = 0;
|
unsigned int row_pitch = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user