[英]What type of a tool should I use to make a simple simulator in C or C++
I'm a Rails/web developer with little experience with C++, so I'm not totally sure what direction to head in: I'm looking to build a simple simulator that I can use to test an algorithm I'm building that converts standard images to radial coordinates, and all I really need to be able to do is to plot points (which will represent LEDs) on a blank window and continuously refresh them (the LEDs blink). 我是一个Rails / web开发人员,对C ++没什么经验,所以我不完全确定要进入的方向:我正在构建一个简单的模拟器,我可以用来测试我正在构建的算法标准图像到径向坐标,我真正需要做的就是在空白窗口上绘制点(代表LED)并连续刷新它们(LED闪烁)。 I don't want to build a gui;
我不想建立一个gui; command line is fine, as I'll be the only person using the tool.
命令行很好,因为我将是唯一使用该工具的人。
I'm not sure whether this is even possible or not... I did some Java programming years ago and I remember being able to pretty easily open a window and render images in it. 我不确定这是否可能......几年前我做了一些Java编程,我记得能够很容易地打开一个窗口并在其中渲染图像。 Is there a C++ equivalent?
是否有C ++等价物?
Thanks in advance! 提前致谢!
What you are describing is a perfect fit for a GUI application, rather than command line, as far as I understand. 根据我的理解,您所描述的内容非常适合GUI应用程序,而不是命令行。
But if you want something really simple, and not spend some time learning a GUI development framework (MFC, Qt, WxWidgets, etc), you should check the following resources: 但是如果你想要一些非常简单的东西,而不是花一些时间学习GUI开发框架(MFC,Qt,WxWidgets等),你应该检查以下资源:
It's not that easy in C++, because there is no standard way in doing this. 在C ++中并不容易,因为没有标准的方法可以做到这一点。 It's not part of the language.
它不是语言的一部分。 There are a lot of frameworks though, some lightweight and some bloating.
虽然有很多框架,有些是轻量级的,有些是膨胀的。 It also depends your platform.
它还取决于您的平台。 Anyhow, I think I would use OpenGL and do that calculation thing in a shader.
无论如何,我想我会使用OpenGL并在着色器中进行计算。 That way you don't have to recompile and rerun all the C++ code.
这样您就不必重新编译并重新运行所有C ++代码。 You can even do it in way that updates the GPU shader whenever you save your shader file giving you immediate results.
您甚至可以在保存着色器文件时更新GPU着色器,以便立即获得结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.