43 lines
897 B
C++
43 lines
897 B
C++
#pragma once
|
|
|
|
#include <windows.h>
|
|
|
|
#include "settlement/core/world.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
namespace settlement::viewer {
|
|
|
|
struct SceneView {
|
|
int width;
|
|
int height;
|
|
float origin_x;
|
|
float origin_y;
|
|
float scale;
|
|
float tile_half_width;
|
|
float tile_half_height;
|
|
std::optional<GridPosition> cursor;
|
|
bool valid_cursor;
|
|
std::optional<GridPosition> move_source;
|
|
std::optional<AgentId> selected;
|
|
};
|
|
|
|
class D3DScene {
|
|
public:
|
|
D3DScene();
|
|
~D3DScene();
|
|
bool initialize(HWND target, bool software = false);
|
|
[[nodiscard]] bool ready() const noexcept;
|
|
bool render(const World& world, const SceneView& view, std::vector<std::uint32_t>* capture = nullptr);
|
|
void reset() noexcept;
|
|
|
|
private:
|
|
struct Backend;
|
|
std::unique_ptr<Backend> backend_;
|
|
};
|
|
|
|
} // namespace settlement::viewer
|