# xmake-sdl-test **Repository Path**: dzlua/xmake-sdl-test ## Basic Information - **Project Name**: xmake-sdl-test - **Description**: 维护SDL2(有修改),测试跨平台使用SDL,使用xmake编译。 - **Primary Language**: C++ - **License**: Zlib - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-06-03 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #xmake-sdl-test 使用xmake编译([http://git.oschina.net/dzlua/xmake](http://git.oschina.net/dzlua/xmake)) ``` 1、命令行进入到xmake.lua目录 2、编译:xmake 3、运行:xmake run test_sdl 本SDL库基于SDL2.0.4 编译SDL库 linux: 一、编译SDL2库: 1、安装SDL依赖 #sudo apt-get install libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev #sudo apt-get install fcitx-libs-dev fcitx (输入法fcitx支持) #sudo apt-get install libibus libdbus (输入法ibus支持) 2、生成配置、配置、编译、安装 #cd external/SDL2/ --#./autogen.sh #./configure #make #sudo make install 二、编译SDL2_ttf库 1、首先编译安装依赖库freetype #cd external/SDL2/erternal/freetype/ #./configure #make #sudo make install 2、编译SDL2_ttf库(接上边命令) #cd external/SDL2/ #./configure #make #sudo make install 三、编译测试项目test_sdl,使用xmake编译 1、配置 #cd (本项目根目录) #xmake f -c 2、编译 #xmake -r 3、添加环境变量,否则可能找不到库 #export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH #sudo ldconfig 4、运行 #xmake r test_sdl 说明:linux使用本库设置输入法时有两种ibus和fcitx 1、默认使用fctix,使用ibus请设置环境变量$SDL_IM_MODULE=ibus 2、设置:ubuntu下 系统设置->语言->最下边有下拉框选择是fcitx或者ibus 搜狗输入法使用的输入法框架是fcitx 更新说明 二、更新时间: 一、更新时间:2016/06/07 1、修改windows平台下输入法,支持输入法的输入,有候选框 2、修改linux平台下输入法,有候选框 1>、支持ibus(SDL2原生,未修改) 2>、支持fcitx(例如搜狗) 说明:默认使用fcitx(原生默认使用ibus)。 如果想使用ibux,添加环境变量:$SDL_IM_MODULE=ibus