C++ 图形库 [英] Graphics Library for C++

查看:28
本文介绍了C++ 图形库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 C++ 进行一个模拟项目,我需要以图形方式输出一些信息.我搜索了它并找到了一些库,但其中大多数只是做绘图或其他东西.还有像 EasyBMP 这样的库,可以用来创建位图图像或类似的图像格式.还有一些库,如 OpenGL、DirectX 和 SDL,它们允许硬件加速实时图形.我的问题是我需要一个实时的、硬件加速的图形库.作为这个领域的新手,我无法对 OpenGL 或 DirectX 之类的东西产生兴趣.我只需要做2D图形工作,所以我认为没有必要花时间学习OpenGL什么的.最好是跨平台的,但这不是必需的.如果您知道有关 SDL、OpenGL 或 DirectX 的一些很好的信息来源,我很高兴知道.

I am working on a simulation project in C++ and I need to output some information graphically. I searched about it and found some libraries, but most of them just do plotting or something. There are also libraries like EasyBMP, which can be used to create bitmap images or similar image formats. There are also some libraries like OpenGL, DirectX and SDL which allow hardware-accelerated real time graphics. My problem is that I need a library for real time, hardware accelerated graphics. As a newbie in this field, I can't make head or tail of something like OpenGL or DirectX. I only need to do 2D graphics work, so I don't think it's necessary to spend my time for learning OpenGL or something. It'd better be cross-platform, but that's not a necessity. If you know some good source of information on SDL or OpenGL or DirectX, I'd be glad to know about it.

PS:我的目标平台是 windows.

PS: My target platform is windows.

推荐答案

在主要侧重于统计数据建模的 10 周大学课程中学习了 OpenGL 的基础知识后,我肯定会认为 OpenGL 是一个合理的选择易于学习的用于 2D 实时建模的图形包.

Having learned the basics of OpenGL in a 10 week university course that was primarily focused on modeling statistical data, I would definitely think OpenGL would be a reasonable option for an easy to learn graphics package for 2D real time modeling.

尽管 OpenGL 确实有一些复杂性,但您不需要考虑所有这些不需要的功能,但制作带有图形屏幕的基本项目几乎是您不需要的所有样板代码理解得很好,您实际上可以从示例项目中复制和粘贴.例如,这里有一些示例程序,这些程序与 OpenGL 教科书一起使用.将整个库配置为项目的一部分只是在配置设置中的某个位置添加几个 .lib 文件的问题,让它做某事"不需要太多,然后你只需要熟悉一小部分功能,对我来说,这几乎比用 Java 绘制 2D 内容更容易.

Although there's certainly complexity available to OpenGL you don't need to wrap your head around all these features you don't need, to make a basic project with a graphics screen is almost all boilerplate code that you don't need to understand well, you could practically copy and paste from a sample project. For example, here are some sample programs that go with a textbook on OpenGL. Configuring the whole library to be part of your project is just a matter of adding a couple .lib files to a certain spot in the configuration settings, it doesn't take a lot to make it "do something" and then you will only need to familiarize yourself with a small subset of the features, to me it almost seemed easier than, say, drawing 2D stuff in Java.

我真的不太了解任何其他建模工具,只是想我会扔掉那里我不会因为太复杂"而过快地写下来,考虑一下是合理的,即使没有大量的 C++ 或图形等背景.

I don't really know any of those other modeling tools well, just thought I'd throw out there that I wouldn't write that one off too quickly as being "too complex", it'd be reasonable to consider, even without a huge background in C++ or graphics, etc.

这篇关于C++ 图形库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆