video.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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_ChangeDepth(
  65. INT bpp
  66. );
  67. VOID
  68. VIDEO_SaveScreenshot(
  69. VOID
  70. );
  71. VOID
  72. VIDEO_ShakeScreen(
  73. WORD wShakeTime,
  74. WORD wShakeLevel
  75. );
  76. VOID
  77. VIDEO_SwitchScreen(
  78. WORD wSpeed
  79. );
  80. VOID
  81. VIDEO_FadeScreen(
  82. WORD wSpeed
  83. );
  84. void
  85. VIDEO_SetWindowTitle(
  86. const char* pszTitle
  87. );
  88. SDL_Surface *
  89. VIDEO_DuplicateSurface(
  90. SDL_Surface *pSource,
  91. const SDL_Rect *pRect
  92. );
  93. SDL_Surface *
  94. VIDEO_CreateCompatibleSurface(
  95. SDL_Surface *pSource
  96. );
  97. SDL_Surface *
  98. VIDEO_CreateCompatibleSizedSurface(
  99. SDL_Surface *pSource,
  100. const SDL_Rect *pSize
  101. );
  102. void
  103. VIDEO_UpdateSurfacePalette(
  104. SDL_Surface *pSurface
  105. );
  106. VOID
  107. VIDEO_DrawSurfaceToScreen(
  108. SDL_Surface *pSurface
  109. );
  110. PAL_C_LINKAGE_END
  111. #endif