video.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
  2. //
  3. // Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
  4. // Copyright (c) 2011-2017, SDLPAL development team.
  5. // All rights reserved.
  6. //
  7. // This file is part of SDLPAL.
  8. //
  9. // SDLPAL is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU General Public License as published by
  11. // the Free Software Foundation, either version 3 of the License, or
  12. // (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. // GNU General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. //
  22. #ifndef VIDEO_H
  23. #define VIDEO_H
  24. #include "common.h"
  25. #define VIDEO_CopySurface(s, sr, t, tr) SDL_BlitSurface((s), (sr), (t), (tr))
  26. #define VIDEO_CopyEntireSurface(s, t) SDL_BlitSurface((s), NULL, (t), NULL)
  27. #define VIDEO_BackupScreen(s) SDL_BlitSurface((s), NULL, gpScreenBak, NULL)
  28. #define VIDEO_RestoreScreen(t) SDL_BlitSurface(gpScreenBak, NULL, (t), NULL)
  29. #define VIDEO_FreeSurface(s) SDL_FreeSurface(s)
  30. PAL_C_LINKAGE_BEGIN
  31. extern SDL_Surface *gpScreen;
  32. extern SDL_Surface *gpScreenBak;
  33. extern volatile BOOL g_bRenderPaused;
  34. INT
  35. VIDEO_Startup(
  36. VOID
  37. );
  38. VOID
  39. VIDEO_Shutdown(
  40. VOID
  41. );
  42. VOID
  43. VIDEO_UpdateScreen(
  44. const SDL_Rect *lpRect
  45. );
  46. VOID
  47. VIDEO_SetPalette(
  48. SDL_Color rgPalette[256]
  49. );
  50. VOID
  51. VIDEO_Resize(
  52. INT w,
  53. INT h
  54. );
  55. SDL_Color *
  56. VIDEO_GetPalette(
  57. VOID
  58. );
  59. VOID
  60. VIDEO_ToggleFullscreen(
  61. VOID
  62. );
  63. VOID
  64. VIDEO_SaveScreenshot(
  65. VOID
  66. );
  67. VOID
  68. VIDEO_ShakeScreen(
  69. WORD wShakeTime,
  70. WORD wShakeLevel
  71. );
  72. VOID
  73. VIDEO_SwitchScreen(
  74. WORD wSpeed
  75. );
  76. VOID
  77. VIDEO_FadeScreen(
  78. WORD wSpeed
  79. );
  80. void
  81. VIDEO_SetWindowTitle(
  82. const char* pszTitle
  83. );
  84. SDL_Surface *
  85. VIDEO_DuplicateSurface(
  86. SDL_Surface *pSource,
  87. const SDL_Rect *pRect
  88. );
  89. SDL_Surface *
  90. VIDEO_CreateCompatibleSurface(
  91. SDL_Surface *pSource
  92. );
  93. SDL_Surface *
  94. VIDEO_CreateCompatibleSizedSurface(
  95. SDL_Surface *pSource,
  96. const SDL_Rect *pSize
  97. );
  98. void
  99. VIDEO_UpdateSurfacePalette(
  100. SDL_Surface *pSurface
  101. );
  102. VOID
  103. VIDEO_DrawSurfaceToScreen(
  104. SDL_Surface *pSurface
  105. );
  106. PAL_C_LINKAGE_END
  107. #endif