high,
im trying to make a map-editor for my pacman clone. i have never worked with
mouse input before, so im kind of lost as to how to do it. ive read the
docs, but they dont really help much. also, the book Focus on SDL that i
have, doesnt really tell you how either. the book only tells you about the
structure SDL_MouseButtonEvent. i know it stores the x and y position of the
mouse and also the button,type,state variables. ive tried using these to
determine the mouse position but it doenst seem to be working. at cone3d i
read the tutorial for “Clickomania” but it doesnt even use the
SDL_MouseButtonEvent structure, in fact i didnt even find info for this in
the SDL docs. the SDL docs only talks of getCurser and stuff.
anyway, if someone could give me an example on how to determine where the
user clicked on the screen, it would be helpfull. ive tried doing this:
int tempx;
int tempy;
SDL_GetMouseState(&tempx, &tempy); // Get the mouse coords
DrawIMG(data.wall,tempx,tempy);
DrawIMG receives a surface to be drawn, and the x and y pos to draw it. i
tried doing the above, but when i clicked all over the place nothing
happend. i even tried it in combination with
SDL_MouseButtonEvent mouse;
if (mouse.type = SDL_MOUSEBUTTONDOWN)
but this didnt work. ive also tried it with
if(!SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
but this also didnt work. please someone give me an example and how to do
this, or maybe a brief explantion. thank you for any help you can give me!!_________________________________________________________________
Free up your inbox with MSN Hotmail Extra Storage. Multiple plans available.
http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/