JeGX HackLAB


Archive for April, 2011

Screen Space Ambient Occlusion (SSAO) Tests

without comments

Written by JeGX

April 27th, 2011 at 11:07 pm

offsetof macro in C

without comments

I just discovered this macro available in C: offsetof. Here is an simple example:

struct
{
  char a;
  int b;
  char c;
} example;
 
struct example s1;
 
unsigned int offset;
offset = (unsigned int)(&(((example *)(0))->b));

Thanks to offsetof (in the header stddef.h), the last line can be rewritten in:

unsigned int offset;
offset = offsetof(example, b);

[via]

Written by JeGX

April 27th, 2011 at 1:28 pm

Posted in Programming

Tagged with , , ,

GLSL Random Generator

with one comment

Written by JeGX

April 27th, 2011 at 12:59 pm

Posted in OpenGL

Tagged with , , , , ,