Hi. First I describe what I want to do and then why I am unable to that. So I started a torpedo(Battleships) game. And I use SDL to get pictures on the screen. Now I want to use the mouse to shoot. This would be like when the user presses the left mouse button. I get the position of the cursor and calculate the coordinates from it. Easy right? Not for me First problem: How do I make the program to basicly do nothing just wait until the user presses the mouse button? I tried simple loops but it didn't really care about I had already pressed the button it just stayed there in a never ending loop. Second is SDL's behaviour is very strange. If I just load the picture and do not do anything else, the cursor changes to the well-known hour glass and it doesn't seem to respond to anything I do in the SDL window. Even if I did nothing just drew the pictures. What may I be doing wrong? I tried to do things similar to the tutorial but since I do not need those rectangles this time I set those as NIL as they should be.
Bookmarks