clray

diff src/rt.cc @ 11:d9a1bab1c3f5

ported to windows
author John Tsiombikas
date Sat, 31 Jul 2010 22:23:57 +0100
parents a09622aaa043
children 85fd61f374d9
line diff
     1.1 --- a/src/rt.cc	Fri Jul 30 19:28:18 2010 +0100
     1.2 +++ b/src/rt.cc	Sat Jul 31 22:23:57 2010 +0100
     1.3 @@ -5,19 +5,33 @@
     1.4  #include "ocl.h"
     1.5  #include "mesh.h"
     1.6  
     1.7 +#ifdef __GNUC__
     1.8 +#define PACKED	__attribute__((packed))
     1.9 +#else
    1.10 +#define PACKED
    1.11 +#endif
    1.12 +
    1.13 +#ifdef _MSC_VER
    1.14 +#pragma push(pack, 1)
    1.15 +#endif
    1.16 +
    1.17  struct RendInfo {
    1.18  	int xsz, ysz;
    1.19  	int num_faces, num_lights;
    1.20  	int max_iter;
    1.21 -} __attribute__((packed));
    1.22 +} PACKED;
    1.23  
    1.24  struct Ray {
    1.25  	float origin[4], dir[4];
    1.26 -} __attribute__((packed));
    1.27 +} PACKED;
    1.28  
    1.29  struct Light {
    1.30  	float pos[4], color[4];
    1.31 -} __attribute__((packed));
    1.32 +} PACKED;
    1.33 +
    1.34 +#ifdef _MSC_VER
    1.35 +#pragma pop(pack)
    1.36 +#endif
    1.37  
    1.38  static Ray get_primary_ray(int x, int y, int w, int h, float vfov_deg);
    1.39