Files
lity3d/Engine/Window/window.h
T
shuiyu1123 0669d102ce feat: major engine overhaul - scene demo with lighting, sphere, ground
- Scene Demo: cube + sphere + ground plane with proper lighting
- Audio: XAudio2 dynamic loading + WAV playback
- Physics: expanded collision system
- Renderer: improved pipeline with materials
- UI: extended widget system
- VisualScript: enhanced serializer + block interactions
- ASM: optimized math/memory/profiling routines
- Window: mouse input + scroll support
2026-07-12 08:21:07 +08:00

48 lines
1.4 KiB
C

#pragma once
// ============================================================================
// window.h - Win32 窗口管理
// ============================================================================
#include <Windows.h>
// 窗口结构
typedef struct Window {
HWND hwnd;
int width;
int height;
int fullscreen;
int minimized;
const char* title;
} Window;
// 回调类型
typedef void (*WindowKeyCallback)(int key);
typedef void (*WindowResizeCallback)(int width, int height);
typedef void (*WindowMouseMoveCallback)(int x, int y);
typedef void (*WindowMouseButtonCallback)(int button, int pressed);
// 创建/销毁
Window* window_create(const char* title, int width, int height, int fullscreen);
void window_destroy(Window* window);
// 显示/隐藏
void window_show(Window* window);
void window_hide(Window* window);
// 消息处理
int window_process_messages(Window* window);
// 获取属性
int window_get_width(Window* window);
int window_get_height(Window* window);
HWND window_get_handle(Window* window);
int window_is_fullscreen(Window* window);
int window_is_minimized(Window* window);
// 设置回调
void window_set_key_callback(Window* window, WindowKeyCallback callback);
void window_set_resize_callback(Window* window, WindowResizeCallback callback);
void window_set_mouse_move_callback(Window* window, WindowMouseMoveCallback callback);
void window_set_mouse_button_callback(Window* window, WindowMouseButtonCallback callback);