FlatInput::FlatInput(ImageFormat image_format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height)
: image_format(image_format),
pixel_format(pixel_format),
type(type),
FlatInput::FlatInput(ImageFormat image_format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height)
: image_format(image_format),
pixel_format(pixel_format),
type(type),
{
assert(type == GL_FLOAT || type == GL_UNSIGNED_BYTE);
register_int("output_linear_gamma", &output_linear_gamma);
register_int("needs_mipmaps", &needs_mipmaps);
}
{
assert(type == GL_FLOAT || type == GL_UNSIGNED_BYTE);
register_int("output_linear_gamma", &output_linear_gamma);
register_int("needs_mipmaps", &needs_mipmaps);
}
internal_format = GL_RGBA16F_ARB;
} else if (output_linear_gamma) {
assert(type == GL_UNSIGNED_BYTE);
internal_format = GL_RGBA16F_ARB;
} else if (output_linear_gamma) {
assert(type == GL_UNSIGNED_BYTE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, needs_mipmaps ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR);
check_error();
glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, needs_mipmaps ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR);
check_error();
glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch);