texture.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * 3D Engine
  3. * texture.h:
  4. * Based on pikuma.com 3D software renderer in C
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 07/03/2021.
  8. */
  9. #ifndef THREEDENGINE_SOURCE_INCLUDE_TEXTURE_H
  10. #define THREEDENGINE_SOURCE_INCLUDE_TEXTURE_H
  11. #include <stdint.h>
  12. #include <upng.h>
  13. #include <colour.h>
  14. /***********************************************************************************************************************
  15. * Data types
  16. **********************************************************************************************************************/
  17. typedef struct tex2_t
  18. {
  19. double u, v;
  20. } tex2_t;
  21. typedef struct texture_t
  22. {
  23. upng_t *png;
  24. colour_t *data;
  25. int width;
  26. int height;
  27. } texture_t;
  28. /***********************************************************************************************************************
  29. * Prototypes
  30. **********************************************************************************************************************/
  31. void loadTextureDateFromPng(texture_t *texture, const char *filepath);
  32. void textureCleanup(texture_t *texture);
  33. #endif /* THREEDENGINE_SOURCE_INCLUDE_TEXTURE_H */