hedgewars/SDLh.pas
changeset 2697 75880595a9f1
parent 2690 8e83c7e31720
child 2698 90585aba87ad
equal deleted inserted replaced
2696:41aa7b56c17b 2697:75880595a9f1
   171 {$ELSE}
   171 {$ELSE}
   172 	RMask = $FF000000;
   172 	RMask = $FF000000;
   173 	GMask = $00FF0000;
   173 	GMask = $00FF0000;
   174 	BMask = $0000FF00;
   174 	BMask = $0000FF00;
   175 	AMask = $000000FF;
   175 	AMask = $000000FF;
       
   176 {$ENDIF}
       
   177 
       
   178 {$IFDEF SDL13}
       
   179 // SDL_WindowFlags (enum)
       
   180     SDL_WINDOW_FULLSCREEN = $00000001;         //*< fullscreen window, implies borderless */
       
   181     SDL_WINDOW_OPENGL = $00000002;             //*< window usable with OpenGL context */
       
   182     SDL_WINDOW_SHOWN = $00000004;              //*< window is visible */
       
   183     SDL_WINDOW_BORDERLESS = $00000008;         //*< no window decoration */
       
   184     SDL_WINDOW_RESIZABLE = $00000010;          //*< window can be resized */
       
   185     SDL_WINDOW_MINIMIZED = $00000020;          //*< window is minimized */
       
   186     SDL_WINDOW_MAXIMIZED = $00000040;          //*< window is maximized */
       
   187     SDL_WINDOW_INPUT_GRABBED = $00000100;      //*< window has grabbed input focus */
       
   188     SDL_WINDOW_INPUT_FOCUS = $00000200;        //*< window has input focus */
       
   189     SDL_WINDOW_MOUSE_FOCUS = $00000400;        //*< window has mouse focus */
       
   190     SDL_WINDOW_FOREIGN = $00000800;            //*< window not created by SDL */
   176 {$ENDIF}
   191 {$ENDIF}
   177 
   192 
   178 	{* SDL_mixer *}
   193 	{* SDL_mixer *}
   179 	MIX_MAX_VOLUME = 128;
   194 	MIX_MAX_VOLUME = 128;
   180 	MIX_INIT_FLAC = $00000001;
   195 	MIX_INIT_FLAC = $00000001;
   311 
   326 
   312 {* SDL_Event type definition *}
   327 {* SDL_Event type definition *}
   313 
   328 
   314 {$IFDEF SDL13}
   329 {$IFDEF SDL13}
   315 	TSDL_WindowID = LongInt;
   330 	TSDL_WindowID = LongInt;
   316 
   331 	TSDL_TextureID = LongInt;
       
   332 	
   317 	TSDL_WindowEvent = record
   333 	TSDL_WindowEvent = record
   318 		type_: byte;
   334 		type_: byte;
   319 		gain: byte;
   335 		gain: byte;
   320 		state: byte;
   336 		state: byte;
   321 		windowID: TSDL_WindowID;
   337 		windowID: TSDL_WindowID;
   608 
   624 
   609 function  SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName;
   625 function  SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName;
   610 function  SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName;
   626 function  SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName;
   611 
   627 
   612 {$IFDEF SDL13}
   628 {$IFDEF SDL13}
       
   629 function  SDL_CreateWindow(title: PChar; x,y,w,h, flags: LongInt): TSDL_WindowID; cdecl; external SDLLibName;
       
   630 function  SDL_CreateRenderer(windowID: TSDL_WindowID; index, flags: LongInt): LongInt; cdecl; external SDLLibName;
       
   631 function  SDL_SetRenderDrawColor(r,g,b,a: byte): LongInt; cdecl; external SDLLibName;
       
   632 function  SDL_RenderFill(rect: PSDL_Rect): LongInt;
       
   633 function  SDL_RenderFillRect(rect: PSDL_Rect): LongInt; cdecl; external SDLLibName;
       
   634 function  SDL_RenderClear: LongInt; cdecl; external SDLLibName;
       
   635 procedure SDL_RenderPresent; cdecl; external SDLLibName;
       
   636 function  SDL_RenderCopy(textureID: TSDL_TextureID; srcrect, dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName;
       
   637 
       
   638 function  SDL_CreateTextureFromSurface(format: LongInt; surface: PSDL_Surface): TSDL_TextureID; cdecl; external SDLLibName;
       
   639 procedure SDL_DestroyTexture(textureID: TSDL_TextureID); cdecl; external SDLLibName;
       
   640 
   613 function  SDL_GetKeyboardState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   641 function  SDL_GetKeyboardState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   614 function  SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName;
   642 function  SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName;
   615 function  SDL_GetRelativeMouseState(index: LongInt; x, y: PLongInt): Byte; cdecl; external SDLLibName;
   643 function  SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
   616 function  SDL_GetNumMice: LongInt; cdecl; external SDLLibName;
   644 function  SDL_GetNumMice: LongInt; cdecl; external SDLLibName;
   617 function  SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName;
   645 function  SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName;
   618 {$ELSE}
   646 {$ELSE}
   619 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   647 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   620 {$ENDIF}
   648 {$ENDIF}
   765                   (PByteArray(buf)^[2] shl  8) or
   793                   (PByteArray(buf)^[2] shl  8) or
   766                   (PByteArray(buf)^[1] shl 16) or
   794                   (PByteArray(buf)^[1] shl 16) or
   767                   (PByteArray(buf)^[0] shl 24)
   795                   (PByteArray(buf)^[0] shl 24)
   768 end;
   796 end;
   769 
   797 
       
   798 {$IFDEF SDL13}
       
   799 function SDL_RenderFill(rect: PSDL_Rect): LongInt;
       
   800 var res: LongInt;
       
   801 begin
       
   802 	if (rect <> nil) then res:= SDL_RenderFillRect(rect)
       
   803 	else res:= SDL_RenderClear();
       
   804 	exit(res);
       
   805 end;
       
   806 {$ENDIF}
       
   807 
   770 end.
   808 end.
   771 
   809