Fixed point opperations?

This is a discussion on Fixed point opperations? within the C++ Programming forums, part of the General Programming Boards category; hi! in my software renderer i managed some fixed point operations. this is pretty easy with SHL and SHR. but ...

  1. #1
    Registered User Devils Child's Avatar
    Join Date
    Jan 2008
    Posts
    244

    Fixed point opperations?

    hi!
    in my software renderer i managed some fixed point operations. this is pretty easy with SHL and SHR. but now that i want to implement new stuff to my polygon-fill-routine, i would have to change everything. but all i get is confuseness and errors because those fixed opperations are just to over complicated when i do it my way. is there a library or a class which supports them more effective? because they are two times faster than floats or int64... :/

  2. #2
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    in my software renderer i managed some fixed point operations. this is pretty easy with SHL and SHR.
    Sounds like you made your own fixed point system in Blitz. If so you could always convert it to C++.

    SHL would be << and SHR is: >>

  3. #3
    Registered User Devils Child's Avatar
    Join Date
    Jan 2008
    Posts
    244
    i know how the syntax looks like and i already converted it to c++ days ago.
    the point is: is there a 'system' that allows me to set up a fixed point integer with a constant number of bits behind the comma?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,344
    There's almost certainly a fixed-point number class out there somewhere.

    Or you could write one yourself.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    I never made my own fixed point system, but theres some C++ code for it on iMalcs site:

    http://homepages.ihug.co.nz/~aurora7...ul_Classes.htm

    Don't know if thats of any use to you.

  6. #6
    Registered User Devils Child's Avatar
    Join Date
    Jan 2008
    Posts
    244
    ah so there is a library COOL
    i'll try this!
    thanks guys!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MSDN OLE DB Sample Provider entry point
    By George2 in forum C++ Programming
    Replies: 0
    Last Post: 07-21-2007, 07:30 AM
  2. Array of pointers to point objects
    By totalfreeloader in forum C++ Programming
    Replies: 6
    Last Post: 11-27-2003, 08:26 AM
  3. fixed point / floating point
    By confuted in forum Game Programming
    Replies: 4
    Last Post: 08-13-2002, 01:25 PM
  4. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM
  5. Floating point faster than fixed-point
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-08-2001, 10:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21