SDL_Surface troubles

Banzai!

I wrote a putpixel function which is defined something like this:

int putpixel (SDL_Surface *dest, int X, int Y, int R, int G, int B);

this function works if I call it from main() and there’s no trouble with it.

However if I call it from another function, like this:

int do_something (SDL_Surface *dest)
{

putpixel(dest, 10, 10, 0xFF, 0xFF, 0);

}

Parachute will open and SDL will go down in flames…

Any hints on this one?

Thanks,
David!---------------
Windows 2000 – Are they related to Word-Star 2000?

int do_something (SDL_Surface *dest)
{
putpixel(dest, 10, 10, 0xFF, 0xFF, 0);
}

Show us the line you use when calling do_something and the
decleration of the original SDL_Surface.

ThomasOn 21 Nov 00, at 14:00, David Klasinc wrote:

Is your surface locked when you write to it?

putpixel(dest, 10, 10, 0xFF, 0xFF, 0);
}

Show us the line you use when calling do_something and the
decleration of the original SDL_Surface.

Ah, forget about it. I was the cause for my troubles again. ;>

I was filling an array of ints just before putting pixel on the screen. The
array was 1500 elements or so and I ‘filled in’ 1600 and more. :wink:

It messed up SDL_Surface pretty bad… :slight_smile:

David!On Tue, Nov 21, 2000 at 05:45:36PM +0100, tts at image.dk wrote:

My other operating system was not made by Microsoft! (I never said that the
first one was.)