A Simple, 2d cross-platform graphics library for c

2019-01-31 00:29发布

问题:

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.

Anyone knows a solution for me?

回答1:

What about SDL?

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



回答2:

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.



回答3:

  • Qt 5
  • 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.



回答4:

http://www.allegro.cc/

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



回答5:

Heavy-weight:

  • GTK
  • QT
  • WxWidgets

Lightweight:

  • FLTK
  • Fox
  • Tk
  • Lua IUP
  • Ultimate++
  • dlib

Drawing frameworks without GUI widgets:

  • SDL
  • Cairo


回答6:

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

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



回答7:

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

  • Cross-Platform functionality (Windows and 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)
  • Config File Processing
  • Logging
  • Input from a mouse, keyboard, or Xbox 360 controller
    • Binding inputs from a config file
  • Python Scripting
    • In-Game Console

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



回答8:

Picasso graphic library you can used: cross platform

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



回答9:

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.