方法1
首先到官网下载 ege:xege.org
接下来,设Dev-C++的位置为 %DevCpp%:
-
把 include 里的内容(ege 文件夹,ege.h,graphics.h)拷到 %DevCpp%\MinGW64\x86_64-w64-mingw32\include 里。
-
把 lib\devcpp 里的内容(两个.a)拷到 $DevCpp%\MinGW64\x86_64-w64-mingw32\lib 里。
-
打开 Dev-C++,在 Add the following commands when calling the linker 里加上:
-lgraphics64 -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm -lgdiplus- 用下面的代码测试你能不能用 ege。
#include <graphics.h>
int main() {
initgraph(640, 480);
getch();
closegraph();
return 0;
}-
如果你的屏幕上出现了一个黑框框,则说明你成功了,恭喜!
-
如果没有,那就把
-lgraphics64改成-lgraphics试一遍。
方法2
Red Panda C++ 是 Dev-C++ 的一个改进版,它支持诸多功能,如语法自动检查,CPEditor 主要功能等。
Red Panda C++ 预装了 ege 和 raylib(另一个开发游戏的库),因此对于 ege 学习十分方便。
Red Panda C++ 的官网:https://royqh1979.gitee.io/redpandacpp/
然后你可以新建xege项目,由于过于简单,所以不多赘述。
ege火车下一站:未开通
ege火车上一站:本站为起点站