在 C++ 中绘制形状的简单方法?
有没有非常简单的绘图库?我的字面意思是诸如 draw_circle(screen, x, y, r, color)
之类的函数或类似的函数。
我已经研究过 SDL,但它不支持我想要的开箱即用的功能 - 如果可能的话,我想要一些非常易于立即使用的东西。
Are there any drawing libraries out there that are really simple? I literally mean functions such as draw_circle(screen, x, y, r, colour)
or something similar.
I've taken a look at SDL but it doesn't support what I want out of the box - I would like something that is really easy to use straight away, if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能是 Allegro5。对于初学者来说,这很简单而且很棒。您可以简单地绘制形状和精灵。
Allegro5 网站
Probably Allegro5. It's easy and great for beginners. You can simply draw shapes and sprites.
Allegro5 Website
根据您的平台,您在这里有一些不同的选项。例如,如果您使用的是 Windows,则可以使用 Windows GDI 或 Direct2D。
但无论您使用哪个库,您都必须先处理窗口创建和设置,然后才能绘制某些内容。我认为SDL对于初学者来说是更简单的方法,而且它是跨平台的。查看此资源,了解如何使用 SDL 绘制圆圈的完整演示。
You have a few different options here, depending on your platform. If you are on Windows for instance, you could use Windows GDI or Direct2D.
But no matter what library you use, you'll have to deal with window creation and setup before being able to draw something. I think SDL is the easier way to go for beginners, besides, it's cross platform. Check this resource for a complete demo on how to draw circles using SDL.