Fixed all the compiler warnings, fixed depreciated screenshot function

master
MitchellHansen 8 years ago
parent 88e69721e1
commit 3571bdcd61

@ -1,7 +1,9 @@
# Check versions
message(STATUS "CMake version: ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 3.1)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Set the project name
set(PNAME Game)
project(${PNAME})
@ -61,13 +63,12 @@ target_link_libraries (${PNAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
target_link_libraries (${PNAME} ${OpenCL_LIBRARY})
target_link_libraries (${PNAME} ${OPENGL_LIBRARIES})
target_link_libraries (${PNAME} ${GLEW_LIBRARIES})
#target_link_libraries (${PNAME} ${Vulkan_LIBRARIES})
if (NOT WIN32)
target_link_libraries (${PNAME} -lpthread)
endif()
#target_link_libraries (${PNAME} ${Vulkan_LIBRARIES})
# Setup to use C++11
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 14) # Use C++11
# Setup to use C++14
set_property(TARGET ${PNAME} PROPERTY CXX_STANDARD 14)

@ -6,6 +6,7 @@
#include "RayCaster.h"
#include "LightHandle.h"
class LightController : public VrEventSubscriber {
public:
@ -46,10 +47,10 @@ private:
//// Need to allow N byte light class to be packed into 10 byte packets
//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;

@ -1,7 +1,7 @@
#pragma once
#include <SFML/Graphics.hpp>
#include <util.hpp>
#include "LightController.h"
#include <memory>
// We need to be able to :
// - Allow lights to exist outside the context of a LightController

@ -1,4 +1,3 @@
#pragma once
#include "Camera.h"
#include "Pub_Sub.h"
@ -201,4 +200,4 @@ sf::Vector3f Camera::get_position() {
sf::Vector2f Camera::get_direction() {
return direction;
}
}

@ -36,7 +36,7 @@ int Hardware_Caster::init() {
return error;
}
srand(NULL);
srand(time(NULL));
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;
return true;
}
}

@ -1,4 +1,3 @@
#pragma once
#include "LightController.h"
//LightController::LightController(std::shared_ptr<RayCaster> raycaster) {

@ -1,5 +1,5 @@
#include "LightHandle.h"
#include "LightController.h"
LightHandle::LightHandle() {

@ -1,4 +1,3 @@
#pragma once
#include <iostream>
#include <SFML/System/Vector3.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 "Event.hpp"
#include "Pub_Sub.h"

@ -1,5 +1,3 @@
#pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
#include "Map.h"

@ -22,7 +22,6 @@
#include <OpenCL/cl_ext.h>
#endif
#pragma once
#include <iostream>
#include <chrono>
#include <SFML/Graphics.hpp>
@ -233,7 +232,11 @@ int main() {
std::getline(std::cin, filename);
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);
}

Loading…
Cancel
Save