We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
Allegro 或 SDL 库可能适合您。
我还建议不要使用 Bloodshed Dev-C++,因为它也有点过时了。您可以使用 MS VC++ Express 或Code::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.
看看 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.
如果您正在寻找“现代”和“没有太多样板”,为什么不是 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 asetPixel
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.
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.
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.