[SDL] Minimal example of weird pointer behaviour

John Popplewell john at johnnypops.demon.co.uk
Tue Sep 10 14:51:00 PDT 2002


Hi,

your minimal example works fine on my win2k box. I had to change
WinMain() to main() (and add a return 0;) to get it to compile and
link.

What version of SDL are you using?

cheers,
John.


----- Original Message -----
From: "Matthew Bloch" <mattbee-sdl at soup-kitchen.net>
To: <sdl at libsdl.org>
Sent: Tuesday, September 10, 2002 7:35 PM
Subject: Re: [SDL] Minimal example of weird pointer behaviour


> On Tuesday 10 September 2002 17:54, Sam Lantinga wrote:
> > > Can anyone with a Windows 2000 box to hand confirm the weird pointer
> > > behaviour I've seen?  This short test program demonstrates it (you man
> > > need to change the #include or WinMain declaration, I just picked the
> > > first set of options taht worked with my cross-compiler setup):
> > >
> > > #include "SDL/SDL.h"
> > >
> > > int WinMain(int argc, char **argv)
> >
> > I don't know if this is your problem, but you need to declare main()
this
> > way: int main(int argc, char *argv[])
>
> The effect that program demonstrates is the same as one that occurs in the
> game, which is just a Ruby script.  The Ruby interpreter starts up with
plain
> old main() and SDL_Initialize is called from the RUDL library, so I
presume
> this is the 'legit' way to start up, though obviously that doesn't link
with
> SDL_main (though maybe it should...?).
>
> Anyhow even if I change that WinMain to the usual unix main() function
> signature, and use this to compile the program:
>
> /usr/local/cross-tools/bin/i386-mingw32msvc-gcc -mwindows \
>   -o testmouse.exe testmouse.c \
>   `/usr/local/cross-tools/i386-mingw32msvc/bin/sdl-config --cflags --libs`
>
> It still shows the same effect.  It 'feels' like Windows 2000 is passing
> multiplied-up values to handle_mouse, and that xrel and yrel are being
> calculated incorrectly.  Without some deeper DirectInput knowledge I'm not
> sure how this is happening though; if nobody knows why, looks like I'll
have
> to acquire myself some in the next 48 hrs :-)
>
> --
> Matthew       > http://www.soup-kitchen.net/
>               > ICQ 19482073
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl





More information about the SDL mailing list