SDL_main() and main()

SDL 1.1.1

I?v replaced all references to "SDL_main() "  with "main()" in files

SDL_main.h and SDL_main.c .This was necessary in order
to avoid linking problems with Borland Bcc32 (5.5 free).

I?m I preparing future problems?

Are you include “SDL.h” in the file containing your main() function?

Are you linking with SDLmain.lib?

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

SDL 1.1.1

I?v replaced all references to "SDL_main() "  with "main()" in files

SDL_main.h and SDL_main.c .This was necessary in order
to avoid linking problems with Borland Bcc32 (5.5 free).

I?m I preparing future problems?

Hi all,

I am looking at the pixels of an SDL_Surface without modifying the
pixel values (inspection only). Do I need to lock the surface
before I inspect the values, or is it only necessary to lock the
surface when I actually intend on changing the pixel values?

SDL_LockSurface( mySfc );  /* Should check return value */

for()  {/* loop on "pixOffset" */
	pixel = *((Uint32 *)mySfc->pixels + pixOffset);  /* Reading only */
	DoSomething;
}

SDL_UnlockSurface( mySfc );

Sorry for the newbie question. Answer seems obvious but I wanted
to make sure before I take out the locks.

Thanks,

Steve Madsen

Hi all,

I am looking at the pixels of an SDL_Surface without modifying the
pixel values (inspection only). Do I need to lock the surface
before I inspect the values, or is it only necessary to lock the
surface when I actually intend on changing the pixel values?

SDL_LockSurface( mySfc ); /* Should check return value */

for() {/* loop on “pixOffset” */
pixel = *((Uint32 )mySfc->pixels + pixOffset); / Reading only */
DoSomething;
}

SDL_UnlockSurface( mySfc );

Sorry for the newbie question. Answer seems obvious but I wanted
to make sure before I take out the locks.

the demopage: works hard on a surface changing also pixels values and
without locking it. I’m using that algorithm in my sourcecode and i also
reached to blit the water surface (SDL_BlitSurface) on the screen surface
without any pain. I saw also by experience that some problem comes if on
the directly accessed surface you do SDL_DisplayFormat.

jrmlOn Tue, 21 Mar 2000, Steve Madsen wrote:
from my experience not. you can also take a look on the water effect in

In article <4.3.1.20000321111738.00bae610 at wingate>, steve at h2eye.com
says…

Hi all,

I am looking at the pixels of an SDL_Surface without modifying the
pixel values (inspection only). Do I need to lock the surface
before I inspect the values, or is it only necessary to lock the
surface when I actually intend on changing the pixel values?

SDL_LockSurface( mySfc ); /* Should check return value */

for() {/* loop on “pixOffset” */
pixel = *((Uint32 )mySfc->pixels + pixOffset); / Reading only */
DoSomething;
}

SDL_UnlockSurface( mySfc );

Sorry for the newbie question. Answer seems obvious but I wanted
to make sure before I take out the locks.

ALWAYS lock your surfaces, as you should never assume that they 

are software surfaces. hardware surfaces MUST be locked prior to
accessing mySfc->pixels (SDL structure) as the pointer is null untill
the lock is achieved.

i took out my locks to add speed and simplify the code (though i 

was being clever) it bit me in the ass as soon as i began using hardware
surfaces and it took me 3 days to debug it !

-dv

ALWAYS lock your surfaces, as you should never assume that they
are software surfaces. hardware surfaces MUST be locked prior to
accessing mySfc->pixels (SDL structure) as the pointer is null untill
the lock is achieved.

i took out my locks to add speed and simplify the code (though i
was being clever) it bit me in the ass as soon as i began using hardware
surfaces and it took me 3 days to debug it !

so now it comes to my a question:
wich hardware is supported to gain hardware surfaces with SDL under linux?
i tried with:
Xfree 3.5 with & without glx module
Xfree 4.0

with a diamond viper v330 (RIVA128) pci
and a TNT2 ULTRA agp (with agpgart module)
in every combination

and i never obtained to have an hardware surface.

jrmlOn Wed, 22 Mar 2000, Daniel wrote:

Sam

I’v generated a new SDL_main.lib from SDL_main.c
And the test programs compiled just fine (wich include SDL.h).

AMFVargas> ----- Original Message -----

From: slouken@devolution.com (Sam Lantinga)
To:
Sent: Tuesday, March 21, 2000 4:57 AM
Subject: Re: [SDL] SDL_main() and main()

SDL 1.1.1

I?v replaced all references to "SDL_main() "  with "main()" in files

SDL_main.h and SDL_main.c .This was necessary in order
to avoid linking problems with Borland Bcc32 (5.5 free).

I?m I preparing future problems?

Are you include “SDL.h” in the file containing your main() function?

Are you linking with SDLmain.lib?

-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

so now it comes to my a question:
wich hardware is supported to gain hardware surfaces with SDL under linux?
i tried with:
Xfree 3.5 with & without glx module
Xfree 4.0

with a diamond viper v330 (RIVA128) pci
and a TNT2 ULTRA agp (with agpgart module)
in every combination

and i never obtained to have an hardware surface.

This will come with DGA 2.0 when the driver is written.

See ya,
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec