gl_primitives.h 948 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of Desktop App Toolkit,
  2. // a set of libraries for developing nice desktop applications.
  3. //
  4. // For license and copyright information please follow this link:
  5. // https://github.com/desktop-app/legal/blob/master/LEGAL
  6. //
  7. #pragma once
  8. #include "ui/gl/gl_math.h"
  9. #include "ui/style/style_core.h"
  10. #include <QOpenGLBuffer>
  11. #include <QOpenGLShaderProgram>
  12. class QOpenGLFunctions;
  13. namespace Ui::GL {
  14. void FillRectTriangleVertices(float *coords, Rect rect);
  15. void FillTriangles(
  16. QOpenGLFunctions &f,
  17. gsl::span<const float> coords,
  18. not_null<QOpenGLBuffer*> buffer,
  19. not_null<QOpenGLShaderProgram*> program,
  20. const QColor &color,
  21. Fn<void()> additional = nullptr);
  22. void FillRectangle(
  23. QOpenGLFunctions &f,
  24. not_null<QOpenGLShaderProgram*> program,
  25. int skipVertices,
  26. const QColor &color);
  27. void FillTexturedRectangle(
  28. QOpenGLFunctions &f,
  29. not_null<QOpenGLShaderProgram*> program,
  30. int skipVertices = 0);
  31. } // namespace Ui::GL