Bob Pendleton | 1 May 2011 01:22

Re: Example Of "Ray Casting" With SDL1.2+OpenGL?

No, no they are really not much use at all. They take too long.

Object picking is best done using the clipping hardware. Every 3D API
has a clipping API that uses the clipping hardware to do picking.
Lighting is best done using the rendering hardware to do the lighting
based on the surface normal of the thing being lighted.

In cases where you can't use hardware picking such as when you want to
do things in the scene graph that aren't going to the screen then you
still use clipping to to eliminate most of the graph to find the items
you want.

The question of whether there is line segment that connects to points
without passing through another object is also best done by clipping
to volume that contains the two points and all points in between.
Anything that isn't clipped out is possibly in the way.

OTOH Ray Tracing (not ray casting) is a technique that lets you do
photo realistic rendering with true reflections and shadows. Amazing
stuff.

If someone wants to learn 3D graphics my suggestion is to go to the
web site of of a college that is language and culture appropriate for
you, look up the entry level computer graphics programming course, and
find the text book they are using. Then get a copy of that text book
and read it. Do the problems at the ends of chapters. And get on with
learning. A lot of colleges are putting entire courses on line for
free. You can just go an read the material. You might have to get the
text books, but that is cheap compared to taking the classes.

(Continue reading)

David Olofson | 1 May 2011 02:34
Gravatar

Re: SDL_OpenAudio() and callback frequency

On Saturday 30 April 2011, at 21.32.21, "SparkyNZ" <pj74 <at> xtra.co.nz> wrote:
> eclectocrat wrote:
[...]
> I hear what you're saying but I still need to sit down and put all of this
> discussion together. It still seems logical to me for the start of each
> sample buffer to start on a particular note resolution - just seems like
> it could be easier for sequencing and calculating where the notes will be
> played etc.

It is logical if it's accuraty enough for your application, or you're 
recalculating the buffer size for each buffer with some sort of error 
feedforward. However, that's not how audio I/O works (these days, at least), 
at least not on the hardware level, or in any API useful for serious low 
latency audio.

So, you need to split and merge buffers one way or another, to fit the 
odd/variable buffers from your engine into the I/O buffers. You can do this 
physically, by means of an extra thread and a buffer queue, or virtually, by 
"warping" your engine processing loop so it can generate any number of sample 
frames requested, allowing it to be used directly from the audio callback.

--

-- 
//David Olofson - Consultant, Developer, Artist, Open Source Advocate

.--- Games, examples, libraries, scripting, sound, music, graphics ---.
|   http://consulting.olofson.net          http://olofsonarcade.com   |
'---------------------------------------------------------------------'
Jeff Post | 1 May 2011 02:49

Re: Example Of "Ray Casting" With SDL1.2+OpenGL?

On Saturday 30 April 2011 16:22, Bob Pendleton wrote:
>
> If someone wants to learn 3D graphics my suggestion is to go to the
> web site of of a college that is language and culture appropriate for
> you, look up the entry level computer graphics programming course, and
> find the text book they are using. Then get a copy of that text book
> and read it. Do the problems at the ends of chapters. And get on with
> learning. A lot of colleges are putting entire courses on line for
> free. You can just go an read the material. You might have to get the
> text books, but that is cheap compared to taking the classes.
>
> Or, you might even start by asking people to recommend web sites and
> books to read. Do not believe that you are qualified to figure out
> what is the right first thing to study. Do, try to do a lot of
> programming and expect to throw most of it away. :-)
>
Bob, you never cease to amaze me. This is excellent advice and very well put. 
Those who wish to learn programming (or really any discipline) would be well 
advised to take it seriously. I speak both as a former software engineer and 
as a current college instructor.

Jeff
Matthew Orlando | 1 May 2011 05:10
Picon
Gravatar

Re: small patch to fix warning

I understand that, and agree. I just think it's time to move on from C89 ;)


On Sat, Apr 30, 2011 at 11:21 AM, Torsten Giebl <wizard <at> syntheticsw.com> wrote:
Hello !



of course one could add that - but that's not the point imo. SDL can use
whatever c version it wants, but should not force the users of sdl to
use a particular compiler option or c version (resp. should allow to
compile your software without warnings with -pedantic imo). and as this
header is included by SDL.h everyone using -pedantic will get these
warnings.


When it is possible, by just removing a "," to make old compilers happy,
then we should do it. It is the same thing with /* */ and //


CU

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



--
Matthew Orlando
http://cogwheel.info
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Matthew Orlando | 1 May 2011 05:19
Picon
Gravatar

Re: [SDL_Mixer]: Preliminary music integration



On Fri, Apr 29, 2011 at 7:49 PM, Mason Wheeler <masonwheeler <at> yahoo.com> wrote:
I just submitted issue #1194 to Bugzilla, containing a patch for SDL_Mixer. This
patch updates the API to require music to play on a channel, just like sound,
instead of living in a separate "world".  Among other things, this means that
SDL_Mixer effects can now be attached to music.


Very nice :)
 

This has been tested and will work properly with one or more songs, at least
with libmodplug; haven't tested the other decoders yet, and I know that playing
multiple songs from a WAV source will definitely not work.

Do you mean a single wave source? If so, are you loading the file by name or are you opening the RWops yourself? The wave music loader stores the open RWops and reads directly from the filesystem as needed (see bug 1168). If you load the music by filename or if you create two SDL_RWops from the same file it will create two separate handles and should work in theory...

--
Matthew Orlando
http://cogwheel.info
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Mason Wheeler | 1 May 2011 05:25
Picon
Favicon

Re: [SDL_Mixer]: Preliminary music integration

I'm talking about all the places in music.c where the massive switchboards say "case MUS_WAV:" and then execute a WAVStream_* command that does not take music_playing->data.wave as a parameter.  That means that the WAVStream API is stateful and is storing a single stream internally.

I just looked at wavstream.c, and it's right there, about 90 lines in:

/* Currently we only support a single stream at a time */
static WAVStream *music = NULL;

That will have to change, if anyone cares enough to change it. Right now I'm busy with other things.

From: Matthew Orlando <maorlando <at> gmail.com>
Subject: Re: [SDL] [SDL_Mixer]: Preliminary music integration

This has been tested and will work properly with one or more songs, at least
with libmodplug; haven't tested the other decoders yet, and I know that playing
multiple songs from a WAV source will definitely not work.

Do you mean a single wave source? If so, are you loading the file by name or are you opening the RWops yourself? The wave music loader stores the open RWops and reads directly from the filesystem as needed (see bug 1168). If you load the music by filename or if you create two SDL_RWops from the same file it will create two separate handles and should work in theory...

--
Matthew Orlando
http://cogwheel.info
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
David Demelier | 1 May 2011 09:51
Picon
Gravatar

Fail to build src/joystick/bsd/SDL_sysjoystick.c on FreeBSD

Hello,

The joystick code does not build on FreeBSD 8.2 and the last revision, see :

/bin/sh ./libtool --mode=compile gcc -g -O3 -I./include  -mmmx -msse 
-msse2 -fvisibility=hidden  -I/usr/X11R6/include -DHAVE_USBHID_H 
-DUSBHID_NEW -D_REENTRANT -D_THREAD_SAFE -MMD -MT 
build/SDL_sysjoystick.lo -c src/joystick/bsd/SDL_sysjoystick.c -o 
build/SDL_sysjoystick.lo
libtool: compile:  gcc -g -O3 -I./include -mmmx -msse -msse2 
-fvisibility=hidden -I/usr/X11R6/include -DHAVE_USBHID_H -DUSBHID_NEW 
-D_REENTRANT -D_THREAD_SAFE -MMD -MT build/SDL_sysjoystick.lo -c 
src/joystick/bsd/SDL_sysjoystick.c  -fPIC -DPIC -o 
build/.libs/SDL_sysjoystick.o
src/joystick/bsd/SDL_sysjoystick.c: In function 'SDL_SYS_JoystickUpdate':
src/joystick/bsd/SDL_sysjoystick.c:465: error: dereferencing pointer to 
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:489: error: dereferencing pointer to 
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:499: error: dereferencing pointer to 
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:507: error: dereferencing pointer to 
incomplete type
src/joystick/bsd/SDL_sysjoystick.c: In function 'report_alloc':
src/joystick/bsd/SDL_sysjoystick.c:588: error: dereferencing pointer to 
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:588: error: dereferencing pointer to 
incomplete type
gmake: *** [build/SDL_sysjoystick.lo] Error 1

Cheers,

--

-- 
David Demelier
Martin Gerhardy | 1 May 2011 11:41
Picon
Gravatar

sdl 1.3 - segfault in SDL_image when loading indexed png

hi

i'm getting a segfault when trying to load the attached png with sdl 1.3
and SDL_image (both from HG repo - updated yesterday)

once i converted the png into rgba it loads fine.

---------------------snip-----------------------------
#0  IMG_LoadPNG_RW (src=<value optimized out>) at IMG_png.c:523
#1  0x00007ffff6d80e8c in IMG_LoadTyped_RW (src=0x7f04800, freesrc=0,
type=0x5b5160 "png") at IMG.c:182
---------------------snap-----------------------------

here is the relevant part of the stacktrace.
---------------------snip-----------------------------
Program received signal SIGSEGV, Segmentation fault.
IMG_LoadPNG_RW (src=<value optimized out>) at IMG_png.c:523
523			palette->ncolors = png_num_palette; 
(gdb) bt
#0  IMG_LoadPNG_RW (src=<value optimized out>) at IMG_png.c:523
#1  0x00007ffff6d80e8c in IMG_LoadTyped_RW (src=0x7f04800, freesrc=0,
type=0x5b5160 "png") at IMG.c:182
#2  0x000000000055495b in Img_LoadTypedImage (name=0x7fffffffe020
"pics/cursors/reactionfire", type=0x5b5160 "png") at
src/shared/images.c:314
(gdb) p *palette
Cannot access memory at address 0x83000801
---------------------snap-----------------------------

any idea?

---

gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Ubuntu 10.10 amd64

Attachment (config.log.sdl.bz2): application/x-bzip, 13 KiB
Attachment (config.log.sdl_image.bz2): application/x-bzip, 6236 bytes
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Martin Gerhardy | 1 May 2011 11:59
Picon
Gravatar

sdl 1.3 - segfault in SDL_image when loading indexed png

the bug was introduced in this revision:

http://hg.libsdl.org/SDL_image/rev/87ec529fd6ce
Martin Gerhardy | 1 May 2011 12:01
Picon
Gravatar

sdl 1.3 - segfault in SDL_image when loading indexed png

err sorry. this is the last working revision:

http://hg.libsdl.org/SDL_image/rev/87ec529fd6ce

and this revision introduced it:

http://hg.libsdl.org/SDL_image/rev/7264bae1db63

Gmane