[c] A Simple, 2d cross-platform graphics library for c or c++?

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?

This question is related to c graphics cross-platform

The answer is


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.


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.


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


Heavy-weight:

  • GTK
  • QT
  • WxWidgets

Lightweight:

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

Drawing frameworks without GUI widgets:

  • SDL
  • Cairo

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.



Picasso graphic library you can used: cross platform

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


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


Examples related to c

conflicting types for 'outchar' Can't compile C program on a Mac after upgrade to Mojave Program to find largest and second largest number in array Prime numbers between 1 to 100 in C Programming Language In c, in bool, true == 1 and false == 0? How I can print to stderr in C? Visual Studio Code includePath "error: assignment to expression with array type error" when I assign a struct field (C) Compiling an application for use in highly radioactive environments How can you print multiple variables inside a string using printf?

Examples related to graphics

How to play or open *.mp3 or *.wav sound file in c++ program? How to use graphics.h in codeblocks? How do I get the height and width of the Android Navigation Bar programmatically? How to Change Font Size in drawString Java How can I produce an effect similar to the iOS 7 blur view? Creating a blurring overlay view Saving images in Python at a very high quality Android: Background Image Size (in Pixel) which Support All Devices How to create a Rectangle object in Java using g.fillRect method Scaling a System.Drawing.Bitmap to a given size while maintaining aspect ratio

Examples related to cross-platform

How to execute XPath one-liners from shell? iOS / Android cross platform development How to detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor? What is "stdafx.h" used for in Visual Studio? How to identify platform/compiler from preprocessor macros? How to get the home directory in Python? How to check if running in Cygwin, Mac or Linux? Automatically add all files in a folder to a target using CMake? How is Java platform-independent when it needs a JVM to run? Difference between "\n" and Environment.NewLine