Jump to content
  • Advertisement

Krayzier

Member
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Krayzier

  • Rank
    Newbie
  1. Krayzier

    SDL: Passing Float to blit functions...?

    Thanks! That worked perfectly. After all calculations are done with floaters, I just cast the values before they are sent to SDL_Blit.
  2. I'm following the tutorial here, and have gotten the best performance I've ever gotten with SDL, which is great. (The source is in the tutorial... just scroll down until you reach it.) The tutorial is an OOP tutorial to help programmers put together working games. However, something that irks me is the fact that he passes so many float variables into parameters that are designed to take 32-bit integers... In the code, a float is multiplied with a variable that is added to an int representing the position of a sprite. I'm on Ubuntu Linux 64-Bit edition, and G++ spits out warnings about this... but the program works, even when cross-compiled... This practice of using floats instead of ints has risks, I know... I've tried replacing them with integers, but then that takes away the benefit of having values slowly incrementing to 1, which basically means that nothing moves, since anything less than 1 is rounded down to 0. My question is: If this makes the program less portable, is there any other way of doing this...? Is there any safe way to cast them to ints at certain places to make this behave the same way in different platforms?
  3. I'm not sure, but try asking here as well.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!