gpuray_glsl

diff src/gpuscene.h @ 0:f234630e38ff

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 09 Nov 2014 13:03:36 +0200
parents
children 2ed3da7dc0bc
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/gpuscene.h	Sun Nov 09 13:03:36 2014 +0200
     1.3 @@ -0,0 +1,38 @@
     1.4 +#ifndef GPUSCENE_H_
     1.5 +#define GPUSCENE_H_
     1.6 +
     1.7 +#include <vector>
     1.8 +#include "scene.h"
     1.9 +#include "sphere.h"
    1.10 +#include "plane.h"
    1.11 +#include "box.h"
    1.12 +
    1.13 +class GPUScene : public Scene {
    1.14 +public:
    1.15 +	enum { TEX_SPHERE, TEX_PLANE, TEX_BOX, TEX_TEXTURE, TEX_ENV, TEX_XFORM, NUM_TEXTURES };
    1.16 +
    1.17 +private:
    1.18 +	unsigned int textures[NUM_TEXTURES];
    1.19 +	Vector4 *xform_buf;
    1.20 +
    1.21 +	int object_index(const Object *obj) const;
    1.22 +
    1.23 +	void create_sphere_texture(const std::vector<Sphere*> &spheres);
    1.24 +	void create_plane_texture(const std::vector<Plane*> &planes);
    1.25 +	void create_box_texture(const std::vector<Box*> &box);
    1.26 +	void create_megatexture();
    1.27 +	void create_env_texture();
    1.28 +	void create_xform_texture();
    1.29 +
    1.30 +public:
    1.31 +	GPUScene();
    1.32 +	~GPUScene();
    1.33 +
    1.34 +	bool create_textures();
    1.35 +
    1.36 +	void update_xform_texture();
    1.37 +
    1.38 +	unsigned int get_texture(int which) const;
    1.39 +};
    1.40 +
    1.41 +#endif	// GPUSCENE_H_