mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-05-09 18:09:46 +08:00
8bddf6bb37
- 移除SDL3依赖,引入IUP图形界面库 - 更新Makefile以支持IUP编译配置 - 重构GUI模块,移除SDL相关代码 - 更新全局变量和类型定义,移除SDL依赖 - 添加IUP头文件到项目库目录 - 删除手动帧率控制(SDL_Delay),依赖IUP事件循环 - 更新编译脚本和文档说明
69 lines
1.1 KiB
C
69 lines
1.1 KiB
C
/**
|
|
* @file gui.h
|
|
* @brief 图形化用户界面头文件
|
|
* @note 使用Raylib库实现五子棋的图形化界面
|
|
* @author 刘航宇
|
|
* @date 2025-01-15
|
|
*/
|
|
|
|
#ifndef GUI_H
|
|
#define GUI_H
|
|
|
|
#include "gobang.h"
|
|
#include "config.h"
|
|
#include "globals.h"
|
|
|
|
// GUI函数声明
|
|
|
|
/**
|
|
* @brief 初始化GUI
|
|
* @details 初始化Raylib图形库和游戏界面组件
|
|
* @return 成功返回0,失败返回-1
|
|
*/
|
|
int init_gui();
|
|
|
|
/**
|
|
* @brief 清理GUI资源
|
|
* @details 关闭窗口
|
|
*/
|
|
void cleanup_gui();
|
|
|
|
/**
|
|
* @brief 渲染游戏画面
|
|
* @details 完整的游戏画面渲染流程
|
|
*/
|
|
void render_game();
|
|
|
|
/**
|
|
* @brief 处理事件
|
|
* @details 处理所有Raylib事件并执行相应操作
|
|
* @return 继续运行返回1,退出返回0
|
|
*/
|
|
int handle_events();
|
|
|
|
/**
|
|
* @brief 绘制棋盘
|
|
*/
|
|
void draw_board();
|
|
|
|
/**
|
|
* @brief 绘制棋子
|
|
*/
|
|
void draw_stones();
|
|
|
|
/**
|
|
* @brief 绘制UI元素
|
|
*/
|
|
void draw_ui_elements();
|
|
|
|
/**
|
|
* @brief 屏幕坐标转棋盘坐标
|
|
*/
|
|
int screen_to_board(int screen_x, int screen_y, int *board_x, int *board_y);
|
|
|
|
/**
|
|
* @brief 显示消息
|
|
*/
|
|
void show_message(const char *message);
|
|
|
|
#endif // GUI_H
|