refactor layout.h into single file per Node* classes
This commit is contained in:
32
engine/node_image_texture.cpp
Normal file
32
engine/node_image_texture.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "pch.h"
|
||||
#include "log.h"
|
||||
#include "node_image_texture.h"
|
||||
#include "shader.h"
|
||||
#include "node_image.h"
|
||||
|
||||
Node* NodeImageTexture::clone_instantiate() const
|
||||
{
|
||||
return new NodeImageTexture();
|
||||
}
|
||||
|
||||
void NodeImageTexture::clone_copy(Node* dest) const
|
||||
{
|
||||
Node::clone_copy(dest);
|
||||
NodeImageTexture* n = static_cast<NodeImageTexture*>(dest);
|
||||
n->tex = tex;
|
||||
}
|
||||
|
||||
void NodeImageTexture::draw()
|
||||
{
|
||||
using namespace ui;
|
||||
tex.bind();
|
||||
NodeImage::m_sampler.bind(0);
|
||||
glEnable(GL_BLEND);
|
||||
ui::ShaderManager::use(kShader::Texture);
|
||||
ui::ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
ui::ShaderManager::u_mat4(kShaderUniform::MVP, m_mvp);
|
||||
NodeImage::m_plane.draw_fill();
|
||||
NodeImage::m_sampler.unbind();
|
||||
tex.unbind();
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
Reference in New Issue
Block a user