[SDL] [DEMO] Minimal world engine in SDL+OpenGL

Michael Alger sdl at lists.rapacity.dyndns.org
Fri Jan 17 06:10:01 PST 2003


On Fri, Jan 17, 2003 at 04:29:31AM -0500, Patrick McFarland wrote:

> Jesus Christ! Clip the excess bullshit next time!

But clipping the quoted text might cause him to accidentally read the
text,  and if that happened then it's possible he would've read where
Daniel said it was under the GPL,  and thus never had the opportunity
to send the email in the first place.

Anyway, in a desperate effort to pretend this thread isn't just noise
I'll make a comment or two on the .zip...

1. the zip contains a file called "world", which causes all sorts of
   problems because it's followed by a directory called "world".  My
   primitive OS can't deal with a file and a directory attempting to
   posess the same name simultaneously,  thus extracting the archive
   was in itself a minor challenge.

2. once extracted, the "world/" directory didn't compile,  since the
   pthread library wasn't included.   Strangely enough, the Makefile
   in the parent directory did include -lpthread.

   -> You should be using sdl-config --cflags  and sdl-config --libs
      to get the neccessary flags, if you can't be bothered with the
      autoconf thing.

3. with that fixed, the "world/" directory compiled okay.  Compiling
   the "world" binary in the parent directory (after renaming world/
   to s-world/) went okay, running it produced a segfault.

4. added -g flag and found the crash in set_videosize():

    if (!(video = SDL_GetVideoInfo())) return -1;
    surface = SDL_SetVideoMode(xpix, ypix, video->vfmt->BitsPerPixel, flags);
    if (!(video = SDL_GetVideoInfo())) return -2;

 -> xpix = surface->w;

   The return -2 check seems a bit strange;  shouldn't it be testing
   if surface isn't NULL?  So I added:

    if (surface == NULL)  return -3;

   After that test, and run it again and get:

mike at satan:/tmp/z$ ./world
./world: can't set video mode... Couldn't find matching GLX visual

At this point I decided there's something wrong with my setup anyway,
and gave up. :-)

If anyone's read this far,  I'd appreciate any ideas of things to try
to get accelerated OpenGL working properly.   Currently, it sometimes
works.  GLTron for example, seems to be accelerated.  GL screensavers
from xscreensavers fail fullscreen (with the message "Couldn't create
GL context for visual 0x21"), but work when windowed.

GeForce4 MX, evil nVidia binary drivers v4191, stock 2.4.21-pre2 with
rml's preemptible kernel patches  (same behaviour on earlier versions
of the drivers and different kernel, too).


> On 17-Jan-2003, Fabio Giovagnini wrote:

>> very interesting.
>> is this software usable under GLP?

>> regards.

>> Alle 05:59, venerd? 17 gennaio 2003, Daniel Phillips ha scritto:
>>> Alot of bullshit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030117/5586453b/attachment-0008.pgp>


More information about the SDL mailing list