primitives.c 557 B

12345678910111213141516171819202122
  1. #ifdef _arch_dreamcast
  2. #include "GL/glkos.h"
  3. #include "GL/glu.h"
  4. #include "GL/glext.h"
  5. #include "kos.h"
  6. #else
  7. #include "GL/gl.h"
  8. #endif
  9. #include "../../include/base.h"
  10. void DrawRectangle(float x, float y, float width, float height, Color color) {
  11. glEnable(GL_BLEND);
  12. glColor4f(color.r/255.0f, color.g/255.0f, color.b/255.0f, color.a/255.0f);
  13. glDisable(GL_TEXTURE_2D);
  14. glBegin(GL_QUADS);
  15. glVertex2f(x, y);
  16. glVertex2f(x + width, y);
  17. glVertex2f(x + width, y + height);
  18. glVertex2f(x, y + height);
  19. glEnd();
  20. }