ccdemos/realtime.cc
author Radek Brich <radek.brich@devl.cz>
Thu, 10 Apr 2008 23:20:36 +0200
branchpyrit
changeset 65 242839c6d27d
parent 40 929aad02c5f2
child 72 7c3f38dff082
permissions -rw-r--r--
basic detection of compiler (GCC or ICC) and CPU capabilities try to detect Python path in Windows and allow direct specification through build option plus other build system fixes

#include <stdlib.h>

#include "raytracer.h"
#include "octree.h"

#include "common_sdl.h"

int main(int argc, char **argv)
{
	Raytracer rt;
	Octree top;
	Camera cam;

	rt.setMaxDepth(3);
	rt.setTop(&top);

	Light light1(Vector3(2.0, -5.0, -5.0), Colour(0.7, 0.3, 0.6));
	light1.castShadows(false);
	rt.addlight(&light1);

	Light light2(Vector3(-2.0, 10.0, 2.0), Colour(0.4, 0.6, 0.3));
	light2.castShadows(false);
	rt.addlight(&light2);

	Material mat_sph(Colour(1.0, 1.0, 1.0));
	for (int y=0; y<10; y++)
		for (int x=0; x<10; x++)
			rt.addshape(new Sphere(Vector3(x*2-10, (Float)rand()/RAND_MAX*5.0, y*2-10), 0.45, &mat_sph));

	rt.setCamera(&cam);
	cam.setEye(Vector3(0,0,10));

	top.optimize();

	loop_sdl(rt, cam);
}