video.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. #include <SDL_syswm.h>
  26. #define VIDEO_CopySurface(s, sr, t, tr) SDL_BlitSurface((s), (sr), (t), (tr))
  27. #define VIDEO_CopyEntireSurface(s, t) SDL_BlitSurface((s), NULL, (t), NULL)
  28. #define VIDEO_BackupScreen(s) SDL_BlitSurface((s), NULL, gpScreenBak, NULL)
  29. #define VIDEO_RestoreScreen(t) SDL_BlitSurface(gpScreenBak, NULL, (t), NULL)
  30. #define VIDEO_FreeSurface(s) SDL_FreeSurface(s)
  31. PAL_C_LINKAGE_BEGIN
  32. extern SDL_Surface *gpScreen;
  33. extern SDL_Surface *gpScreenBak;
  34. extern volatile BOOL g_bRenderPaused;
  35. INT
  36. VIDEO_Startup(
  37. VOID
  38. );
  39. VOID
  40. VIDEO_Shutdown(
  41. VOID
  42. );
  43. VOID
  44. VIDEO_UpdateScreen(
  45. const SDL_Rect *lpRect
  46. );
  47. VOID
  48. VIDEO_SetPalette(
  49. SDL_Color rgPalette[256]
  50. );
  51. VOID
  52. VIDEO_Resize(
  53. INT w,
  54. INT h
  55. );
  56. SDL_Color *
  57. VIDEO_GetPalette(
  58. VOID
  59. );
  60. VOID
  61. VIDEO_ToggleFullscreen(
  62. VOID
  63. );
  64. VOID
  65. VIDEO_SaveScreenshot(
  66. VOID
  67. );
  68. VOID
  69. VIDEO_ShakeScreen(
  70. WORD wShakeTime,
  71. WORD wShakeLevel
  72. );
  73. VOID
  74. VIDEO_SwitchScreen(
  75. WORD wSpeed
  76. );
  77. VOID
  78. VIDEO_FadeScreen(
  79. WORD wSpeed
  80. );
  81. void
  82. VIDEO_SetWindowTitle(
  83. const char* pszTitle
  84. );
  85. SDL_Surface *
  86. VIDEO_DuplicateSurface(
  87. SDL_Surface *pSource,
  88. const SDL_Rect *pRect
  89. );
  90. SDL_Surface *
  91. VIDEO_CreateCompatibleSurface(
  92. SDL_Surface *pSource
  93. );
  94. SDL_Surface *
  95. VIDEO_CreateCompatibleSizedSurface(
  96. SDL_Surface *pSource,
  97. const SDL_Rect *pSize
  98. );
  99. void
  100. VIDEO_UpdateSurfacePalette(
  101. SDL_Surface *pSurface
  102. );
  103. VOID
  104. VIDEO_DrawSurfaceToScreen(
  105. SDL_Surface *pSurface
  106. );
  107. BOOL
  108. VIDEO_GetWindowInfo(
  109. SDL_SysWMinfo *pInfo
  110. );
  111. PAL_C_LINKAGE_END
  112. #endif