TextureFormat.cpp 985 B

123456789101112131415161718192021222324252627282930
  1. #include "rendering/TextureFormat.h"
  2. TextureFormat::TextureFormat(const GL::TextureFormat& tf, bool linear,
  3. bool depth)
  4. : format(tf), linear(linear), depth(depth) {
  5. }
  6. TextureFormat TextureFormat::color8(int channels, bool linear) {
  7. return TextureFormat(GL::TextureFormat::color8(channels), linear);
  8. }
  9. TextureFormat TextureFormat::float16(int channels, bool linear) {
  10. return TextureFormat(GL::TextureFormat::float16(channels), linear);
  11. }
  12. TextureFormat TextureFormat::float32(int channels, bool linear) {
  13. return TextureFormat(GL::TextureFormat::float32(channels), linear);
  14. }
  15. TextureFormat TextureFormat::depth16(bool linear) {
  16. return TextureFormat(GL::TextureFormat::depth16(), linear, true);
  17. }
  18. TextureFormat TextureFormat::depth32(bool linear) {
  19. return TextureFormat(GL::TextureFormat::depth32(), linear, true);
  20. }
  21. TextureFormat TextureFormat::unknown() {
  22. return TextureFormat(GL::TextureFormat::unknown(), false, false);
  23. }