Pascal binding problem (solved)

Hello, i reply to an old problem i posted serveral time ago.
I have discovered the bug: the problem was in the binding of SDL_Rect –
sdl1.3 has x and y declared as 32bit integers, while sdl 1.2 had them as
16bit short integers
normally it shouldn’t cause a segfault but in fpc case it must have had a
bigger impact.

while on the subject, is there any update on the pascal bindings for sdl
1.3?
VittorioOn Sun, Jun 21, 2009 at 4:15 AM, Mason Wheeler wrote:

That’s some very strange behavior. What compiler are you writing for? FPC?

Could you send me your code on a private email, including the SDL header
file you’re using? From what you’ve described, the behavior you’re seeing
ought to be impossible. I could probably help debug this if I could play
around with the debugger personally, though…

From: Vittorio G. <vitto.giova at yahoo.it>
**Subject: Re: [SDL] SDL Digest, Vol 30, Issue 60

Hello,
I doublechecked the declaration for SDL_UpperBlit and it basically
corresponds to yours

mine: function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst:
PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl;
suggested: function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect;
dst: PSDL_Surface; dstrect: PSDL_Rect): integer; cdecl;

Have you verified that you got a valid pointer out of LoadImage, BTW? If

it’s not loading properly for whatever reason, it could be that you’ve got a
nil from the very beginning.

yes, i have verified the content of LoadImage’s pointer and they are all
accessible before using SDL_UpperBlit
I found out that if i try and LoadImage another texture, also that
associated pointer becomes null after a SDL_UpperBlit

p @tmpsurf
$1 =(^PSDL_SURFACE) 0xbfffe0d0
p @tmpsurf2
$2 = (^PSDL_SURFACE) 0xbfffe0cc
p tmpsurf
$3 = 0x50d13a0
p tmpsurf2
$4 = 0xa07c5f0
then after a SDL_UpperBlit using only tmpsurf
(gdb) p tmpsurf
$5 = 0x200
p tmpsurf2
$6 = 0x200

i’m really clueless, do you have any idea for this behavior?
thanks a lot
Vittorio


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

Samuel Goldwynhttp://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html

  • “I’m willing to admit that I may not always be right, but I am never
    wrong.”