Advertisement

svgalib files and SDL

Started by January 24, 2001 09:54 AM
2 comments, last by flame_warrior 24 years ago
Hi, I am trying to use svgalib to put pixels in the screen. This is what I am trying to do #include int main() { vga_init() vga_getdisplaymode(); vga_setModeX(); // rest of the code I don''t get exactly in what order should it be put. set_color(whatever parameter); // I hope someone can help out here. } Ok it goes into VGA mode using VGA driver but doesn''t do anything. Can''t put the code here coz am on windows. Also does anyone know how to compile and link SDL programs in command line ? It gives an error saying libsdl.la not found when I do c++ filename.cc -llibsdl.la SDL doc says the libraries get loaded dynamically but they don''t. Hope someone has worked with SDL here. Newbie here with linux game programming so I thank you all for your patience.
Hello from my world
For the SDL part try this:

[your compiler here] filename.cc `sdl-config --cflags --libs`

Be sure you use the ` (beneath the escape key) instead of the ''.

This will execute a script which provides the correct command line options for the compiler to use SDL.

-pwd

Advertisement
This works for me:
gcc -o sdl_test sdl_test.c -lSDL -I /home/staffan/SDL-1.1.7/include -lpthread

"This album was written, recorded and edited at Gröndal, Stockholm in the year of 2000. At this point in time money still ruled the world. Capitalistic thoughts were wide spread. From the sky filled with the fumes of a billionarie''s cigar to the deepest abyss drenched in nuclear waste. A rich kid was a happy kid, oh..dirty, filthy times. Let this be a reminder."
- Fireside, taken from back of the Elite album
Pixel ploting in SVGALIB is actually really easy. Your start is good as far as setting the screen goes. If you ever programmed in DOS, then you might be familiar with the good old buffers it provided. Of course everything here has a much greater linear apparture (>= 64K accessible at one given time). You can use

graph_mem[X + Y * X_Width] = Color;

to plot your pixel.
`~.me.~''

This topic is closed to new replies.

Advertisement