代码整理
This commit is contained in:
@@ -20,33 +20,12 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
{
|
||||
font_face_t face;
|
||||
face.load_from_file(L"C:\\Windows\\Fonts\\segmdl2.ttf");
|
||||
face.load_from_file(L"C:/Windows/Fonts/segmdl2.ttf");
|
||||
auto name = face.get_font_name();
|
||||
auto color = face.supports_color_emoji();
|
||||
}
|
||||
|
||||
auto ii = std::make_shared<texture2d>();
|
||||
|
||||
{
|
||||
auto file = mapped_file::create();
|
||||
file->map_file(L"Z:/Root/Local/NanakoDisk/涩图/可爱偷猴计划/蕾米莉亚 & 芙兰朵露/1712938522333.jpg");
|
||||
stb_image_loader image_loader;
|
||||
image_loader.init(file->get_data(), file->get_size());
|
||||
const auto& heap = image_loader.load();
|
||||
|
||||
texture2d_data data;
|
||||
data.pixel_format = heap->info.get_pixel_format();
|
||||
data.size = { heap->info.width, heap->info.height };
|
||||
data.data_ptr = heap->data;
|
||||
|
||||
ii->create(data);
|
||||
}
|
||||
{
|
||||
auto map = ii->map(texture_map_type::read);
|
||||
}
|
||||
|
||||
auto image2 = std::make_shared<mimage>();
|
||||
image2->set_image(ii);
|
||||
image2->set_sampler(sampler_type::linear_clamp);
|
||||
|
||||
const auto& window = mwindow::create({ 800, 600 }, L"Hello, World!");
|
||||
|
||||
Reference in New Issue
Block a user