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.
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.
Alright, here’s a quick sample I cooked up. Hopefully I did it right
for you.
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.
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. 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.
(Note the ` characters are graves, not single-quotes/apostrophes.
That’s a shell nicety. See also the use of “$(shell …)” in Makefiles.)