Testgl.c on Dev-c++

Hi,

I am sooo close to getting a build…

I was using MinGW but kept on getting this error:

53 testgl.c cannot convert bool' toSDL_GrabMode’
for argument 1' toSDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode)’

void HotKey_ToggleGrab(void)
{
SDL_GrabMode mode;

printf("Ctrl-G: toggling input grab!\n");
mode = SDL_WM_GrabInput(SDL_GRAB_QUERY);
if ( mode == SDL_GRAB_ON ) {
	printf("Grab was on\n");
} else {
	printf("Grab was off\n");
}
mode = SDL_WM_GrabInput(!mode); // LINE 53

My compiler flags are as follows:
-lmingw32
-lSDLmain
-lSDL
-lglu32
-lopengl32
-mwindows

I thought it was because I installed MinGW and the SDL incorrectly.
I decided to download Dev-C++ and let it install MinGW and the SDL(via an
update) automatically.

Is this just a problem with the MinGW compiler?
Does anybody know how I can fix this?

-Billy

[…]

53 testgl.c cannot convert bool' toSDL_GrabMode’
for argument 1' toSDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode)’
[…]

There is no such thing as ‘bool’ in C, and C++ type checking is much
stricter than C type checking. You need to use the exact right type
for that argument, or insert an explicit cast.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Monday 21 March 2005 15.05, Billy wrote:

mode = SDL_WM_GrabInput(!mode); // LINE 53

mode = ((SDL_GRAB_ON) ? SDL_GRAB_OFF : SDL_GRAB_ON);
mode = SDL_WM_GrabInput(mode);

–ryan.

Ryan C. Gordon <icculus clutteredmind.org> writes:

mode = SDL_WM_GrabInput(!mode); // LINE 53

mode = ((SDL_GRAB_ON) ? SDL_GRAB_OFF : SDL_GRAB_ON);
mode = SDL_WM_GrabInput(mode);

–ryan.

YAYAYAY! -b