Texture.h 698 B

1234567891011121314151617181920212223242526272829
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Jolt/Core/Reference.h>
  6. /// Forward declares
  7. class Surface;
  8. class Texture : public RefTarget<Texture>
  9. {
  10. public:
  11. /// Constructor
  12. Texture(int inWidth, int inHeight) : mWidth(inWidth), mHeight(inHeight) { }
  13. virtual ~Texture() = default;
  14. /// Get dimensions of texture
  15. inline int GetWidth() const { return mWidth; }
  16. inline int GetHeight() const { return mHeight; }
  17. /// Bind texture to the pixel shader
  18. virtual void Bind() const = 0;
  19. protected:
  20. int mWidth;
  21. int mHeight;
  22. };