Texture.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. * Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
  4. * Copyright (c) 2022, the SerenityOS developers.
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #pragma once
  9. #include <AK/RefCounted.h>
  10. #include <LibGPU/Image.h>
  11. namespace GL {
  12. class Texture : public RefCounted<Texture> {
  13. public:
  14. virtual ~Texture() = default;
  15. virtual bool is_texture_1d() const { return false; }
  16. virtual bool is_texture_2d() const { return false; }
  17. virtual bool is_texture_3d() const { return false; }
  18. virtual bool is_cube_map() const { return false; }
  19. RefPtr<GPU::Image> device_image() const { return m_device_image; }
  20. RefPtr<GPU::Image> device_image() { return m_device_image; }
  21. void set_device_image(RefPtr<GPU::Image> image) { m_device_image = image; }
  22. float level_of_detail_bias() const { return m_level_of_detail_bias; }
  23. void set_level_of_detail_bias(float level_of_detail_bias) { m_level_of_detail_bias = level_of_detail_bias; }
  24. private:
  25. RefPtr<GPU::Image> m_device_image;
  26. float m_level_of_detail_bias { 0.f };
  27. };
  28. }