Files
lity3d/Engine/Editor/editor_2d.h
T
shuiyu1123 2d56cb3bc9 MiMoEngine ASM: x86-64 MASM汇编+C混合架构游戏引擎
核心热路径(数学/内存/字符串/性能分析)用MASM汇编(SSE/AVX2)
外围系统(窗口/渲染/ECS/音频/UI/脚本)用C语言
含自研编辑器、VisualScript积木编程、中文渲染(glyph_atlas)
2026-07-10 19:20:40 +08:00

36 lines
986 B
C

#pragma once
#include <d3d11.h>
#include <stdint.h>
#include "../Rendering/shader.h"
#include "../Rendering/mesh.h"
#define ED2D_MAX_QUADS 8192
typedef struct {
float x, y, z;
float nx, ny, nz;
float u, v;
float r, g, b, a;
} Ed2DVert;
typedef struct {
Shader* shader;
ID3D11Buffer* vb;
ID3D11Buffer* ib;
ID3D11BlendState* blend;
ID3D11DepthStencilState* ds_no_depth;
ID3D11RenderTargetView* rtv;
Ed2DVert* verts;
int quad_count;
float screen_w;
float screen_h;
float wvp[16];
} Editor2D;
int editor2d_init(Editor2D* e, ID3D11Device* dev);
void editor2d_destroy(Editor2D* e);
void editor2d_begin(Editor2D* e, float sw, float sh);
void editor2d_rect(Editor2D* e, float x, float y, float w, float h, float r, float g, float b, float a);
void editor2d_rect_border(Editor2D* e, float x, float y, float w, float h, float r, float g, float b, float a, float thickness);
void editor2d_end(Editor2D* e, ID3D11DeviceContext* ctx);