2018-09-16 00:43:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Texture.h"
|
|
|
|
#include "Sampler.h"
|
|
|
|
#include "TextureFactory.h"
|
|
|
|
|
|
|
|
namespace charcoal
|
|
|
|
{
|
|
|
|
namespace builtin
|
|
|
|
{
|
|
|
|
namespace texturegenerator
|
|
|
|
{
|
|
|
|
Texture* gen_quick_cube_texture()
|
|
|
|
{
|
|
|
|
std::vector<unsigned char> values;
|
|
|
|
|
|
|
|
// Front
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
|
|
|
|
// Right
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(255);
|
|
|
|
|
|
|
|
// Back
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
|
|
|
|
// Left
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(255);
|
|
|
|
|
|
|
|
// Top
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(255);
|
|
|
|
|
|
|
|
// Bottom
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(255);
|
|
|
|
values.emplace_back(0);
|
|
|
|
values.emplace_back(255);
|
|
|
|
|
|
|
|
return TextureFactory::gen_texture(Texture::Format::RGBA, Texture::Type::UNSIGNED_BYTE, 6, 1, values, Texture::InternalFormat::RGBA);
|
|
|
|
}
|
|
|
|
|
|
|
|
Sampler* gen_quick_sampler()
|
|
|
|
{
|
2018-09-17 00:50:51 +00:00
|
|
|
return TextureFactory::gen_sampler(Sampler::Wrap::REPEAT, Sampler::Wrap::REPEAT, Sampler::MagFilter::NEAREST, Sampler::MinFilter::NEAREST);
|
2018-09-16 00:43:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|