Jump to content

  • Log In with Google      Sign In   
  • Create Account

AppleMade

Member Since 16 Apr 2012
Offline Last Active Apr 22 2012 07:39 AM

Posts I've Made

In Topic: need help SDL EVENTS!

21 April 2012 - 01:17 PM

code-(events function)
void Button::handle_events()
{

    int x = 0, y = 0;
    int count=0;

   while( event.type == SDL_MOUSEBUTTONDOWN )
    {

        if( event.button.button == SDL_BUTTON_LEFT )
        {

            x = event.button.x;
            y = event.button.y;


            if( ( x > box.x ) && ( x < box.x + box.w ) && ( y > box.y ) && ( y < box.y + box.h ) )
            {
              if(count==0){
                           clip = &clips[ CLIP_NUMBER1];     //shows number 1
                           count++;
                           }
              else{
                    clip = &clips[ CLIP_NUMBER2];          //shows number 2
                           count++;
                           }    
            }

        }
    }

ERROR-compiles fine,but when output screen shows up and i click it,nothing happens and says "not responding"..

ps-i am in learning process so there might be some novice mistake,thanks for your time.

[mod edit: adding code tags -- rip-off]

In Topic: need help SDL EVENTS!

21 April 2012 - 08:45 AM

i read d tutorial but m not able to get anything on secnd click..i tried using a seperate counter whose value increments evrytime downbutton is clicked,,but it is not working..

PARTNERS