Starting to condense the rendering and switching between the different

methods
master
MitchellHansen 8 years ago
parent ef4c001bf2
commit 51093beaca

@ -18,6 +18,7 @@ public:
Old_Map(sf::Vector3i dim); Old_Map(sf::Vector3i dim);
~Old_Map(); ~Old_Map();
void generate_from_data(char* dat, int len);
void generate_terrain(); void generate_terrain();
sf::Vector3i getDimensions(); sf::Vector3i getDimensions();

@ -13,6 +13,7 @@ Old_Map::Old_Map(sf::Vector3i dim) {
Old_Map::~Old_Map() { Old_Map::~Old_Map() {
} }
void Old_Map::generate_terrain() { void Old_Map::generate_terrain() {
std::mt19937 gen; std::mt19937 gen;
std::uniform_real_distribution<double> dis(-1.0, 1.0); std::uniform_real_distribution<double> dis(-1.0, 1.0);

@ -1,4 +1,4 @@
#ifdef linux #ifdef linux
#include <CL/cl.h> #include <CL/cl.h>
#include <CL/opencl.h> #include <CL/opencl.h>
@ -78,7 +78,7 @@ int main() {
sf::Vector3i map_dim(MAP_X, MAP_Y, MAP_Z); sf::Vector3i map_dim(MAP_X, MAP_Y, MAP_Z);
Old_Map* map = new Old_Map(map_dim); Old_Map* map = new Old_Map(map_dim);
map->generate_terrain(); map->generate_terrain();
c.create_buffer("map_buffer", sizeof(char) * map_dim.x * map_dim.y * map_dim.z, map->get_voxel_data()); c.create_buffer("map_buffer", sizeof(char) * map_dim.x * map_dim.y * map_dim.z, map->get_voxel_data());
c.create_buffer("dim_buffer", sizeof(int) * 3, &map_dim); c.create_buffer("dim_buffer", sizeof(int) * 3, &map_dim);
@ -129,7 +129,7 @@ int main() {
c.create_buffer("view_matrix_buffer", sizeof(float) * 4 * view_res.x * view_res.y, view_matrix); c.create_buffer("view_matrix_buffer", sizeof(float) * 4 * view_res.x * view_res.y, view_matrix);
Camera camera( Camera camera(
sf::Vector3f(70, 60, 50), sf::Vector3f(0, 0, 0),
sf::Vector2f(0.0f, 1.00f) sf::Vector2f(0.0f, 1.00f)
); );
@ -211,8 +211,8 @@ int main() {
//RayCaster ray_caster(map, map_dim, view_res); //RayCaster ray_caster(map, map_dim, view_res);
sf::Vector2f *dp = camera.get_direction_pointer(); sf::Vector2f *dp = camera.get_direction_pointer();
debug_text cam_text_x(1, 30, &dp->x, "X: "); debug_text cam_text_x(1, 30, &dp->x, "incli: ");
debug_text cam_text_y(2, 30, &dp->y, "Y: "); debug_text cam_text_y(2, 30, &dp->y, "asmth: ");
sf::Vector3f *mp = camera.get_movement_pointer(); sf::Vector3f *mp = camera.get_movement_pointer();
debug_text cam_text_mov_x(4, 30, &mp->x, "X: "); debug_text cam_text_mov_x(4, 30, &mp->x, "X: ");

Loading…
Cancel
Save