Files
WickedEngine/Editor/PaintToolWindow.h
T
James Webb 4f82ed8fbd wiGraphics refactors (#359)
* Mark concrete graphics device classes as final - they should not be inherited from further.

* Apply consistent snake_cast naming (which has been used in more recent additions) across wiGraphics structs

* Make 'CommandList' type safe so that calling graphics device functions is less error-prone.

* Decouple wiProfiler from wiRenderer by passing the device instance to functions instead of using wiRenderer::GetDevice().

* Bump minor version for graphics refactors.

* Decouple wiHelper screenshot/saveTexture* functions from wiRenderer by providing the graphics device as a parameter.

* Convert wiGraphics.h enums to use enum class (except a couple of raytracing flag enums which seem best left)

* hdr fix

* Documentation updates for enum class.

* Revert "Decouple wiHelper screenshot/saveTexture* functions from wiRenderer by providing the graphics device as a parameter."

This reverts commit fd70249554.

* Revert "Decouple wiProfiler from wiRenderer by passing the device instance to functions instead of using wiRenderer::GetDevice()."

This reverts commit 69b5326cfc.

* Fix debug build

* Fix gcc build (hopefully). Move bitmask operator defs to end of file outside of wiGraphics namespace.

* Remove 'to_underlying' and replace with casts

* graphics device access decoupled from wiRenderer, now should be accessed from wiGraphics::GetDevice()

* minor refactors, comments

* dx12 assert fix

* fixes

* commandlist refactor

* commandlist initial value

* commandlist refactor

* graphicsdevice comments, GetActivePipelineCount() function

* has changed to has_flag

* just rename a thing

Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
2021-11-17 20:27:10 +01:00

62 lines
1.7 KiB
C++

#pragma once
#include "WickedEngine.h"
class EditorComponent;
class PaintToolWindow : public wiWindow
{
float rot = 0;
float stroke_dist = 0;
bool history_needs_recording_start = false;
bool history_needs_recording_end = false;
size_t history_textureIndex = 0;
std::vector<wiGraphics::Texture> history_textures; // we'd like to keep history textures in GPU memory to avoid GPU readback
wiGraphics::Texture GetEditTextureSlot(const wiScene::MaterialComponent& material, int* uvset = nullptr);
void ReplaceEditTextureSlot(wiScene::MaterialComponent& material, const wiGraphics::Texture& texture);
public:
void Create(EditorComponent* editor);
EditorComponent* editor = nullptr;
wiECS::Entity entity = wiECS::INVALID_ENTITY;
int subset = -1;
wiComboBox modeComboBox;
wiLabel infoLabel;
wiSlider radiusSlider;
wiSlider amountSlider;
wiSlider falloffSlider;
wiSlider spacingSlider;
wiCheckBox backfaceCheckBox;
wiCheckBox wireCheckBox;
wiCheckBox pressureCheckBox;
wiColorPicker colorPicker;
wiComboBox textureSlotComboBox;
wiButton saveTextureButton;
void Update(float dt);
void DrawBrush() const;
XMFLOAT2 pos = XMFLOAT2(0, 0);
enum MODE
{
MODE_DISABLED,
MODE_TEXTURE,
MODE_VERTEXCOLOR,
MODE_SCULPTING_ADD,
MODE_SCULPTING_SUBTRACT,
MODE_SOFTBODY_PINNING,
MODE_SOFTBODY_PHYSICS,
MODE_HAIRPARTICLE_ADD_TRIANGLE,
MODE_HAIRPARTICLE_REMOVE_TRIANGLE,
MODE_HAIRPARTICLE_LENGTH,
MODE_WIND,
};
MODE GetMode() const;
void SetEntity(wiECS::Entity value, int subsetindex = -1);
wiArchive* currentHistory = nullptr;
void RecordHistory(bool start, wiGraphics::CommandList cmd = wiGraphics::INVALID_COMMANDLIST);
void ConsumeHistoryOperation(wiArchive& archive, bool undo);
};