Need easiest path to a very simple use of SDL on eeeBuntu

I need to do something very basic, and won’t be using most of the complex functionality of this package. I’m a biologist about to get onto an airplane for a lengthy trip and would like to use those 8 hours to play with a very simple simulation. I have a eeePC running eeeBuntu. I need to download SDL so that it will work on this machine, and write a piece of code in plain C that will

open a window of X,Y pixels in size (say, 200x200)
issue plot commands that will put a large dot at various coordinates (say, in the middle at 100,100)

that’s it. What’s the fastest, easiest way to do that? If anyone could point me to the right thing to download (source that would compile on eeeBuntu for the SDL itself) and the simplest possible example in C showing the above (how to init a window with defined virtual coordinates and plot dots on it), I would greatly appreciate it. It’s been years since I’ve dug around in Unix documentation and I’m just hoping that some kind soul will save me the time of digging through the extensive website and documentation of all the rich features I don’t plan to use.

thank you in advance,

Mike Levin

As for SDL installation, if you’re on an Ubuntu clone, then it should
be as easy as typing this into a terminal:

sudo apt-get install libsdl1.2 libsdl1.2-dev

The ‘libsdl1.2’ package might not exist. On Debian, it comes as
libsdl1.2debian. It might be the same on Ubuntu or it might be
something else. You can see what is available with:
apt-cache search libsdl | grep libsdl

Jonny DOn Fri, Dec 18, 2009 at 12:33 PM, mlevin77 <michael.levin at tufts.edu> wrote:

I need to do something very basic, and won’t be using most of the complex
functionality of this package. I’m a biologist about to get onto an airplane
for a lengthy trip and would like to use those 8 hours to play with a very
simple simulation. I have a eeePC running eeeBuntu. I need to download SDL
so that it will work on this machine, and write a piece of code in plain C
that will

open a window of X,Y pixels in size (say, 200x200)
issue plot commands that will put a large dot at various coordinates (say,
in the middle at 100,100)

that’s it. What’s the fastest, easiest way to do that? If anyone could point
me to the right thing to download (source that would compile on eeeBuntu for
the SDL itself) and the simplest possible example in C showing the above
(how to init a window with defined virtual coordinates and plot dots on it),
I would greatly appreciate it. It’s been years since I’ve dug around in Unix
documentation and I’m just hoping that some kind soul will save me the time
of digging through the extensive website and documentation of all the rich
features I don’t plan to use.

thank you in advance,

Mike Levin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Alright, here’s a quick sample I cooked up. Hopefully I did it right
for you. :slight_smile:
See attached.

The compiling command might look something like this:
gcc main.c -o plotter -I/usr/include/SDL -lSDLmain -lSDL

Jonny DOn Fri, Dec 18, 2009 at 12:56 PM, Jonathan Dearborn <@Jonathan_Dearborn> wrote:

As for SDL installation, if you’re on an Ubuntu clone, then it should
be as easy as typing this into a terminal:

sudo apt-get install libsdl1.2 libsdl1.2-dev

The ‘libsdl1.2’ package might not exist. ?On Debian, it comes as
libsdl1.2debian. ?It might be the same on Ubuntu or it might be
something else. ?You can see what is available with:
apt-cache search libsdl | grep libsdl

Jonny D

On Fri, Dec 18, 2009 at 12:33 PM, mlevin77 <michael.levin at tufts.edu> wrote:

I need to do something very basic, and won’t be using most of the complex
functionality of this package. I’m a biologist about to get onto an airplane
for a lengthy trip and would like to use those 8 hours to play with a very
simple simulation. I have a eeePC running eeeBuntu. I need to download SDL
so that it will work on this machine, and write a piece of code in plain C
that will

open a window of X,Y pixels in size (say, 200x200)
issue plot commands that will put a large dot at various coordinates (say,
in the middle at 100,100)

that’s it. What’s the fastest, easiest way to do that? If anyone could point
me to the right thing to download (source that would compile on eeeBuntu for
the SDL itself) and the simplest possible example in C showing the above
(how to init a window with defined virtual coordinates and plot dots on it),
I would greatly appreciate it. It’s been years since I’ve dug around in Unix
documentation and I’m just hoping that some kind soul will save me the time
of digging through the extensive website and documentation of all the rich
features I don’t plan to use.

thank you in advance,

Mike Levin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-------------- next part --------------
A non-text attachment was scrubbed…
Name: main.c
Type: text/x-csrc
Size: 1586 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20091218/ef5891a8/attachment.c

Use “sdl-config”, rather than specifying all the SDL-specific stuff by hand.
It helps things to be more portable.

e.g.:

gcc main.c -o plotter sdl-config --cflags --libs

or something. :slight_smile:

(Note the ` characters are graves, not single-quotes/apostrophes.
That’s a shell nicety. See also the use of “$(shell …)” in Makefiles.)

-bill!On Fri, Dec 18, 2009 at 01:27:35PM -0500, Jonathan Dearborn wrote:

Alright, here’s a quick sample I cooked up. Hopefully I did it right
for you. :slight_smile:
See attached.

The compiling command might look something like this:
gcc main.c -o plotter -I/usr/include/SDL -lSDLmain -lSDL

Bill Kendrick wrote:> On Fri, Dec 18, 2009 at 01:27:35PM -0500, Jonathan Dearborn wrote:

Alright, here’s a quick sample I cooked up. Hopefully I did it right
for you. :slight_smile: See attached.
The compiling command might look something like this:
gcc main.c -o plotter -I/usr/include/SDL -lSDLmain -lSDL

Use “sdl-config”, rather than specifying all the SDL-specific stuff by hand.
It helps things to be more portable.

e.g.:

gcc main.c -o plotter sdl-config --cflags --libs

or something. :slight_smile:

(Note the ` characters are graves, not single-quotes/apostrophes.
That’s a shell nicety. See also the use of “$(shell …)” in Makefiles.)

-bill!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sorry, I don’t see Jonathan Dearborn’s post in this thread! Where is it, and where is the sample of code attached? Thanks to both of you!!!

Mike

Sorry, I don’t see Jonathan Dearborn’s post in this thread! Where is it,
and where is the sample of code attached? Thanks to both of you!!!

Use the Force, L-- I mean, use the Link, Mike:

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It ended up archived here:

http://lists.libsdl.org/pipermail/sdl-libsdl.org/2009-December/073913.htmlOn Fri, Dec 18, 2009 at 10:46:57AM -0800, mlevin77 wrote:


-bill!
Sent from my computer

Thanks!!!

Thanks!!!