7cbe8acf30
Now the code is being compiled through .lib files!
60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
#include "TextureGenerator.h"
|
|
|
|
#include <charcoal/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()
|
|
{
|
|
return TextureFactory::gen_sampler(Sampler::Wrap::REPEAT, Sampler::Wrap::REPEAT, Sampler::MagFilter::NEAREST, Sampler::MinFilter::NEAREST);
|
|
}
|
|
}
|
|
}
|
|
} |