LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Svga-lib C programming tutorials (https://www.linuxquestions.org/questions/programming-9/svga-lib-c-programming-tutorials-113037/)

WindowsBurner 11-06-2003 09:34 AM

Svga-lib C programming tutorials
 
Hey all,

I was wondering is anybody knows where to get some svga-lib tutorials?

I am developing games and I'd like to switch to Svga-lib based
I programmed in windows for a bit and made some pretty cool games
but I saw that linux doesn't have many games and since I like linux better
I'm gonna stick with games for linux.

LINUX ROCKS!!!!

trickykid 11-06-2003 09:48 AM

Moved: More suitable where the Programming snobs like crabboy and acid_kewpie hangout.. ;)

WindowsBurner 11-06-2003 10:03 AM

Thanks trickykid I completly missed the programming forum:D :D :) :D

jhorvath 11-06-2003 01:25 PM

...have you also checked, libsdl.org ..it's cross-platform and simple to use, and has a multitude of addon libs available :)

besides ..SDL RULES! ;)

WindowsBurner 11-06-2003 02:14 PM

I tried the link but it gave me an error saying It can't conect to database.

But thanks anyway you gave me an Idea.

jhorvath 11-06-2003 02:52 PM

...yeah that is odd, it was up just yesterday..<?>

the latest SDL (1.2.6) is on slackware.com/getslack (or your cd, if you have 9.1), pick a mirror and select a slack-9.1 tree under the 'l' (L) directory...you can install that if you'd like. i believe it comes with the html documentation that is found on libsdl.org, that gives some examples as well as good information :)

some recomended addons would be ..

SDL_image - useful for using images other than the native BMP support
SDL_ttf - for using True Type Fonts
SDL_net - ...networking, multiplayer

..those are probably mandatory for many apps :) , but they are seperate to keep the main SDL tree cleaner, smaller...

WindowsBurner 11-06-2003 02:54 PM

thanks I'll try that.
Though I'm not using 9.1 I'm using 9.0

jhorvath 11-06-2003 02:57 PM

i think that it should still install fine, if not ...the 1.2.5 found on the slack 9 cd will do as well..i think mostly fixes were made for various things that you probably won't need to worry about

also ,i edited the post above your last one ...i saw you posted before i could edit it...just some extra libs

..i saw your other post ...saying you were using C.. SDLs API is C but works also with C++ natively (in case you switch)...

jinksys 11-09-2003 02:13 PM

Please try SDL, SVGA is eeeevilllll *wooggiieebooggieeee*

Kurt M. Weber 11-09-2003 02:20 PM

svga is actually quite nice in a simple sort of way.

I'm actually writing a windowing system using it right now.

WindowsBurner 11-09-2003 02:29 PM

Thats was an idea my dad an I had kurt :)

Could you maybe show me how to handle keyboard input?
I know how to do something if a key is pressed.
But I don't know how to do something if a certain key is pressed.

Like :
I can draw a line across the screen if any key is pressed.
But I want to draw circle when the key A is pressed.?
How do I do it?

Thanks

Kurt M. Weber 11-09-2003 02:38 PM

Check the value of the key that was pressed, and if it's the key A then draw a circle.

Of course, you'll have to write your own code to draw a circle since svgalib doesn't have any built-in functions for that...I recommend the algorithm at http://www.cs.unc.edu/~mcmillan/comp...e7/circle.html

WindowsBurner 11-09-2003 03:04 PM

I know how to draw a circle.
But I don't know how to check the value of the key pressed.
I'm having a hard time finding any tutorials and the man pages aren't much help.

If I could just know how to check the value of a key pressed.

jinksys 11-09-2003 03:18 PM

SVGA is evil because you have to run your programs as root.
I wouldnt trust a game with the integrity of my system.

WindowsBurner 11-09-2003 03:21 PM

It's pretty difficult but you can do a workaround so that a normal user can run them.
As soon as I find the doc I'll post it so you can read it.

Since I'm always logged in as root anyway it doesn't make much differnce to me anyway.


:)


All times are GMT -5. The time now is 01:27 AM.