video.h 2.3 KB

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