Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualrip-off

Posted 15 September 2013 - 05:26 PM

Here is what the code you posted does:

  • You initialise mx and my to zero
  • You append these values into the stringstreams
  • You render these stringstreams to SDL_Surfaces
  • If a mouse event occurred, you update the mx and my variables using SDL_GetMouseState()
  • You blit the surfaces to the game surface

Note that the order of operations is very important. You need to update the variables before appending them to the stringstream.


#2rip-off

Posted 15 September 2013 - 05:25 PM

Here is what the code you posted does:

 

  • You initialise mx and my to zero

     

     

  • You append these values into the stringstreams

     

     

  • You render these stringstreams to SDL_Surfaces

     

     

  • If a mouse event occurred, you update the mx and my variables using SDL_GetMouseState()

     

     

  • You blit the surfaces to the game surface

     

     

 

Note that the order of operations is very important. You need to update the variables before appending them to the stringstream.


#1rip-off

Posted 15 September 2013 - 05:25 PM

Here is what the code you posted does:

  • You initialise mx and my to zero

  • You append these values into the stringstreams

  • You render these stringstreams to SDL_Surfaces

  • If a mouse event occurred, you update the mx and my variables using SDL_GetMouseState()

  • You blit the surfaces to the game surface

Note that the order of operations is very important. You need to update the variables before appending them to the stringstream.


PARTNERS