双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

一个关于 turbo c 的绘图问题

Ghoststears Ghoststears 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
一直都在搞 C++ ,突然搞个 C 的绘图程序,用 TC 2.0 提供的绘图库,测试进入绘图模式,一直失败,不知道是怎么回事。请大家帮我看看。测试代码:


#include <graphics.h>
#include <stdio.h>
#include <conio.h>


main()
{
int gmode = -1;
int gdriver = -1;
int init_result = -1;

initgraph( &gmode, &gdriver, "d:\\bgi" );

init_result = graphresult();
if (grOk != init_result)
{
printf("init error, the error code is: %d", init_result);
getch();
return -1;
}
else
{
printf( "graph init OK.\n" );
printf( "graph driver is: %d, graph mode is: %d\n", gdriver, gmode);
}

getch();
return 0;
}


运行结果:
init error, the error code is: -2

我的 BGI 放在 D:\BGI 目录下,里面的文件:
ATT.BGI
CGA.BGI
EGAVGA.BGI
HERC.BGI
IBM8514.BGI
PC3270.BGI

我机子的显卡是:NVIDIA AUadro NVS 140M。

另外,还想问问大家,C 语言的绘图库还有那些比较好用的。最好可以直接加的 VS 中就可以用的。
TC 那个编辑界面真的是太不方便了。
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
Ghoststears
C语言 70,039 成员 243,237 内容