njin
Engine 2D gọn nhẹ để tự tay làm game theo ý mình. Vibe coding cũng ổn luôn
Loading...
Searching...
No Matches
njin_atlas.h
1#pragma once
2#include "_types.h"
3#include "njin_draw.h"
4
5namespace njin {
6struct context;
7
10
22
35atlas_handle atlas_create(context &ctx, const atlas_desc &desc = {});
36
55texture_handle atlas_load(context &ctx, atlas_handle atlas, const char *path);
56
61void atlas_destroy(context &ctx, atlas_handle atlas);
63} // namespace njin
void atlas_destroy(context &ctx, atlas_handle atlas)
Hủy atlas: giải phóng các trang.
atlas_handle atlas_create(context &ctx, const atlas_desc &desc={})
Tạo một atlas: nơi ghép nhiều ảnh nhỏ vào một texture lớn.
texture_filter
Cách lấy mẫu khi texture bị co giãn.
Definition njin_draw.h:197
texture_handle atlas_load(context &ctx, atlas_handle atlas, const char *path)
Nạp một file ảnh và xếp vào atlas.
@ filter_linear
Làm mượt.
Definition njin_draw.h:199
std::int32_t i32
Số nguyên có dấu 32 bit.
Definition _types.h:14
Cách tạo một atlas, xem atlas_create().
Definition njin_atlas.h:12
i32 size
Cạnh của mỗi trang atlas, pixel.
Definition njin_atlas.h:15
i32 padding
Viền trống quanh mỗi ảnh, pixel: chép lại điểm ảnh ngoài cùng ra viền để ảnh không lem màu ảnh bên cạ...
Definition njin_atlas.h:18
texture_filter filter
Cách lấy mẫu của cả atlas. Mọi ảnh trong atlas dùng chung một bộ lọc.
Definition njin_atlas.h:20
Định danh của một atlas, tạo bởi atlas_create().
Definition _types.h:300
Định danh của một texture, tạo bởi texture_load().
Definition _types.h:146