Extract node lifecycle, preview runtime, and Win32 input state
This commit is contained in:
53
src/legacy_node_stroke_preview_runtime_services.h
Normal file
53
src/legacy_node_stroke_preview_runtime_services.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include "../libs/glm/glm/ext/matrix_float4x4.hpp"
|
||||
#include "../libs/glm/glm/ext/vector_float2.hpp"
|
||||
|
||||
#include "brush.h"
|
||||
#include "legacy_node_stroke_preview_draw_services.h"
|
||||
#include "renderer_api/renderer_api.h"
|
||||
#include "rtt.h"
|
||||
#include "texture.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace pp::panopainter {
|
||||
|
||||
struct LegacyNodeStrokePreviewImmediateRuntimeRequest {
|
||||
const std::shared_ptr<Brush>& brush;
|
||||
glm::vec2 preview_size {};
|
||||
float zoom = 1.0f;
|
||||
float min_flow = 0.0f;
|
||||
float stroke_max_size_override = 0.0f;
|
||||
float pad_override = NAN;
|
||||
float camera_fov = 0.0f;
|
||||
glm::mat4 camera_rot { 1.0f };
|
||||
pp::renderer::RenderDeviceFeatures render_device_features {};
|
||||
RTT& preview_rtt;
|
||||
RTT& preview_rtt_mixer;
|
||||
Texture2D& preview_stroke_texture;
|
||||
Texture2D& preview_dual_texture;
|
||||
Texture2D& preview_background_texture;
|
||||
Texture2D& preview_image_texture;
|
||||
Sampler& linear_sampler;
|
||||
Sampler& repeat_sampler;
|
||||
std::function<void()> prepare_render_target;
|
||||
std::function<void()> finish_render_target;
|
||||
std::function<void(bool)> set_blend_enabled;
|
||||
std::function<void(const LegacyStrokeShaderSetupUniforms&)> setup_stroke_shader;
|
||||
std::function<void(const Brush&)> bind_dual_pass_textures;
|
||||
std::function<void(bool)> capture_background;
|
||||
std::function<std::vector<LegacyNodeStrokePreviewFrame>(const Stroke&, float)> compute_frames;
|
||||
std::function<glm::vec4(std::array<vertex_t, 4>&, Texture2D&, bool)> draw_samples;
|
||||
std::function<void(const glm::vec2&, const glm::vec2&)> draw_mix;
|
||||
std::function<void()> unbind_mixer_texture;
|
||||
std::function<void()> bind_pattern_texture;
|
||||
std::function<void()> draw_composite;
|
||||
};
|
||||
|
||||
[[nodiscard]] bool execute_legacy_node_stroke_preview_immediate_runtime(
|
||||
const LegacyNodeStrokePreviewImmediateRuntimeRequest& request);
|
||||
|
||||
} // namespace pp::panopainter
|
||||
Reference in New Issue
Block a user