一个简单的,2d的跨平台图形库,用于c或c++?

时间:2021-04-12 12:16:10

As in title, i need a 2d graphics library that is cross-platform, and provides simple functions, like in Basic; essentially, i only need to paint a pixel a certain color-I do not need hardware acceleration, or any kind of 3d support. I've found a couple ones, but they're not cross-platform.

如标题所示,我需要一个跨平台的二维图形库,并提供简单的功能,如Basic;本质上,我只需要画一个像素一个特定的颜色——我不需要硬件加速,也不需要任何3d支持。我找到了几个,但它们不是跨平台的。

Anyone knows a solution for me?

有人知道我的解决方案吗?

9 个解决方案

#1


31  

What about SDL?

SDL呢?

Perhaps it's a bit too complex for your needs, but it's certainly cross-platform.

也许它对您的需求来说有点太复杂了,但是它确实是跨平台的。

#2


12  

Am I missing something to wonder why noone suggests OpenGL? To use it for 2d would be very simple. The OP only wants to color a pixel. It doesn't get simpler than glBegin/glColor/glVertex/glEnd.

我是不是想知道为什么没人推荐OpenGL?将它用于2d是非常简单的。OP只想给一个像素上色。没有什么比glBegin/glColor/glVertex/glEnd更简单的了。

#3


12  

  • Qt 5
  • Qt 5
  • GTK+
  • GTK +
  • Cairo
  • 开罗
  • and many many more ...
  • 还有更多……

[In no particular order.] However, if you have any other requirements, let us know. BTW: I am not just posting results of a Google query here, I have used all of these (and SDL -- wrote my first few games in SDL :) and I'd say without a set of requirements, it's very difficult to choose among the ones listed.

(排名不分先后。但是,如果您有其他要求,请告诉我们。顺便说一句:我并不是在这里发布谷歌查询的结果,我已经使用了所有这些(还有SDL——我在SDL:中编写了我的前几款游戏),而且我要说,没有一组需求,在列出的需求中进行选择是非常困难的。

#4


6  

http://www.allegro.cc/

http://www.allegro.cc/

http://en.wikipedia.org/wiki/Allegro_library

http://en.wikipedia.org/wiki/Allegro_library

#5


6  

Heavy-weight:

重量级:

  • GTK
  • GTK
  • QT
  • QT
  • WxWidgets
  • WxWidgets

Lightweight:

重量轻:

  • FLTK
  • FLTK
  • Fox
  • 福克斯
  • Tk
  • Tk
  • Lua IUP
  • Lua IUP
  • Ultimate++
  • 最终的+ +
  • dlib
  • dlib

Drawing frameworks without GUI widgets:

没有GUI控件的绘图框架:

  • SDL
  • SDL
  • Cairo
  • 开罗

#6


3  

I would recommend DISLIN. It's cross platform, has support for many languages, and has very intuitive naming of routines.

我建议DISLIN。它是跨平台的,支持多种语言,并且对例程有非常直观的命名。

Also, just noticed that nobody mentioned PLPLOT, also cross platform, multi lingual ...

另外,刚注意到没有人提到PLPLOT,也可以跨平台,多语种……

#7


3  

One neat engine I came across is Angel-Engine. Info from the project site:

我遇到的一个整洁的引擎是天使引擎。项目网站信息:

  • Cross-Platform functionality (Windows and Mac)
  • 跨平台功能(Windows和Mac)
  • Actors (game objects with color, shape, responses, attributes, etc.)
  • 参与者(具有颜色、形状、响应、属性等的游戏对象)
  • Texturing with Transparency
  • 纹理与透明度
  • "Animations" (texture swapping at defined intervals)
  • “动画”(定义间隔的纹理交换)
  • Rigid-Body Physics
    • A clever programmer can do soft-body physics with it
    • 一个聪明的程序员可以用它做软体物理。
  • 一个聪明的程序员可以用它来做软体物理。
  • Sound
  • 声音
  • Text Rendering with multiple fonts
  • 具有多种字体的文本渲染
  • Particle Systems
  • 粒子系统
  • Some basic AI (state machine and pathfinding)
  • 一些基本的AI(状态机和寻路)
  • Config File Processing
  • 配置文件处理
  • Logging
  • 日志记录
  • Input from a mouse, keyboard, or Xbox 360 controller
    • Binding inputs from a config file
    • 从配置文件绑定输入
  • 从鼠标、键盘或Xbox 360控制器绑定输入配置文件
  • Python Scripting
    • In-Game Console
    • 游戏控制台
  • Python脚本游戏控制台

Some users (including me) have succesfully (without any major problems) compiled it under linux.

一些用户(包括我)已经成功地(没有任何主要问题)在linux下编译它。

#8


1  

Picasso graphic library you can used: cross platform

你可以使用的毕加索图形库:跨平台。

https://code.google.com/p/picasso-graphic/

https://code.google.com/p/picasso-graphic/

#9


-1  

A cross platform 2D graphics library for .Net is The Little Vector Library You could use it in conjunction with Unity 3D (recommended) or Xamarin, for example, to create 2D graphics on a variety of platforms.

一个用于。net的跨平台二维图形库是一个小矢量库,您可以将它与Unity 3D(推荐)或Xamarin结合使用,例如,在各种平台上创建二维图形。

#1


31  

What about SDL?

SDL呢?

Perhaps it's a bit too complex for your needs, but it's certainly cross-platform.

也许它对您的需求来说有点太复杂了,但是它确实是跨平台的。

#2


12  

Am I missing something to wonder why noone suggests OpenGL? To use it for 2d would be very simple. The OP only wants to color a pixel. It doesn't get simpler than glBegin/glColor/glVertex/glEnd.

我是不是想知道为什么没人推荐OpenGL?将它用于2d是非常简单的。OP只想给一个像素上色。没有什么比glBegin/glColor/glVertex/glEnd更简单的了。

#3


12  

  • Qt 5
  • Qt 5
  • GTK+
  • GTK +
  • Cairo
  • 开罗
  • and many many more ...
  • 还有更多……

[In no particular order.] However, if you have any other requirements, let us know. BTW: I am not just posting results of a Google query here, I have used all of these (and SDL -- wrote my first few games in SDL :) and I'd say without a set of requirements, it's very difficult to choose among the ones listed.

(排名不分先后。但是,如果您有其他要求,请告诉我们。顺便说一句:我并不是在这里发布谷歌查询的结果,我已经使用了所有这些(还有SDL——我在SDL:中编写了我的前几款游戏),而且我要说,没有一组需求,在列出的需求中进行选择是非常困难的。

#4


6  

http://www.allegro.cc/

http://www.allegro.cc/

http://en.wikipedia.org/wiki/Allegro_library

http://en.wikipedia.org/wiki/Allegro_library

#5


6  

Heavy-weight:

重量级:

  • GTK
  • GTK
  • QT
  • QT
  • WxWidgets
  • WxWidgets

Lightweight:

重量轻:

  • FLTK
  • FLTK
  • Fox
  • 福克斯
  • Tk
  • Tk
  • Lua IUP
  • Lua IUP
  • Ultimate++
  • 最终的+ +
  • dlib
  • dlib

Drawing frameworks without GUI widgets:

没有GUI控件的绘图框架:

  • SDL
  • SDL
  • Cairo
  • 开罗

#6


3  

I would recommend DISLIN. It's cross platform, has support for many languages, and has very intuitive naming of routines.

我建议DISLIN。它是跨平台的,支持多种语言,并且对例程有非常直观的命名。

Also, just noticed that nobody mentioned PLPLOT, also cross platform, multi lingual ...

另外,刚注意到没有人提到PLPLOT,也可以跨平台,多语种……

#7


3  

One neat engine I came across is Angel-Engine. Info from the project site:

我遇到的一个整洁的引擎是天使引擎。项目网站信息:

  • Cross-Platform functionality (Windows and Mac)
  • 跨平台功能(Windows和Mac)
  • Actors (game objects with color, shape, responses, attributes, etc.)
  • 参与者(具有颜色、形状、响应、属性等的游戏对象)
  • Texturing with Transparency
  • 纹理与透明度
  • "Animations" (texture swapping at defined intervals)
  • “动画”(定义间隔的纹理交换)
  • Rigid-Body Physics
    • A clever programmer can do soft-body physics with it
    • 一个聪明的程序员可以用它做软体物理。
  • 一个聪明的程序员可以用它来做软体物理。
  • Sound
  • 声音
  • Text Rendering with multiple fonts
  • 具有多种字体的文本渲染
  • Particle Systems
  • 粒子系统
  • Some basic AI (state machine and pathfinding)
  • 一些基本的AI(状态机和寻路)
  • Config File Processing
  • 配置文件处理
  • Logging
  • 日志记录
  • Input from a mouse, keyboard, or Xbox 360 controller
    • Binding inputs from a config file
    • 从配置文件绑定输入
  • 从鼠标、键盘或Xbox 360控制器绑定输入配置文件
  • Python Scripting
    • In-Game Console
    • 游戏控制台
  • Python脚本游戏控制台

Some users (including me) have succesfully (without any major problems) compiled it under linux.

一些用户(包括我)已经成功地(没有任何主要问题)在linux下编译它。

#8


1  

Picasso graphic library you can used: cross platform

你可以使用的毕加索图形库:跨平台。

https://code.google.com/p/picasso-graphic/

https://code.google.com/p/picasso-graphic/

#9


-1  

A cross platform 2D graphics library for .Net is The Little Vector Library You could use it in conjunction with Unity 3D (recommended) or Xamarin, for example, to create 2D graphics on a variety of platforms.

一个用于。net的跨平台二维图形库是一个小矢量库,您可以将它与Unity 3D(推荐)或Xamarin结合使用,例如,在各种平台上创建二维图形。