James Turk | 1 Dec 05:29 2002
Picon

OpenGL and SDL, Weird Alpha Problem

I am currently working on changing the drawing portion of my code to 
OpenGL Ortho, while still using SDL for everything else.  I have run 
into a fairly strange error where my color-keyed images (using 255,0,255 
for the key) are being drawn with a white background (the pink is simply 
replaced with white).  I am calling SDL_SetColorKey and then 
SDL_DisplayFormatAlpha, which I was told is the correct way to use color 
keys in OpenGL.  (by the way, blending is enabled.. and I've tried 
almost every combination of arguments to glBlendFunc that I could find. 
  Is there something else that needs to be done on the SDL side, or am I 
missing some GL code somewhere)
James Turk | 1 Dec 06:59 2002
Picon

Re: OpenGL and SDL, Weird Alpha Problem

James Turk wrote:
> I am currently working on changing the drawing portion of my code to 
> OpenGL Ortho, while still using SDL for everything else.  I have run 
> into a fairly strange error where my color-keyed images (using 255,0,255 
> for the key) are being drawn with a white background (the pink is simply 
> replaced with white).  I am calling SDL_SetColorKey and then 
> SDL_DisplayFormatAlpha, which I was told is the correct way to use color 
> keys in OpenGL.  (by the way, blending is enabled.. and I've tried 
> almost every combination of arguments to glBlendFunc that I could find. 
>  Is there something else that needs to be done on the SDL side, or am I 
> missing some GL code somewhere)
> 

Sorry.. it turned out to be a simple GL problem as well as a small 
problem in my own thinking.  :D
Chris | 1 Dec 15:03 2002
Picon

SDL_GetTicks() accuracy ?

Hi, I wonder what is the minimal time difference en milliseconds between two
calls to SDL_GetTicks() (win32 platform) ?

Thanks

___________________________________________________________
Do You Yahoo!? -- Une adresse  <at> yahoo.fr gratuite et en fran├žais !
Yahoo! Mail : http://fr.mail.yahoo.com
luigi | 1 Dec 22:05 2002
Picon

can't write a suitable SDL_RWops

hi I'm trying to write a suitable routine which played, using SDL, an mp3 
track included in an avi file. (I can play wave tracks, but ,obviously, avi 
files are encoded using maily mp3 [or vorbis]). Here is part of my code:

//****RWops
static int _mymem_seek(SDL_RWops *context, int offset, int whence)
{
    return 0;
}

static int _mymem_read(SDL_RWops *context, void *ptr, int size, int maxnum)
{
	LGSdl *LL;
	unsigned char *rwbuf = (unsigned char *) context->hidden.unknown.data1;
	size_t nread = LL->read_buffer(rwbuf, size);
	return nread /size;
}

static int _mymem_write(SDL_RWops *context, const void *ptr, int size, int 
num)
{
    return 0;
}

static int _mymem_close(SDL_RWops *context)
{
	if ( context ) 
	{
		if ( context->hidden.unknown.data1 ) 
		{
(Continue reading)

Mika Halttunen | 1 Dec 16:10 2002
Picon
Picon

Re: sdl surface -> ogl texture & transparency

Chris Thielen wrote:
> anyway, i tried using the function and the
> texture's appear completely white. i attached my source code and i'm
> loading a png that just has a hole in it, but none of the texture data
> appears.
> 
> do you know what could be wrong? why is the texture white?

I don't have time right now to completely review the code you attached,
but it seems that you're missing the mipmap generation code. I mean,
you set texture properties to have mipmapping (glTexParameteri) but
you don't call gluBuild2DMipmaps at all..?

Try placing following line after your glTexParameteri's:

gluBuild2DMipmaps(GL_TEXTURE_2D, type, img->w, img->h, type,\ 
GL_UNSIGNED_BYTE, data);

And you have to link with GLU libs of course.
That could be the problem.

--
Mika Halttunen
lsoft <at> mbnet.fi
Gaston | 1 Dec 13:14 2002
Picon

effects of light without OpenGl

HI! I 'm a new SDL programer. Actually, I 'm working on a new MMORPG. I was 
looking the fade out example. It 's works good and fast. Now, I would like to 
add a lot of ligth to the dark surface on specific place. For example on a 
fire.
For this I dark all the surface (with fade out example) then I should add the 
light, but. How I can do it without OpenGL?
It is really necessary OpenGl?

Thank you...

Gaston
Rainer Deyke | 1 Dec 17:59 2002

Re: can't write a suitable SDL_RWops

luigi wrote:
> SDL_RWops *SDL_RWFromMemoria(void *mem, int size)

1. Don't ever name your own functions SDL_something.

2. Use SDL_RWFromMem.

--
Rainer Deyke | root <at> rainerdeyke.com | http://rainerdeyke.com
David S | 1 Dec 18:03 2002
Picon

SDL_main issues

I am having a problem compiling some appications.  I am not sure why, since
this is the same SDL implementation that I use to compile MaxMame, MaxMess and
MaxUAE (All for Qtopia).

SDL is installed a little different then usual.  I installed it into my
directory on handhelds.org, which is /home/guest/dsolomo1 <at> maine.rr.com/Qtopia. 
Since SDL does not like the ' <at> ' symbol in the directory, I symlinked this to
/home/guest/Qtopia and reinstalled all of the libraries into the symlinked
directory.  This has worked fine for many applications, but some fail with the
message below during linking:

/home/guest/Qtopia/lib/libSDLmain.a(SDL_Qtopia_main.o): In function `main':
/home/guest/Qtopia/SDL/SDL12/src/main/SDL_Qtopia_main.cc:27: undefined
reference to `SDL_main'
collect2: ld returned 1 exit status

Any ideas what could be wrong?

David

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Corona688 | 1 Dec 18:11 2002
Picon

Re: SDL_GetTicks() accuracy ?

SDL_GetTicks() seems accurate down to +-1 tick or so.  SDL_Delay() is only
accurate to 10 ticks, though.

Chris wrote:

> Hi, I wonder what is the minimal time difference en milliseconds between two
> calls to SDL_GetTicks() (win32 platform) ?
>
> Thanks
>
> ___________________________________________________________
> Do You Yahoo!? -- Une adresse  <at> yahoo.fr gratuite et en fran├žais !
> Yahoo! Mail : http://fr.mail.yahoo.com
>
> _______________________________________________
> SDL mailing list
> SDL <at> libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
Duncan Hughes | 1 Dec 19:38 2002
Picon
Picon

debugging SDL

Hi Folks, I'm new to SDL and I'm finding debugging a bit of a nightmare.  I'm 
working mostly from the console in mipsEEel-linux and find that certain 
operations will cause my code to crash, SDL seems to take complete control of 
the input devices on my system and i can't swap to another virtual terminal 
to kill the process off or even reset the system and i'm forced to do a hard 
reboot.
Is there a way I can get back to a shell once SDL has crashed?  I don't really 
want to work in X because of the speed difference.

Thanks 
dunch.
--

-- 
________________________________________
Duncan Hughes (duncan <at> dunch.demon.co.uk)
________________________________________

Gmane