video.h 2.3 KB

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