You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
519 B

  1. #pragma once
  2. #include "Vector3.h"
  3. class Texture2D {
  4. public:
  5. virtual Vector3 Sample(float u, float v) = 0;
  6. };
  7. class TextureSolidColor : public Texture2D {
  8. public:
  9. Vector3 mSolidColor;
  10. TextureSolidColor(const Vector3& color);
  11. Vector3 Sample(float u, float v);
  12. };
  13. class TextureRGB : public Texture2D {
  14. public:
  15. unsigned char* mImageFileContent;
  16. unsigned char* mRGBPixel;
  17. int mWidth, mHeight;
  18. TextureRGB();
  19. ~TextureRGB();
  20. void Set(const char* image_path);
  21. Vector3 Sample(float u, float v);
  22. };