[SDL] Minimal example of weird pointer behaviour

Matthew Bloch mattbee-sdl at soup-kitchen.net
Tue Sep 10 11:19:01 PDT 2002


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





More information about the SDL mailing list