SDL_mixer + SDL_RWops

Currently to load data from a data file using SDL_mixer or to convert it
and then load it using SDL_mixer you have to use the dirty hack of
writing it to a temp file and then reading it.the best solution for
fixing this seems to be to rewrite it to use SDL_RWops. is anyone
curently working on doing this? and is it alright to rewrite the stuff
in the timidity directory?

I am also interested in this - I had been pondering messing with the mikmod
directory. It loads wave files with SDL_RWops, I believe - it is only the
3rd-party MID & MOD support that is file-dependent.

If nobody else is already doing this, I think I’ll try to convert the mikmod
directory to SDL_RWops.

-Matt

Currently to load data from a data file using SDL_mixer or to convert it
and then load it using SDL_mixer you have to use the dirty hack of
writing it to a temp file and then reading it.the best solution for
fixing this seems to be to rewrite it to use SDL_RWops. is anyone
curently working on doing this? and is it alright to rewrite the stuff
in the timidity directory?

Currently to load data from a data file using SDL_mixer or to convert it
and then load it using SDL_mixer you have to use the dirty hack of
writing it to a temp file and then reading it.the best solution for
fixing this seems to be to rewrite it to use SDL_RWops. is anyone
curently working on doing this? and is it alright to rewrite the stuff
in the timidity directory?

I am also interested in this - I had been pondering messing with the mikmod
directory. It loads wave files with SDL_RWops, I believe - it is only the
3rd-party MID & MOD support that is file-dependent.

If nobody else is already doing this, I think I’ll try to convert the mikmod
directory to SDL_RWops.

Go for it. I’m accepting all patches.
Please don’t break backward compatibility. Add a new function, in the same
way there are extended RWops functions for SDL_LoadWAV() and SDL_LoadBMP()

Thanks! :slight_smile:
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

if you wana convert the mikmod directory i think im gona do the timidity dir so
send me the patch when ya get done and ill merge it all , and if anyone else
wants to help tell me.

the way im planning on doing it renameing the function to name_RWops and
converting it to use RWops, then write a wraper with the old function name that
loads it into an RWops structureand passes it to the RWops version. this sound
good to you?

matt at campbellhome.dhs.org wrote:> > Currently to load data from a data file using SDL_mixer or to convert it

and then load it using SDL_mixer you have to use the dirty hack of
writing it to a temp file and then reading it.the best solution for
fixing this seems to be to rewrite it to use SDL_RWops. is anyone
curently working on doing this? and is it alright to rewrite the stuff
in the timidity directory?

I am also interested in this - I had been pondering messing with the mikmod
directory. It loads wave files with SDL_RWops, I believe - it is only the
3rd-party MID & MOD support that is file-dependent.

If nobody else is already doing this, I think I’ll try to convert the mikmod
directory to SDL_RWops.

-Matt

using the below code without the stencil buffer line It works fine
but with the stencil buffer line it starts and bombs out with :

“Unable to create OpenGL screen: could not determine glx visual info”

this is using SDL ver 1.1.2 and XFree86 4 with the opengl Dri for
voodoo banshee working perfectly …

    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5);
    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
    SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 2 );

SDL_SetVideoMode(w, h, 16, SDL_OPENGL | SDL_FULLSCREEN)

thanks,
Oliver Batchelor

Voodoo cards doesn’t have stencil buffer.

 GLX is unable to satisfy your request.

                        Franck

Oliver Batchelor wrote:>

using the below code without the stencil buffer line It works fine
but with the stencil buffer line it starts and bombs out with :

“Unable to create OpenGL screen: could not determine glx visual info”

this is using SDL ver 1.1.2 and XFree86 4 with the opengl Dri for
voodoo banshee working perfectly …

    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5);
    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
    SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 2 );

SDL_SetVideoMode(w, h, 16, SDL_OPENGL | SDL_FULLSCREEN)

thanks,
Oliver Batchelor

Franck Guillaud schrieb am 26 Apr 2000:

using the below code without the stencil buffer line It works fine
but with the stencil buffer line it starts and bombs out with :

“Unable to create OpenGL screen: could not determine glx visual info”

this is using SDL ver 1.1.2 and XFree86 4 with the opengl Dri for
voodoo banshee working perfectly …

    SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 2 );

SDL_SetVideoMode(w, h, 16, SDL_OPENGL | SDL_FULLSCREEN)

Voodoo cards doesn’t have stencil buffer.
GLX is unable to satisfy your request.

Well, glx should fallback to software rendering then, shouldn’t it?

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.53)

“Andreas Umbach” wrote:

Franck Guillaud schrieb am 26 Apr 2000:

using the below code without the stencil buffer line It works fine
but with the stencil buffer line it starts and bombs out with :

“Unable to create OpenGL screen: could not determine glx visual info”

this is using SDL ver 1.1.2 and XFree86 4 with the opengl Dri for
voodoo banshee working perfectly …

    SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 2 );

SDL_SetVideoMode(w, h, 16, SDL_OPENGL | SDL_FULLSCREEN)

Voodoo cards doesn’t have stencil buffer.
GLX is unable to satisfy your request.

Well, glx should fallback to software rendering then, shouldn’t it?

Well, AFAIK, glX doesn't know anything about software or hardware

rendering, it’s
just a glu between OpenGL implementation and the X11 windowing system.
But you’re almost right :the
Opengl driver should fallback to software rendering if it couldn’t
satisfy the GlX request.

It’s seems that here the Voodoo DRI driver prefers to reject the
request than
satisfying it with very very bad perfs.

                           Franck.

Damn that means I cant use shadows/reflection or anything !! ugg ! I
was looking foward to doing that.

Voodoo banshee cards do do multi texture dont they ?? I tried that
out and it went awful slow … if they dont then how does quake3
do its multi texture on the voodoo ?

Oliver BatchelorOn Wed, 26 Apr 2000, you wrote:

Voodoo cards doesn’t have stencil buffer.

 GLX is unable to satisfy your request.

                        Franck

Oliver Batchelor wrote:

using the below code without the stencil buffer line It works fine
but with the stencil buffer line it starts and bombs out with :

“Unable to create OpenGL screen: could not determine glx visual info”

this is using SDL ver 1.1.2 and XFree86 4 with the opengl Dri for
voodoo banshee working perfectly …

    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5);
    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
    SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 2 );

SDL_SetVideoMode(w, h, 16, SDL_OPENGL | SDL_FULLSCREEN)

thanks,
Oliver Batchelor

Oliver Batchelor wrote:

Damn that means I cant use shadows/reflection or anything !! ugg ! I
was looking foward to doing that.

Voodoo banshee cards do do multi texture dont they ?? I tried that
out and it went awful slow … if they dont then how does quake3
do its multi texture on the voodoo ?

You can use projected texture to do this. Using a two passes
algorithm.

First pass, draw your scene
Calculate shadow and reflexion texture
Second pass, render (over the first) scene with shadow & reflection
textures, blending enabled.

You’ll find source code for this in the mesa distrib and the glut
distrib.

                   Franck.

Oliver Batchelor schrieb am 27 Apr 2000:

Voodoo banshee cards do do multi texture dont they ?? I tried that
out and it went awful slow … if they dont then how does quake3
do its multi texture on the voodoo ?

You are using the GL_ARB_multitexture extension, aren’t you?

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.53)

Would a two passes algorithm be twice as slow ?
I am trying to make this quite fast for use in flying over a
landscape type thing …
I have display lists for all the objects
and to do that I would need to stop using them…

To do the shadow and reflection I would still need stencil buffer or
it would go there no matter what even if nothing was there wouldnt it
?

so basically it would be better to do a double rendering rather than
use the gl multi texture ARB thing’s.

thanks,
Oliver BatchelorOn Thu, 27 Apr 2000, you wrote:

Oliver Batchelor wrote:

Damn that means I cant use shadows/reflection or anything !! ugg ! I
was looking foward to doing that.

Voodoo banshee cards do do multi texture dont they ?? I tried that
out and it went awful slow … if they dont then how does quake3
do its multi texture on the voodoo ?

You can use projected texture to do this. Using a two passes
algorithm.

First pass, draw your scene
Calculate shadow and reflexion texture
Second pass, render (over the first) scene with shadow & reflection
textures, blending enabled.

You’ll find source code for this in the mesa distrib and the glut
distrib.

                   Franck.

Oliver Batchelor wrote:

Would a two passes algorithm be twice as slow ?
I am trying to make this quite fast for use in flying over a
landscape type thing …
I have display lists for all the objects
and to do that I would need to stop using them…

If display list are correctly managed by the driver (cached), you can
do the
second pass at virtually no cost. The algorithm would be :

  1. Calculate shadow texture
  2. first Pass : render scene
  3. second pass : render scene with projected shadow texture

However, if you first rendering is fill rate limited, the second
pass may have a non negligeable cost.

To do the shadow and reflection I would still need stencil buffer or
it would go there no matter what even if nothing was there wouldnt it
?

so basically it would be better to do a double rendering rather than
use the gl multi texture ARB thing’s.

I’m surprised that Voodoo 3 doesn’t support multitexture.

Did you try to run the Mesa multi-texture demo ? Which GL driver are
you using ?

             Franck.

Franck Guillaud wrote:

so basically it would be better to do a double rendering rather than
use the gl multi texture ARB thing’s.

I’m surprised that Voodoo 3 doesn’t support multitexture.

He mentioned the Voodoo Banshee, which 3D core is a derivative of the
original Voodoo Graphics, which has a single texture unit.

I think Voodoo2 supports two textures and the Voodoo3 four textures.–
Pierre Phaneuf
Systems Exorcist

Voodoo Banshee is a Voodoo 2 with only on texture unit and a 2d core.On Fri, 28 Apr 2000, Pierre Phaneuf wrote:

Franck Guillaud wrote:

so basically it would be better to do a double rendering rather than
use the gl multi texture ARB thing’s.

I’m surprised that Voodoo 3 doesn’t support multitexture.

He mentioned the Voodoo Banshee, which 3D core is a derivative of the
original Voodoo Graphics, which has a single texture unit.

I think Voodoo2 supports two textures and the Voodoo3 four textures.


Pierre Phaneuf
Systems Exorcist

Martin

Bother! said Pooh, I need a honey glaze for Piglet.

so I would be quite stupid to use multi texture as it would be done
in software

  • but im wondering how the hell quake 3 does it ? (and it does
    it fast)
    does quake3 do another render to do its lightmaps or what ?

Oliver

Actually, that’s precisely what it does. It’s called multipass
texturing. It does an unlit render, locks the depth buffer, then
renders the lightmaps. In order to make it work right, you need to
either set the depth test to GL_LEQUAL or apply a polygon offset. I
would suggest changing the depth test, though. It’s easier, more
efficient, and never causes visual artifacts (at least, not that I’ve
seen).

  ,---------------------------------------------------------.
 / _/_/_/    _/_/_/  _/        _/    _/_/   Michael Powell  /
/ _/    _/  _/      _/      _/  _/  _/  _/                 /

/ //_/ // / /// // Aspiring /
/ _/ _/ _/ _/ _/ / / / Video Game /
/ //
/ //
/ //
/ _/ _/ _/ _/ Programmer /
`---------------------------------------------------------’

so I would be quite stupid to use multi texture as it would be done
in software

  • but im wondering how the hell quake 3 does it ? (and it does
    it fast)
    does quake3 do another render to do its lightmaps or what ?

OliverOn Sat, 29 Apr 2000, you wrote:

Voodoo Banshee is a Voodoo 2 with only on texture unit and a 2d core.

On Fri, 28 Apr 2000, Pierre Phaneuf wrote:

Franck Guillaud wrote:

so basically it would be better to do a double rendering rather than
use the gl multi texture ARB thing’s.

I’m surprised that Voodoo 3 doesn’t support multitexture.

He mentioned the Voodoo Banshee, which 3D core is a derivative of the
original Voodoo Graphics, which has a single texture unit.

I think Voodoo2 supports two textures and the Voodoo3 four textures.


Pierre Phaneuf
Systems Exorcist

Martin

Bother! said Pooh, I need a honey glaze for Piglet.