OPTPiX SpriteStudio SDK
Loading...
Searching...
No Matches
xorshift32.h
Go to the documentation of this file.
1#ifndef __XORSHIFT32__
2#define __XORSHIFT32__
3
4namespace spritestudio6
5{
6
7#ifdef WIN32
8
9 #ifndef uint32_t
10 typedef unsigned int _uint32_t;
11 #endif
12#else
13 typedef uint32_t _uint32_t;
14#endif
15
17{
18protected:
19
20
22
23
24public:
27
28 void init_genrand(unsigned long seed) {y=seed;}
29
31 y = y ^ ( y << 13 );
32 y = y ^ ( y >> 17 );
33 y = y ^ ( y << 15 );
34
35 return y;
36 }
37
40 _uint32_t res = (v >> 9) | 0x3f800000;
41 float r = (*(float*)&res) - 1.0f;
42
43 return r;
44 }
45
46} ;
47
48
49} // namespace spritestudio6
50
51
52#endif
~xorshift32()
Definition xorshift32.h:26
xorshift32()
Definition xorshift32.h:25
_uint32_t y
Definition xorshift32.h:21
float genrand_float32()
Definition xorshift32.h:38
_uint32_t genrand_uint32()
Definition xorshift32.h:30
void init_genrand(unsigned long seed)
Definition xorshift32.h:28
GLdouble v
Definition glad.h:2712
GLdouble GLdouble r
Definition glad.h:2421
Definition ISsEffectRender.h:5
uint32_t _uint32_t
Definition xorshift32.h:13