texture.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 <display.h>
  14. /***********************************************************************************************************************
  15. * Data types
  16. **********************************************************************************************************************/
  17. typedef struct tex2_t
  18. {
  19. double u, v;
  20. } tex2_t;
  21. /***********************************************************************************************************************
  22. * Global variables
  23. **********************************************************************************************************************/
  24. extern int textureWidth;
  25. extern int textureHeight;
  26. extern const uint8_t REDBRICK_TEXTURE[];
  27. colour_t *meshTexture;
  28. extern upng_t *pngTexture;
  29. /***********************************************************************************************************************
  30. * Prototypes
  31. **********************************************************************************************************************/
  32. void loadTextureDateFromPng(const char *filepath);
  33. void textureCleanup();
  34. #endif /* THREEDENGINE_SOURCE_INCLUDE_TEXTURE_H */