82{
83 DrawHeader("Texture");
84
85 if(ImGui::ImageButton((ImTextureID)texture->GetRendererID(), ImVec2(150, 150)))
86 {
87 std::string path = ShowOpenFileDialog("*.png\0*.jpg\0");
88
89 if(path.size() > 3)
90 {
91 if(texture)
92 {
93 delete texture;
94 }
95
97 textureManager->UploadToGPU(zCoord);
98 }
99 }
100
101 if(ImGui::BeginDragDropTarget())
102 {
103 if(const ImGuiPayload *payload = ImGui::AcceptDragDropPayload("TerraForge3D_Texture"))
104 {
105 std::string path = std::string((char*)payload->Data);
106 if(path.size() > 3)
107 {
108 if(texture)
109 {
110 delete texture;
111 }
112
114 textureManager->UploadToGPU(zCoord);
115 }
116 }
117
118 ImGui::EndDragDropTarget();
119 }
120
121 ImGui::SameLine();
122 outputPins[0]->Render();
123 ImGui::PushItemWidth(100);
124
125 if(ImGui::DragFloat("Scale", &scale, 0.01f))
126 {
127 sharedData->d0 = scale;
128 }
129
130 if(ImGui::DragFloat("Offset X", &offsetX, 0.01f))
131 {
132 sharedData->d1 = offsetX;
133 }
134
135 if(ImGui::DragFloat("Offset Y", &offsetY, 0.01f))
136 {
137 sharedData->d2 = offsetY;
138 }
139
140 if(ImGui::DragFloat("Rotation", &rotation, 0.01f))
141 {
142 sharedData->d3 = rotation;
143 }
144
145 if(ImGui::Checkbox("Triplanar Mapping", &isTriplanar))
146 {
147 sharedData->d4 = isTriplanar ? 1.0f : 0.0f;
148 }
149
150 ImGui::PopItemWidth();
151}