Re: Bitshifting in Euphoria?
- Posted by ne1uno May 02, 2015
- 1678 views
Icy_Viking said...
Hello,
I am working on a re-write of my SFML2 wrapper in Euphoria. I came across this enumeration in SFML2.
typedef enum { sfNone = 0, /< No border / title bar (this flag and all others are mutually exclusive)
sfTitlebar = 1 << 0, /< Title bar + fixed border
sfResize = 1 << 1, /< Titlebar + resizable border + maximize button
sfClose = 1 << 2, /< Titlebar + close button
sfFullscreen = 1 << 3, /< Fullscreen mode (this flag and all others are mutually exclusive)
sfDefaultStyle = sfTitlebar | sfResize | sfClose /< Default window style
} sfWindowStyle;
I'm wondering if in euphoria code I'd convert it using bit shifts.
public enum type sfWindowStyle sfNone = 0, sfTitlebar = 1 -- or would I do something like bit_shift(1 < 0) ? end type
Any help would be greatly appericated.
-- sfClose = 1 << 2, ///< Titlebar + close button sfClose = shift_bits(1, -2) -- 1 << 2 Titlebar + close button