SDL Bug

Hi all,
I think I found a bug in SDL (linux - ubuntu), I made a tetris clone where it blits a green background and some boxes (still in the beginning) and that’s the first game I’m trying to make (other than some other tetris clones which I gave up before completing)
when I run the program sometimes it works (and that’s rare) and most of the times even when I recompile the exact same code that worked, it clips the stuff in the <30x30 box in the top left
It’s really stupid and I even tried to use SDL_SetClipRect but nothing worked
I attached the code if you want to know what caused the bug

I use Netbeans 7.1 as the IDE, G++ 4.6 as the compiler and C++ as my language, I use the SDL version in the repos which is 1.2.14
my Graphics card is an nVidia GeForce 9500 GT

Please reply ASAP

Thank you very much,
Ahmed Mustafa Nematallah

-------------- next part --------------
A non-text attachment was scrubbed…
Name: main.cpp
Type: text/x-c++src
Size: 2477 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120130/fbe3e21a/attachment.cpp

2012/1/30 Ahmed Nematallah <ahmed_nematallah at hotmail.com>

Hi all,
I think I found a bug in SDL (linux - ubuntu), I made a tetris clone where
it blits a green background and some boxes (still in the beginning) and
that’s the first game I’m trying to make (other than some other tetris
clones which I gave up before completing)
when I run the program sometimes it works (and that’s rare) and most of
the times even when I recompile the exact same code that worked, it clips
the stuff in the <30x30 box in the top left

It looks like bug 1397 http://bugzilla.libsdl.org/show_bug.cgi?id=1397--
Gabriel.

and…
how can I overcome this bug or fix it
I’ve been using SDL for months now and never seen this bug on windows or linux
I’ve Just seen it yesterday

and please tell me if this is the best place to ask this question or is there a better place, I’ve not seen a helping mailing list or so, and on stackoverflow I’ve not received except one answer and it didn’t help a lot.

Thank you,
Ahmed Musatafa NematallahDate: Mon, 30 Jan 2012 14:43:25 -0300
From: gabomdq@gmail.com
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL Bug

2012/1/30 Ahmed Nematallah <@Ahmed_Nematallah>

Hi all,
I think I found a bug in SDL (linux - ubuntu), I made a tetris clone where it blits a green background and some boxes (still in the beginning) and that’s the first game I’m trying to make (other than some other tetris clones which I gave up before completing)

when I run the program sometimes it works (and that’s rare) and most of the times even when I recompile the exact same code that worked, it clips the stuff in the <30x30 box in the top left

It looks like bug 1397 http://bugzilla.libsdl.org/show_bug.cgi?id=1397

Gabriel.


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

I’m not able to reproduce on Kubuntu. Can you post a screenshot?

When I ran the program, I first got a black screen. Subsequent tries give
me four red blocks in the upper left on a green field.

I’m suspicious of using 0 for all of the masks in SDL_CreateRGBSurface().

Jonny D

2012/1/30 Ahmed Nematallah <ahmed_nematallah at hotmail.com>> and…

how can I overcome this bug or fix it
I’ve been using SDL for months now and never seen this bug on windows or
linux
I’ve Just seen it yesterday

and please tell me if this is the best place to ask this question or is
there a better place, I’ve not seen a helping mailing list or so, and on
stackoverflow I’ve not received except one answer and it didn’t help a lot.

Thank you,
Ahmed Musatafa Nematallah


Date: Mon, 30 Jan 2012 14:43:25 -0300
From: gabomdq at gmail.com
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL Bug

2012/1/30 Ahmed Nematallah <ahmed_nematallah at hotmail.com>

Hi all,
I think I found a bug in SDL (linux - ubuntu), I made a tetris clone where
it blits a green background and some boxes (still in the beginning) and
that’s the first game I’m trying to make (other than some other tetris
clones which I gave up before completing)
when I run the program sometimes it works (and that’s rare) and most of
the times even when I recompile the exact same code that worked, it clips
the stuff in the <30x30 box in the top left

It looks like bug 1397 http://bugzilla.libsdl.org/show_bug.cgi?id=1397


Gabriel.

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


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

Zero is OK for colors, maybe the alpha needs to be checked.

http://sdl.beuc.net/sdl.wiki/SDL_CreateRGBSurface

*Using zeros for the RGB masks sets a default value, based on the depth.
(e.g. SDL_CreateRGBSurface(flags,w,h,32,0,0,0,0):wink: However, using zero for
the Amask results in an Amask of 0.*On Mon, Jan 30, 2012 at 12:02 PM, Jonathan Dearborn wrote:

I’m not able to reproduce on Kubuntu. Can you post a screenshot?

When I ran the program, I first got a black screen. Subsequent tries give
me four red blocks in the upper left on a green field.

I’m suspicious of using 0 for all of the masks in SDL_CreateRGBSurface().

Jonny D

2012/1/30 Ahmed Nematallah <ahmed_nematallah at hotmail.com>

and…
how can I overcome this bug or fix it
I’ve been using SDL for months now and never seen this bug on windows or
linux
I’ve Just seen it yesterday

and please tell me if this is the best place to ask this question or is
there a better place, I’ve not seen a helping mailing list or so, and on
stackoverflow I’ve not received except one answer and it didn’t help a lot.

Thank you,
Ahmed Musatafa Nematallah


Date: Mon, 30 Jan 2012 14:43:25 -0300
From: gabomdq at gmail.com
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL Bug

2012/1/30 Ahmed Nematallah <ahmed_nematallah at hotmail.com>

Hi all,
I think I found a bug in SDL (linux - ubuntu), I made a tetris clone
where it blits a green background and some boxes (still in the beginning)
and that’s the first game I’m trying to make (other than some other tetris
clones which I gave up before completing)
when I run the program sometimes it works (and that’s rare) and most of
the times even when I recompile the exact same code that worked, it clips
the stuff in the <30x30 box in the top left

It looks like bug 1397 http://bugzilla.libsdl.org/show_bug.cgi?id=1397


Gabriel.

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


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


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

I had to forward this again because it has to wait moderation to make that attachment get recieved

here’s the image again http://img560.imageshack.us/img560/7150/screenshotat20120130213.png
and the body

Here’s a picture
take a look
and how do subsequent tries give different results
the results you got (a green background with four red blocks is what should appear)
using 0s in SDL_CreateRGBSurface is only for the blocks not the screen itself and if it affects anything then they would be the blocks

BTW sorry for the late replyFrom: grimfang4@gmail.com
Date: Mon, 30 Jan 2012 13:02:13 -0500
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL Bug

I’m not able to reproduce on Kubuntu. Can you post a screenshot?
When I ran the program, I first got a black screen. Subsequent tries give me four red blocks in the upper left on a green field.

I’m suspicious of using 0 for all of the masks in SDL_CreateRGBSurface().
Jonny D

2012/1/30 Ahmed Nematallah <@Ahmed_Nematallah>