Need help on Mouse Event

Hi buddies… I’m new to this SDL library. Maybe it’s noob question. I need to change the image when i mousedown. & also how to get the name when click on an object! Thanks lols…------------------------
It’s from SDK

Hey,

Your questions are a bit vague. What programming language are you
using? Do you know how to get SDL going and how to poll for and
handle events?

You should hold “images” as SDL_Surface pointers. When you receive a
SDL_MOUSEBUTTONDOWN event (assuming that’s what you mean by
"mousedown"), that’s when you should set your current image (however
you define that) to the next image. You have to assign names to
objects in order to get them from a click. I would suggest writing a
struct (or class) that holds the image (SDL_Surface*), the image name
(string or char*), and the position (SDL_Rect or float x,y). When you
get a click event, you can check to see which image you clicked on,
then get its name from the appropriate struct.

If you need more comprehensive SDL help, there are several good SDL
tutorials floating in Google space.

Jonny DOn Tue, Dec 15, 2009 at 7:41 AM, sdineshkannan wrote:

Hi buddies… I’m new to this SDL library. Maybe it’s noob question. I need
to change the image when i mousedown. & also how to get the name when click
on an object! Thanks lols…


It’s from SDK


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org