rename engine to src

This commit is contained in:
2018-09-16 14:21:58 +02:00
parent eccb34724e
commit 71de44a7c1
120 changed files with 282 additions and 282 deletions

View File

@@ -0,0 +1,33 @@
#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();
auto& sampler = tex.has_mips ? NodeImage::m_sampler_mips : NodeImage::m_sampler;
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();
sampler.unbind();
tex.unbind();
glDisable(GL_BLEND);
}