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?

share|improve this question

closed as off-topic by Martijn Pieters Sep 10 '16 at 6:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Martijn Pieters
If this question can be reworded to fit the rules in the help center, please edit the question.

    
"attract spam". I see... – xoxox Jan 29 '17 at 7:49
    
In what way is this question different from stackoverflow.com/questions/1200727/… ? – xoxox Jan 29 '17 at 7:49
up vote 30 down vote accepted

What about SDL?

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

share|improve this answer
    
SDL is indeed more than Agasa needs, but it should be straightforward enough to use. – Matthew Olenik Mar 22 '09 at 20:45
    
It worked with minimal effort. The fact that sdl-config exist and that debian had all the stuff preinstalled helped a lot. I agree it's overkill but it's simple enough for what i need. Thanks a lot for everything! – Agasa Mar 23 '09 at 20:46

[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.

share|improve this answer
    
why qt 4.2? the latest version of qt is also good i reckon :) – Emile Vrijdags Mar 22 '09 at 18:35
    
I had the doc links for 4.2 handy -- so mentioned it in the post. – dirkgently Mar 22 '09 at 18:40
    
Agreed, Qt (4.5) is also an excellent choice. – Luke Cardeaux Mar 22 '09 at 18:51

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.

share|improve this answer
9  
OpenGL doesn't guarantee identical pixel output across implementations. – user82238 Apr 5 '09 at 11:41
    
@user82238 that is correct, but does such hardware accelerated API exist? stackoverflow.com/questions/7922526/… | stackoverflow.com/questions/3919307/… (e.g. allowing accelerated sprite rotation / scaling / blending / z-order ). – Ciro Santilli 华涌低端人口 六四事件 法轮功 Nov 10 '16 at 1:31
    
And if he's simply doing RGB pixels, without fancy lighting/etc., I fail to see an implementation that would give a radically different output, if any difference at all. But, heck, now thinking about it 7.5 years later, he could just "blit" to an in-memory "screen", and use OpenGL/etc. simply to throw the result onto the screen. – Jim Buck Nov 11 '16 at 5:22

Heavy-weight:

  • GTK
  • QT
  • WxWidgets

Lightweight:

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

Drawing frameworks without GUI widgets:

  • SDL
  • Cairo
share|improve this answer

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 ...

share|improve this answer
2  
While DISLIN seems pretty cool, it is worth noting that it cost $180 pr developer for non-commercial use. – dagw Mar 22 '09 at 20:16
1  
@dagw - you mean for commercial use. It is free for non commercial use. – Rook Mar 22 '09 at 22:01

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.

share|improve this answer

Picasso graphic library you can used: cross platform

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

share|improve this answer

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.

share|improve this answer
2  
This seems to be only for .NET ? The OP asked for C/C++ and cross-platform. – Paul R Jan 22 '16 at 9:42