You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Theodosius/include/theo/engine/swapchain.hpp

35 lines
1.1 KiB

#pragma once
#include <coff/archive.hpp>
#include <coff/image.hpp>
#include <theo/engine/iff.hpp>
#include <xtils.hpp>
namespace theo
{
class swapchain_t
{
/// <summary>
/// pair of front and back buffers...
/// changes are flushed to the back buffer, then the front
/// buffer gets overwritten by the back buffer when swapped...
/// </summary>
struct pair_t
{
std::vector< std::uint8_t > front, back;
};
std::vector< pair_t > objs;
std::vector< std::uint8_t > archive;
public:
explicit swapchain_t( const std::vector< std::uint8_t > &img );
static std::shared_ptr< swapchain_t > make( const std::vector< std::uint8_t > &img );
/// <summary>
/// if theo::swapchain::swap takes in an empty vector then it will simply fill it up
/// instead of flushing the iff data to the back buffer then swapping...
/// </summary>
/// <param name="iffs"></param>
void swap( std::vector< iff_t > &iffs );
};
} // namespace theo