
//---- Raytrace Data Types ---------------------------------------------------//

typedef struct
{
  float ax, ay, az;

  float x, y, z;
}
RT_POINT;


typedef struct __RT_SPHERE
{
  float x1, y1, x2, y2;  //  Screen-space bounding box

  float ax, ay, az;
  
  float x, y, z;
  float rad;
  int col;

  float a, b, c, d;

  struct __RT_SPHERE *shadow_list;
}
RT_SPHERE;



typedef struct
{
  RT_SPHERE *sphere;

  bool shadow;

  float t;
  float x, y, z;
  float nx, ny, nz;
  float reflx, refly, reflz;

  int col;
}
RT_PIXEL;



typedef struct
{
  float ox, oy, oz;
  float dx, dy, dz;
}
RT_RAY;




//---- FUNCTIONS


void rt_startup(int *buffer, int width, int height);
void rt_shutdown();

void rt_addSphere(float x, float y, float z, float rad, int col);

void rt_render(float rx, float ry);



