Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. #ifndef GRAPHICS_H
  2. #define GRAPHICS_H
  3.  
  4. #include <SDL.h>
  5.  
  6. #define PHL_Surface SDL_Surface*
  7.  
  8. #define PHL_RGB SDL_Color
  9.  
  10. typedef struct {
  11.         int tileX[16][12];
  12.         int tileY[16][12];
  13. } PHL_Background;
  14.  
  15. /*
  16. typedef struct {
  17.         unsigned int r, g, b;
  18. } PHL_RGB;
  19. */
  20. /*
  21. typedef struct {
  22.         OSL_IMAGE* pxdata;
  23.         int width;
  24.         int height;
  25.         PHL_RGB colorKey;
  26. } PHL_Surface;
  27. */
  28. extern PHL_Surface screen;
  29.  
  30. extern int wantFullscreen;
  31. extern int screenScale;
  32. extern int desktopFS;
  33.  
  34. extern int deltaX;
  35. extern int deltaY;
  36.  
  37. extern int screenW;
  38. extern int screenH;
  39.  
  40. SDL_Color PHL_NewRGB(uint8_t r, uint8_t g, uint8_t b);
  41. /*
  42. {
  43.     SDL_Color ret = {.r = r, .b = b, .g = g};
  44.     return ret;
  45. }
  46. */
  47. void PHL_GraphicsInit();
  48. void PHL_GraphicsExit();
  49.  
  50. void PHL_StartDrawing();
  51. void PHL_EndDrawing();
  52.  
  53. void PHL_ForceScreenUpdate();
  54.  
  55. void PHL_SetDrawbuffer(PHL_Surface surf);
  56. void PHL_ResetDrawbuffer();
  57.  
  58. //PHL_RGB PHL_NewRGB(int r, int g, int b);
  59. void PHL_SetColorKey(PHL_Surface surf, int r, int g, int b);
  60.  
  61. PHL_Surface PHL_NewSurface(int w, int h);
  62. void PHL_FreeSurface(PHL_Surface surf);
  63.  
  64. //PHL_Surface PHL_LoadBMP(char* fname);
  65. PHL_Surface PHL_LoadBMP(int index);
  66.  
  67. void PHL_DrawRect(int x, int y, int w, int h, SDL_Color col);
  68.  
  69. void PHL_DrawSurface(double x, double y, PHL_Surface surface);
  70. void PHL_DrawSurfacePart(double x, double y, int cropx, int cropy, int cropw, int croph, PHL_Surface surface);
  71.  
  72. void PHL_DrawBackground(PHL_Background back, PHL_Background fore);
  73. void PHL_UpdateBackground(PHL_Background back, PHL_Background fore);
  74.  
  75. int getXBRZ();
  76. void setXBRZ(int active);
  77.  
  78. #endif