Jump to content
  • Advertisement
Sign in to follow this  
Hedos

Linux graphic API?

This topic is 5065 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a beginner to linux and I want to create my own graphical application, but I'm not sure what to use. I don't want to use any graphical environment like KDE or Gnome, I want to create a stand-alone application which will be launched from the console. Some requirements for my application would be to be able to use a resolution ranging from something like 800*600 to 1280*960, in 16/24 bits colors. It would need to work with C++. So, what should I look for to get started? I think I'll need to work with the X System, am I right? Thanks

Share this post


Link to post
Share on other sites
Advertisement
I don't think VGALib is what I want since it probably don't allow big resolutions and lot of colors..

OpenGL would be an idea, but, how would I initialize all the required settings and set up the video mode?

Share this post


Link to post
Share on other sites
You can use SDL to cover the platform specific stuff for you. In other words, you use SDL to get a window up (and handle input/sound/etc. if you want), and use OpenGL for rendering. I'm generalizing, of course.

For details:
SDL

About SVGAlib, The only thing I know about it is that it was used to port Quake to linux. Not sure exactly what it's capable of though.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hedos
I don't think VGALib is what I want since it probably don't allow big resolutions and lot of colors..


The 'S' in 'SVGALib' is significant for this very reason...

Share this post


Link to post
Share on other sites
Quote:
Original post by Doc
Quote:
Original post by Hedos
I don't think VGALib is what I want since it probably don't allow big resolutions and lot of colors..


The 'S' in 'SVGALib' is significant for this very reason...


Does SVGALib run well on most number of modern video cards? I've never looked at it again since I met X.

OP: You may want to google for xlib if making your app X based is an option. It's pretty hard, specially the color management. You're warned.

Nice looking fonts are also a big issue. You may need to google for freetype2 too.

Share this post


Link to post
Share on other sites
Quote:
Original post by Arkainium
SDL/OpenGL - requires X

Not quite true. SDL apps can run in a framebuffer console as well. I even managed to get Alpha Centauri running in the framebuffer, which I doubt Loki Games had ever considered. SDL might support some other non-x drivers as well but www.libsdl.org seems to be down so I can't check ATM.

Share this post


Link to post
Share on other sites
Stay away from SVGALib. It requires SUID executables, which is obviously bad, and it's just way out of date.

The two lowlevel ways to access graphics that can be taken seriously are X and framebuffer. However, as others have pointed out, you should really use SDL - which supports both (and more) - unless a) you're a masochist or b) you really are interested in the inner workings of the operating system (come to think of it, that's really the same as option (a) ;)).

cu,
Prefect

Share this post


Link to post
Share on other sites
Ooops, I didn't know the difference between SVGA and VGA.
Well, anyway, it looks out-dated for sure.
SDL might be a good idea, if it can run from the console as some of you have said, it would be perfect.

So now, I would have to decide to use SDL with X or the framebuffer?
What are the major differences between the two? Any pro/con for each choice?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!