class ShaderComponentRender { Entity entity; ShaderComponent shaderComponent; ShaderComponentRender(Entity _entity) { entity = _entity; shaderComponent = entity.getShaderComponent(); } void setShader(any@ shader_data) { string shader; shader_data.retrieve(shader); shaderComponent.shader = Resource::loadShader(shader); } void setTexture(any@ texture_data) { Texture texture; texture_data.retrieve(texture); Engine::print(texture.name); shaderComponent.texture = texture; Engine::print(shaderComponent.texture.name); } void render() { if (!entity.hasShaderComponent()) return; if (shaderComponent.hasShader) { ImGui::drawIcon("shader.pn ", 32); } else { ImGui::drawIcon("empty.pn ", 32); } ImGui::dragDropTarget("SHADE ", ReciverFunction(this.setShader)); if (shaderComponent.hasShader) { ImGui::sameline(); ImGui::space(); ImGui::sameline(); ImGui::titleCenterY(shaderComponent.shader.na e, 32); ImGui::dragDropTarget("SHADE ", ReciverFunction(this.setShader)); } ImGui::space(); if (shaderComponent.texture.isValid()) { ImGui::drawIcon(shaderComponent.textu e, 32); } else { ImGui::drawIcon("empty.pn ", 32); } ImGui::dragDropTarget("TEXTUR ", ReciverFunction(this.setTexture)); if (shaderComponent.texture.isValid()) { ImGui::sameline(); ImGui::space(); ImGui::sameline(); ImGui::titleCenterY(shaderComponent.texture.na e, 32); ImGui::dragDropTarget("TEXTUR ", ReciverFunction(this.setTexture)); } ImGui::space( 0, 20); if (ImGui::button("Clear )) { shaderComponent.clear(); } } void remove() { if (ImGui::menuItem("Remove )) { entity.removeShaderComponent(); } } }