Mouse::Mouse_shapes saveshape = mouse->get_shape(); if (shape != Mouse::dontchange) mouse->set_shape(shape); int ret = Get_click(x, y); mouse->set_shape(saveshape); return (ret);
while (1) { SDL_Event event; Delay(); #ifdef MOUSE mouse->hide(); #endif while (SDL_PollEvent(&event)) switch (event.type) { case SDL_MOUSEBUTTONUP: if (event.button.button == 1) { x = event.button.x; y = event.button.y; return (1); } break; case SDL_MOUSEMOTION: #ifdef MOUSE mouse->move(event.motion.x, event.motion.y); gwin->set_painted(); #endif break; case SDL_QUIT: quitting_time = 1; return (0); case SDL_KEYDOWN: if (event.key.keysym.sym == SDLK_ESCAPE) return (0); break; } #ifdef MOUSE mouse->show(); #endif gwin->show(); } return (0);
int Get_click	(	int& x, int& y,			// Location returned (if not ESC).	Mouse::Mouse_shapes shape	// Mouse shape to use.	)	{	Mouse::Mouse_shapes saveshape = mouse->get_shape();	if (shape != Mouse::dontchange)		mouse->set_shape(shape);	int ret = Get_click(x, y);	mouse->set_shape(saveshape);	return (ret);	}