2020-02-05 20:58:58 +01:00
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
|
|
// include headers that implement a archive in simple text format
|
|
|
|
|
#include <boost/archive/text_oarchive.hpp>
|
|
|
|
|
#include <boost/archive/text_iarchive.hpp>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
#include <glm/vec4.hpp>
|
|
|
|
|
#include <GLFW/glfw3.h>
|
2020-02-25 00:44:40 +01:00
|
|
|
#include "Graphics/Graphics.h"
|
2020-02-05 20:58:58 +01:00
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
|
// gps coordinate
|
|
|
|
|
//
|
|
|
|
|
// illustrates serialization for a simple type
|
|
|
|
|
//
|
|
|
|
|
class gps_position
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
friend class boost::serialization::access;
|
|
|
|
|
// When the class Archive corresponds to an output archive, the
|
|
|
|
|
// & operator is defined similar to <<. Likewise, when the class Archive
|
|
|
|
|
// is a type of input archive the & operator is defined similar to >>.
|
|
|
|
|
template<class Archive>
|
|
|
|
|
void serialize(Archive& ar, const unsigned int version)
|
|
|
|
|
{
|
|
|
|
|
ar& degrees;
|
|
|
|
|
ar& minutes;
|
|
|
|
|
ar& seconds;
|
|
|
|
|
}
|
|
|
|
|
int degrees;
|
|
|
|
|
int minutes;
|
|
|
|
|
float seconds;
|
|
|
|
|
public:
|
|
|
|
|
gps_position() {};
|
|
|
|
|
gps_position(int d, int m, float s) :
|
|
|
|
|
degrees(d), minutes(m), seconds(s)
|
|
|
|
|
{}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
// create and open a character archive for output
|
|
|
|
|
std::ofstream ofs("filename");
|
|
|
|
|
|
|
|
|
|
// create class instance
|
|
|
|
|
const gps_position g(35, 59, 24.567f);
|
|
|
|
|
|
2020-02-25 00:44:40 +01:00
|
|
|
// save _data to archive
|
2020-02-05 20:58:58 +01:00
|
|
|
{
|
|
|
|
|
boost::archive::text_oarchive oa(ofs);
|
|
|
|
|
// write class instance to archive
|
|
|
|
|
oa << g;
|
|
|
|
|
// archive and stream closed when destructors are called
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ... some time later restore the class instance to its orginal state
|
|
|
|
|
gps_position newg;
|
|
|
|
|
{
|
|
|
|
|
// create and open an archive for input
|
|
|
|
|
std::ifstream ifs("filename");
|
|
|
|
|
boost::archive::text_iarchive ia(ifs);
|
|
|
|
|
// read class state from archive
|
|
|
|
|
ia >> newg;
|
|
|
|
|
// archive and stream closed when destructors are called
|
|
|
|
|
}
|
|
|
|
|
std::cout << "Hello World! " << std::endl;
|
|
|
|
|
VkInstance instance;
|
|
|
|
|
glm::vec4 vector(0, 1, 0, 1);
|
2020-02-25 00:44:40 +01:00
|
|
|
Seele::Graphics& graphics = Seele::Graphics::getInstance();
|
2020-02-05 20:58:58 +01:00
|
|
|
std::cout << vector.y << std::endl;
|
|
|
|
|
std::cout << glfwInit() << std::endl;
|
2020-02-25 00:44:40 +01:00
|
|
|
|
2020-02-05 20:58:58 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|