triangle.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * 3D Engine
  3. * triangle.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 04/03/2021.
  8. */
  9. #ifndef THREEDENGINE_SOURCE_INCLUDE_TRIANGLE_H
  10. #define THREEDENGINE_SOURCE_INCLUDE_TRIANGLE_H
  11. #include <stdint.h>
  12. #include <display.h>
  13. #include <vector.h>
  14. /***********************************************************************************************************************
  15. * Data types
  16. **********************************************************************************************************************/
  17. typedef struct face_t
  18. {
  19. int a, b, c;
  20. } face_t;
  21. typedef struct triangle_t
  22. {
  23. vec2_t points[3];
  24. } triangle_t;
  25. /***********************************************************************************************************************
  26. * Prototypes
  27. **********************************************************************************************************************/
  28. void drawTriangle(int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2, colour_t colour);
  29. void drawFilledTriangle(int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2, colour_t colour);
  30. #endif /* THREEDENGINE_SOURCE_INCLUDE_TRIANGLE_H */