Hey all,
I've been having problems compiling a test program that comes with the
CVS build of SDL (for those of you familiar with it)... My problem is
that a function in the source uses the not-operator ( ! ) on non-bool
datatypes... Can C++ not use this operator on non-bool?
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); /* Error occurs here */
if ( mode == SDL_GRAB_ON ) {
printf("Grab is now on\n");
} else {
printf("Grab is now off\n");
}
}
The errors reported are as follows:
C:\SDL-1.2.6\test\testwm.c
[Warning] In function `void HotKey_ToggleGrab()':
96
C:\SDL-1.2.6\test\testwm.c
cannot convert `bool' to `SDL_GrabMode'
C:\Documents and Settings\Granoblastic Man\My Documents\Dev-C++
Projects\Makefile.win
[Build Error] [../../../../SDL-1.2.6/test/testwm.o] Error 1
|