Slang actually worked.
This commit is contained in:
@@ -23,7 +23,7 @@ void SimpleTexturedMaterial::load(std::shared_ptr<SceneLoadContext> ctx) {
|
||||
}
|
||||
|
||||
struct Color SimpleTexturedMaterial::getColor() {
|
||||
return this->data.color;
|
||||
return this->data.data.color;
|
||||
}
|
||||
|
||||
std::shared_ptr<Texture> SimpleTexturedMaterial::getTexture() {
|
||||
@@ -37,25 +37,25 @@ void SimpleTexturedMaterial::setTexture(
|
||||
}
|
||||
|
||||
void SimpleTexturedMaterial::setColor(const struct Color color) {
|
||||
this->data.color = color;
|
||||
this->data.data.color = color;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IRenderPass>> SimpleTexturedMaterial::getPasses(
|
||||
struct RenderPassContext &ctx
|
||||
) {
|
||||
this->data.model = this->getItem()->getWorldTransform();
|
||||
this->data.projection = ctx.camera->getProjection();
|
||||
this->data.view = ctx.camera->getItem()->getWorldTransform();
|
||||
this->data.data.model = this->getItem()->getWorldTransform();
|
||||
this->data.data.projection = ctx.camera->getProjection();
|
||||
this->data.data.view = ctx.camera->getItem()->getWorldTransform();
|
||||
auto textures = std::unordered_map<
|
||||
shadertexturebinding_t, std::shared_ptr<Texture>
|
||||
>();
|
||||
|
||||
if(this->texture) {
|
||||
this->data.hasTexture = true;
|
||||
this->data.data.hasTexture = true;
|
||||
this->data.texture = 0;
|
||||
textures[this->data.texture] = this->texture;
|
||||
} else {
|
||||
this->data.hasTexture = false;
|
||||
this->data.data.hasTexture = false;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace Dawn {
|
||||
class ShaderManager {
|
||||
private:
|
||||
std::vector<std::weak_ptr<IShaderBase>> shaders;
|
||||
std::vector<std::shared_ptr<IShaderBase>> shaders;
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -23,7 +23,8 @@ namespace Dawn {
|
||||
std::shared_ptr<T> getShader() {
|
||||
auto itShaders = shaders.begin();
|
||||
while(itShaders != shaders.end()) {
|
||||
auto shader = itShaders->lock();
|
||||
// auto shader = itShaders->lock();
|
||||
auto shader = *itShaders;
|
||||
if(!shader) {
|
||||
itShaders = shaders.erase(itShaders);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user