LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-12-2005, 08:18 AM   #1
yakkmeister
Member
 
Registered: Jan 2005
Location: QLD Australia
Distribution: SuSE + Ubuntu + DeMuDi ... whatever does the job :D
Posts: 40

Rep: Reputation: 15
Question svgalib, matrix & Hash Tables: programming tutorial


Hello.
Did a search and didn't find any threads relating to this, so I assume it's a safe post.

My question is this:
Where can one find a good tutorial for svgalib?

I am trying to learn games programming (been doing applications programming in delphi and VB for ages now) in c/c++, and I like the simplicity of svgalibs, as evidenced in the tutorial section on their website. The only problem was that the tutorial was very breif and all I could find on the web was totally undocumented.

I have only rudimentary skills with c/c++, but I am trying to learn though application by following some ideas from gamedev.net, namely the 'where do I start' article. It was suggested to start off programming a tetris clone, then move on to a galaga-esque shooter... well I'm only up to the tetris clone...

Which brings me to my next question:
Where can one find a good tutorial for matrix math and hash tables?

Yeah ... well, thanks for reading, if you can help, thanks!
If not, thanks anyway!
 
Old 03-14-2005, 12:29 AM   #2
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Don't use svgalib!!! I've tried it myself, and it sucks. The very worst thing is that you have to go into root mode to run your programs because it requires direct access to memory, which is a huge violation of anything remotely secure (and it causes allot of crashes). I STRONGLY suggest looking into:

(1): SDL (Simple Direct media Layer): www.libsdl.org
(2): Allegro: www.talula.demon.co.uk/allegro/

Both are WAY better than svgalib. Also, if you go with SDL, you can use OpenGL, even if you are going to make a 2D app.

Both those libraries are OS independant, which means you can cross compile your application.


Also, SDL has full and complete docs, here: http://sdldoc.csn.ul.ie/

(So does Allegro).

And, SDL has functions for loading almost any format of image, and it has sound functions and networking functions.

Here is a really simple game created with SDL: http://koti.mbnet.fi/lsoft/formido/formido.html
And a simple one created with allegro: http://redpixel.sourceforge.net/redpixel.html

Last edited by The_Nerd; 03-14-2005 at 12:34 AM.
 
Old 03-14-2005, 12:37 AM   #3
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Yo yakkmeister. I see you are getting started with C++. I'll be very glad to assist you. If you choose to use SDL or Allegro I'll also answer any questions you may have about those. However, if you go with svgalib, I'll only answer your c/c++ related questions.

Email me at: th317erd@gmail.com

I am always willing to help to the best of my abbilities!
 
Old 03-15-2005, 07:59 AM   #4
yakkmeister
Member
 
Registered: Jan 2005
Location: QLD Australia
Distribution: SuSE + Ubuntu + DeMuDi ... whatever does the job :D
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks for the reply.
I may take you up on your offer too ...
I do have some questions regarding your answer though.

I would like to know which of the two API's you mentioned is the most straight-forward as far as programming is concerned?
I found that when I looked at svgalib code I was able to follow it without the usual 'what does all that do' thinking I found as par for the likes of OpenGL. This trype of simplicity is quite important as I don't want to get caught up in bothering with heaps of hardware level stuff.

I don't discount the possibility that I am not seeing the whole picture either, perhaps svgalib is more difficult than it looks...

Cross platform compatability is not really a priority for me, however I do recognise the need for such a beast, how is SDL like to work with? I have read that it is an abstraction of OpenGL and as such costs performance due to more API layers.

[edit]
Forgot this bit ...
I am also looking to produce programs in such a way as to provide either a single executable or a compressed file with all needed files within ... that is to say that I prefer programs to be unzip and run affairs, no install or compile (I think compiling is pretty cool though). Mostly this is because I don't want to learn how to do makefiles and configure scripts (or packages for that matter). So, given my (possibly misguided) ideals, which of your suggestions would be capable of achieveing my goals?
I would also prefer that the user be able to use the program without having to install a special lib or such (no more than updating a an existing one at any rate, updates are fine) without having to statically linking the lib into the exe.

Yeah ... I'm pretty sure that all makes sense!
[/edit]

Last edited by yakkmeister; 03-15-2005 at 08:08 AM.
 
Old 03-18-2005, 02:26 AM   #5
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Ok, sorry for taking so long to post. I have programmed in both Allegro and SDL (I think I said that...), and I personally like SDL better. It makes allot more sense to me. It most certainly isn't obfusticated. Allegro is alright, definately no worse than svgalib (quite a bit better I have to say). It depends what you want, SDL is more focused on new hardware n' such (although it can still do old stuff). Allegro is more like svgalib in the fact that it does more "pupixel" sort of stuff, in short, it is more "down and dirty". I don't know which is faster. Besides that they are both the same in the library installing sense.

This is how you should make your choice:
Do you eventually want to make 3D games with OpenGL? If so, go with SDL. This way you can learn it and get the feel of it when that time comes.
Or, do you want to stick with making 2D games? Than Allegro. (Or SDL... )


They are really too close in the sense you are speaking of to worry about it. Flip a coin!
 
Old 03-18-2005, 08:20 PM   #6
yakkmeister
Member
 
Registered: Jan 2005
Location: QLD Australia
Distribution: SuSE + Ubuntu + DeMuDi ... whatever does the job :D
Posts: 40

Original Poster
Rep: Reputation: 15
I think I'll go with SDL then, thanks for your help, and I'll be sure to drop an e-mail to you with the odd question.

Thanks!
 
Old 10-11-2005, 12:35 PM   #7
bave
LQ Newbie
 
Registered: Sep 2005
Location: rotterdam
Posts: 3

Rep: Reputation: 0
svgalib

Hello,

You wrote the following about Svgalib some 6 months ago.

------
I found that when I looked at svgalib code I was able to follow it without the usual 'what does all that do' thinking I found as par for the likes of OpenGL. This trype of simplicity is quite important as I don't want to get caught up in bothering with heaps of hardware level stuff.

I don't discount the possibility that I am not seeing the whole picture either, perhaps svgalib is more difficult than it looks...
------


I am using svgalib in combination with C for more than 4 years and am quite happy with it.
My last film was made with this combination (look for 'Zwerk' on
http://www.longcanalfilm.nl )
There is also a book: 'Linux Graphics Programming with SVGAlib' by Jay Link.
Svgalib is absolutely not difficult, it is transparent like C itself.
However sometimes it can be difficult to get it installed, mostly due to the rapid changes in distros, graphic cards etc.
What are your plans, what kind of images do you want to make with C-svgalib?

You can mail me:
bave@longcanalfilm.nl

bave
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming in C Tutorial Mercurius Programming 22 05-08-2006 05:01 PM
hash tables library in c trutnev Programming 1 05-23-2005 03:16 PM
Svgalib and Svgalib-devel on FC1 Michele Spinolo Fedora 1 11-11-2004 09:56 AM
looking for X programming tutorial (C or C++) qwijibow Programming 1 02-02-2004 08:33 AM
Good introductory C programming tutorial ClayOgre Programming 2 01-28-2003 11:02 PM


All times are GMT -5. The time now is 04:24 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration