home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / a7xpg0_11.zip / a7xpg / import / SDL.d < prev   
Text File  |  2003-09-20  |  3KB  |  90 lines

  1. /*
  2.     SDL - Simple DirectMedia Layer
  3.     Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
  4.  
  5.     This library is free software; you can redistribute it and/or
  6.     modify it under the terms of the GNU Library General Public
  7.     License as published by the Free Software Foundation; either
  8.     version 2 of the License, or (at your option) any later version.
  9.  
  10.     This library is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.     Library General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU Library General Public
  16.     License along with this library; if not, write to the Free
  17.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  
  19.     Sam Lantinga
  20.     slouken@devolution.com
  21. */
  22.  
  23. import SDL_types;
  24. import SDL_getenv;
  25. import SDL_error;
  26. import SDL_rwops;
  27. import SDL_timer;
  28. import SDL_audio;
  29. import SDL_cdrom;
  30. import SDL_joystick;
  31. import SDL_events;
  32. import SDL_video;
  33. import SDL_byteorder;
  34. import SDL_version;
  35.  
  36. extern(C):
  37.  
  38. /* As of version 0.5, SDL is loaded dynamically into the application */
  39.  
  40. /* These are the flags which may be passed to SDL_Init() -- you should
  41.    specify the subsystems which you will be using in your application.
  42. */
  43. const uint SDL_INIT_TIMER        = 0x00000001;
  44. const uint SDL_INIT_AUDIO        = 0x00000010;
  45. const uint SDL_INIT_VIDEO        = 0x00000020;
  46. const uint SDL_INIT_CDROM        = 0x00000100;
  47. const uint SDL_INIT_JOYSTICK    = 0x00000200;
  48. const uint SDL_INIT_NOPARACHUTE    = 0x00100000;    /* Don't catch fatal signals */
  49. const uint SDL_INIT_EVENTTHREAD    = 0x01000000;    /* Not supported on all OS's */
  50. const uint SDL_INIT_EVERYTHING    = 0x0000FFFF;
  51.  
  52. /* This function loads the SDL dynamically linked library and initializes 
  53.  * the subsystems specified by 'flags' (and those satisfying dependencies)
  54.  * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
  55.  * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
  56.  */
  57. int SDL_Init(Uint32 flags);
  58.  
  59. /* This function initializes specific SDL subsystems */
  60. int SDL_InitSubSystem(Uint32 flags);
  61.  
  62. /* This function cleans up specific SDL subsystems */
  63. void SDL_QuitSubSystem(Uint32 flags);
  64.  
  65. /* This function returns mask of the specified subsystems which have
  66.    been initialized.
  67.    If 'flags' is 0, it returns a mask of all initialized subsystems.
  68. */
  69. Uint32 SDL_WasInit(Uint32 flags);
  70.  
  71. /* This function cleans up all initialized subsystems and unloads the
  72.  * dynamically linked library.  You should call it upon all exit conditions.
  73.  */
  74. void SDL_Quit();
  75.  
  76. void SDL_SetModuleHandle(void *hInst);
  77. extern(Windows) void* GetModuleHandle(char*);
  78.  
  79. static this()
  80. {
  81.     /* Load SDL dynamic link library */
  82.     if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
  83.         throw new Error("Error loading SDL");
  84.     SDL_SetModuleHandle(GetModuleHandle(null));
  85. }
  86.  
  87. static ~this()
  88. {
  89.     SDL_Quit();
  90. }