Graphics.h 的替代品

发布于 2024-11-27 09:16:45 字数 1539 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

她说她爱他 2024-12-04 09:16:45

AllegroSDL 库可能适合您。

我还建议不要使用 Bloodshed Dev-C++,因为它也有点过时了。您可以使用 MS VC++ ExpressCode::Blocks 两者都是免费的。

Allegro or SDL libraries may be for you.

I would also suggest not to use Bloodshed Dev-C++ as it is also a little outdated. You may use MS VC++ Express or Code::Blocks which are both free.

森林很绿却致人迷途 2024-12-04 09:16:45

看看 Cinder。它是一个专为“创意编码”而设计的 C++ 库,看起来使用起来非常简单,但仍然很强大(查看示例)。

您也可以尝试 SFML。它拥有相当多的追随者,如果您遇到任何麻烦,您将有一个庞大的社区为您提供支持。

Take a look at Cinder. It's a C++ library designed for 'creative coding' and looks pretty simple to use while still being powerful (check the examples).

You could also try SFML. It has quite a following and you'll have a large community behind you should you have any trouble.

一袭白衣梦中忆 2024-12-04 09:16:45

如果您正在寻找“现代”和“没有太多样板”,为什么不是 JavaScript 呢?它将直接在浏览器中运行,您可以使用 元素,也可以在提供给学生的脚本中捆绑 setPixel DOM 函数。

您可以查看以下链接: http://www.codeproject.com/KB/脚本/javascriptlinedrawing.aspx

还有一个问题:Javascript 中的 Bresenham 算法

如果您致力于 C++,那么总会有 OpenGL,但我认为学习曲线要​​长一些。过去有 BGI 和 DJGPP 的 GRX(还有人记得那个吗?)。我不知道有多少独立于设备的库用于将像素写入屏幕(GDI 和 Xlib 太特定于操作系统)。在 Perl/Python/Tcl 世界中,有 Tk,它与操作系统无关。

就我个人而言,我喜欢使用 JavaScript 来实现低级图形算法——无需设置! -- 但如果您不依赖 C++,那么它可能值得一看。但如果你没有时间教授 JavaScript,那么也许你的一些学生可以实现一些算法来获得额外的学分。

If you are looking for "modern" and "not much boilerplate" why not JavaScript? It will run directly in the browser and you can either use a <canvas> element or bundle up a setPixel DOM function in a script you supply to your students.

Here's a link you can look at: http://www.codeproject.com/KB/scripting/javascriptlinedrawing.aspx.

And a SO question: Bresenham algorithm in Javascript.

If you are committed to C++, there is always OpenGL but there is, I suppose a bit more of a learning curve. In the old days there was BGI, and GRX for DJGPP (anyone remember that?). I don't know of many device-independent libraries for writing pixels to the screen (GDI and Xlib are too OS-specific). In the Perl/Python/Tcl world there is Tk, which is O.S. independent.

Personally I like JavaScript for low-level graphics algorithms -- no setup! -- but if you are not tied to C++ it might be worth a look. But if you don't have time to teach JavaScript then perhaps some of your students can implement some algorithms for extra credit.

蝶…霜飞 2024-12-04 09:16:45

SDL 是您最好的选择。我无法让 Graphics.h 与 Dev C++ 一起使用,因为较新版本的 Windows 与它不兼容。如果您只想绘制窗口和 UI 内容,另一个可能有效的图形库是 GLFW

SDL is your best bet. I could not get graphics.h to work with Dev C++ as newer versions of Windows are incompatible with it. Another graphics library that might work is GLFW, if all you want is to draw windows and UI stuff.

萌逼全场 2024-12-04 09:16:45

https://easyx.cn/

该库与 BGI(Borland Graphics Interface) API 兼容,这意味着它使用“ Graphics.h") 用于 Visual Studio。

https://easyx.cn/

this library is API compatible with BGI(Borland Graphics Interface, which means it uses "graphics.h") for Visual Studio.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文