Fixed all the compiler warnings, fixed depreciated screenshot function
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
# Check versions
|
# Check versions
|
||||||
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
||||||
cmake_minimum_required(VERSION 3.1)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
# Set the project name
|
# Set the project name
|
||||||
set(PNAME Game)
|
set(PNAME Game)
|
||||||
project(${PNAME})
|
project(${PNAME})
|
||||||
@@ -61,13 +63,12 @@ target_link_libraries (${PNAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
|
|||||||
target_link_libraries (${PNAME} ${OpenCL_LIBRARY})
|
target_link_libraries (${PNAME} ${OpenCL_LIBRARY})
|
||||||
target_link_libraries (${PNAME} ${OPENGL_LIBRARIES})
|
target_link_libraries (${PNAME} ${OPENGL_LIBRARIES})
|
||||||
target_link_libraries (${PNAME} ${GLEW_LIBRARIES})
|
target_link_libraries (${PNAME} ${GLEW_LIBRARIES})
|
||||||
|
#target_link_libraries (${PNAME} ${Vulkan_LIBRARIES})
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
target_link_libraries (${PNAME} -lpthread)
|
target_link_libraries (${PNAME} -lpthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#target_link_libraries (${PNAME} ${Vulkan_LIBRARIES})
|
# Setup to use C++14
|
||||||
|
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 14)
|
||||||
# Setup to use C++11
|
|
||||||
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 14) # Use C++11
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "RayCaster.h"
|
#include "RayCaster.h"
|
||||||
#include "LightHandle.h"
|
#include "LightHandle.h"
|
||||||
|
|
||||||
|
|
||||||
class LightController : public VrEventSubscriber {
|
class LightController : public VrEventSubscriber {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -46,10 +47,10 @@ private:
|
|||||||
//// Need to allow N byte light class to be packed into 10 byte packets
|
//// Need to allow N byte light class to be packed into 10 byte packets
|
||||||
//int packed_size = sizeof(PackedData);
|
//int packed_size = sizeof(PackedData);
|
||||||
|
|
||||||
//std::vector<PackedData> packed_data_array;
|
std::vector<PackedData> packed_data_array;
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//std::unordered_map<std::string, LightHandle> light_map;
|
std::unordered_map<std::string, LightHandle> light_map;
|
||||||
//
|
//
|
||||||
//std::shared_ptr<RayCaster> raycaster;
|
//std::shared_ptr<RayCaster> raycaster;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
#include <util.hpp>
|
#include <util.hpp>
|
||||||
#include "LightController.h"
|
#include <memory>
|
||||||
|
|
||||||
// We need to be able to :
|
// We need to be able to :
|
||||||
// - Allow lights to exist outside the context of a LightController
|
// - Allow lights to exist outside the context of a LightController
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
#include "Pub_Sub.h"
|
#include "Pub_Sub.h"
|
||||||
|
|
||||||
@@ -201,4 +200,4 @@ sf::Vector3f Camera::get_position() {
|
|||||||
|
|
||||||
sf::Vector2f Camera::get_direction() {
|
sf::Vector2f Camera::get_direction() {
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ int Hardware_Caster::init() {
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
srand(NULL);
|
srand(time(NULL));
|
||||||
|
|
||||||
int *seed_memory = new int[1920*1080];
|
int *seed_memory = new int[1920*1080];
|
||||||
|
|
||||||
@@ -893,4 +893,4 @@ bool Hardware_Caster::assert(int error_code, std::string function_name) {
|
|||||||
|
|
||||||
std::cout << err_msg << " =at= " << function_name << std::endl;
|
std::cout << err_msg << " =at= " << function_name << std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
#include "LightController.h"
|
#include "LightController.h"
|
||||||
|
|
||||||
//LightController::LightController(std::shared_ptr<RayCaster> raycaster) {
|
//LightController::LightController(std::shared_ptr<RayCaster> raycaster) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "LightHandle.h"
|
#include "LightHandle.h"
|
||||||
|
#include "LightController.h"
|
||||||
|
|
||||||
LightHandle::LightHandle() {
|
LightHandle::LightHandle() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <SFML/System/Vector3.hpp>
|
#include <SFML/System/Vector3.hpp>
|
||||||
#include <SFML/System/Vector2.hpp>
|
#include <SFML/System/Vector2.hpp>
|
||||||
@@ -369,4 +368,4 @@ void Old_Map::diamond_square(int stepsize, double scale) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "Event.hpp"
|
#include "Event.hpp"
|
||||||
#include "Pub_Sub.h"
|
#include "Pub_Sub.h"
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include <OpenCL/cl_ext.h>
|
#include <OpenCL/cl_ext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
@@ -233,7 +232,11 @@ int main() {
|
|||||||
std::getline(std::cin, filename);
|
std::getline(std::cin, filename);
|
||||||
filename += ".png";
|
filename += ".png";
|
||||||
|
|
||||||
sf::Image image = window.capture();
|
sf::Texture window_texture;
|
||||||
|
window_texture.create(window.getSize().x, window.getSize().y);
|
||||||
|
window_texture.update(window);
|
||||||
|
|
||||||
|
sf::Image image = window_texture.copyToImage();
|
||||||
image.saveToFile(path + filename);
|
image.saveToFile(path + filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user