base.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include "stdio.h"
  3. typedef struct {
  4. float r;
  5. float g;
  6. float b;
  7. float a;
  8. } Color;
  9. #define LIGHTGRAY (Color){ 200, 200, 200, 255 }
  10. #define WHITE (Color){ 255, 255, 255, 255 }
  11. #define BLACK (Color){ 0, 0, 0, 255 }
  12. #define GRAY (Color){ 130, 130, 130, 255 }
  13. #define DARKGRAY (Color){ 80, 80, 80, 255 }
  14. #define YELLOW (Color){ 253, 249, 0, 255 }
  15. #define GOLD (Color){ 255, 203, 0, 255 }
  16. #define RED (Color){ 255, 0, 0, 255 }
  17. #define BLUE (Color){ 0, 0, 255, 255 }
  18. #define GREEN (Color){ 0, 255, 0, 255 }
  19. extern float screenWidth;
  20. extern float screenHeight;
  21. #ifdef _arch_dreamcast
  22. #define ASSETS_PATH "/cd/assets/"
  23. #else
  24. #define ASSETS_PATH "assets/"
  25. #endif
  26. typedef struct {
  27. float x, y;
  28. } Vector2;
  29. typedef struct {
  30. float x, y, width, height;
  31. } Rectangle;
  32. void glInit(int* pargc, char** argv, int width, int height, const char* title);
  33. void glSwapBuffers();
  34. char* concat_strings(const char* str1, const char* str2);
  35. float GetScreenWidth();
  36. float GetScreenHeight();
  37. void BeginDrawing();
  38. void EndDrawing();
  39. void ClearBackground(Color color);
  40. void InitWindow(int argc, char** argv, int width, int height, const char* title);
  41. void SetWindowShouldClose(int shouldClose);
  42. int WindowShouldClose();
  43. void PollWindowEvents();
  44. int IsKeyPressed(int key);
  45. void UpdateInput();