Difficulty choosing graphics library

This is a discussion on Difficulty choosing graphics library within the Game Programming forums, part of the General Programming Boards category; I am looking for a graphics library for specific features and such. But I am confused as to which to ...

Difficulty choosing graphics library

I am looking for a graphics library for specific features and such. But I am confused as to which to use... I know that there is SDL and Allegro. But I dont know if they do what I want them to do fully...

I am trying to start writing a game engine and I wanted to be able to include the following options for this graphics library:

Main feature:
Code does not need to be changed at all for cross-platform functionality and all the functions still remain the same. Basically, I just want to copy and paste the code, Compile the SAME EXACT CODE under windows, and linux and mac etc... Without modifying anything.

Library Features:
Just some of the most basic features that a graphics library has. But a MUST is that it can compile in free C++ compilers. I am hoping that maybe the library can also support outputting and converting images to other file formats as well. In other words, open the file in JPG, but then save it in BMP, etc...

MUST HAVE FEATURES:
Color adjustments
Lighting adjustments

Can anyone help me find something exactly like this? Or is it possible to extend Allegro or SDL to be able to do this? Does something with my wishlist items exist? Thanks in advance for your help...

SDL i believe can do almost all of that if you know how to. Color adjustment and lighting is easy to do if you can do pixel manipulation, but the SDL_Image extension library will load most of those image formats. also if you need a good audio library i recommend Irrklang. Best of luck to you.

Or if you are willing to do it, you can right your engine with DirectX which will be naturally faster than SDL or allegro, but will also be somewhat slower to write.

I know SDL will work on Windows, Mac and Linux. But I haven't seen a port for DOS and I haven't seen any official ports for other OS's. Allegro seems to be able to be ported to those main OS's, but it seems to lack some of the features I need from it.

Also, I really want DOS to be supported as a definite because if there is no other port to the other systems, DOS can be run from those systems through an emulator. But even though I would have a dos version, I still definitly want a Mac, Linux and Windows Version...

are you talking about MSdos? if that is the case you are going to be very limited, or it may not even be possible to get a completely portable graphics library. I didnt even think that dos had graphics, but i may be wrong.

> Compile the SAME EXACT CODE under windows, and linux and mac etc... Without modifying anything.
Not even the build flags?

Why does your engine have to support everything?! This will only make it complex, hard to maintain and bloated as hell. Your engine should support loading of image formats, not necessarily the graphics library -- most mainstream graphics libraries only support 1 image format, the rest is provided by extensions, or extra code.

I wouldent call ~256k bloated considering the OP wants to make a game engine. And if we are assuming the end user has the required DLLs on their system (as you would with openGL) then theres no bloat at all

I've never tested very many of those, mind, but I'm sure support is reasonable for them.

I used to program a lot for DOS, and that was one reason I didn't really want to use the SDL at first, because it doesn't support DOS -- but then I realized that no one really uses DOS anymore. Everyone uses Windows. (Though looking at some of the other "wishlist" platforms you have there, perhaps you really do need DOS support.)

You could probably port SDL programs to DOS reasonably easily -- there just isn't official DOS support because the SDL includes stuff like threads that wouldn't work under DOS. As long as you use DOS-compatible stuff, I don't think writing your own layer would be that hard . . .

About SDL
SDL (Simple Directmedia Layer) is an Open Source effort to provide a multi-platform API for games, emulators, .... There are ports for various platforms available. As far as HXGUI is concerned, support for video, (wave) audio, keyboard, mouse, timer and threads is implemented. Please be aware that there is no special version of SDL for HX (or DOS) available. It is the Win32 port of SDL which can be used with HX. The SDL site is at http://www.libsdl.org/index.php, where the source code of all ports can be found.

So it looks like you could run SDL programs under DOS if you wanted to. Or you could just use Allegro -- but it doesn't have threads, apparently . . . . [/edit]

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell