43

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?

9 Answers9

47

What about SDL?

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

Luke Cardeaux
  • 781
  • 2
  • 8
  • 10
  • SDL is indeed more than Agasa needs, but it should be straightforward enough to use. – Matthew Olenik Mar 22 '09 at 20:45
  • 2
    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! –  Mar 23 '09 at 20:46
16

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.

Jim Buck
  • 20,482
  • 11
  • 57
  • 74
  • 11
    OpenGL doesn't guarantee identical pixel output across implementations. –  Apr 05 '09 at 11:41
  • @user82238 that is correct, but does such hardware accelerated API exist? http://stackoverflow.com/questions/7922526/opengl-deterministic-rendering-between-gpu-vendor | http://stackoverflow.com/questions/3919307/is-there-a-2d-graphics-api-with-both-pixel-perfect-drawing-and-2d-hardware-accel (e.g. allowing accelerated sprite rotation / scaling / blending / z-order ). – Ciro Santilli OurBigBook.com Nov 10 '16 at 01: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 05:22
15

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

feedc0de
  • 3,646
  • 8
  • 30
  • 55
dirkgently
  • 108,024
  • 16
  • 131
  • 187
10

Heavy-weight:

  • GTK
  • QT
  • WxWidgets

Lightweight:

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

Drawing frameworks without GUI widgets:

  • SDL
  • Cairo
xoxox
  • 719
  • 1
  • 13
  • 24
qwer
  • 959
  • 6
  • 4
6

http://www.allegro.cc/

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

plan9assembler
  • 2,862
  • 1
  • 24
  • 13
4

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.

schmrz
  • 376
  • 1
  • 11
3

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

Rook
  • 60,248
  • 49
  • 165
  • 242
  • 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
  • 2
    @dagw - you mean for commercial use. It is free for non commercial use. – Rook Mar 22 '09 at 22:01
1

Picasso graphic library you can used: cross platform

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

Albert
  • 65,406
  • 61
  • 242
  • 386
onecoolx
  • 11
  • 1
0

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.

Plooby
  • 41