426 |
435 |
427 {$IFDEF SDL13} |
436 {$IFDEF SDL13} |
428 TSDL_KeySym = record |
437 TSDL_KeySym = record |
429 scancode: LongInt; |
438 scancode: LongInt; |
430 sym: LongInt; |
439 sym: LongInt; |
431 modifier: Smallint; |
440 modifier: Word; |
432 unicode: LongInt; |
441 unicode: LongWord; |
433 end; |
442 end; |
434 |
443 |
435 TSDL_WindowEvent = record |
444 TSDL_WindowEvent = record |
436 type_: LongInt; |
445 type_: LongWord; |
437 windowID: LongInt; |
446 windowID: LongWord; |
438 event: byte; |
447 event: Byte; |
439 padding1, padding2, padding3: byte; |
448 padding1, padding2, padding3: Byte; |
440 data1, data2: LongInt; |
449 data1, data2: LongInt; |
|
450 end; |
|
451 |
|
452 // available in sdl12 but not exposed |
|
453 TSDL_TextEditingEvent = record |
|
454 type_: LongWord; |
|
455 windowID: LongWord; |
|
456 text: array[0..31] of Byte; |
|
457 start, lenght: LongInt; |
|
458 end; |
|
459 |
|
460 // available in sdl12 but not exposed |
|
461 TSDL_TextInputEvent = record |
|
462 type_: LongWord; |
|
463 windowID: LongWord; |
|
464 text: array[0..31] of Byte; |
|
465 end; |
|
466 |
|
467 TSDL_TouchFingerEvent = record |
|
468 type_: LongWord; |
|
469 windowId: LongWord; |
|
470 touchId: Int64; |
|
471 fingerId: Int64; |
|
472 state, padding1, padding2, padding3: Byte; |
|
473 x, y: Word; |
|
474 dx, dy: SmallInt; |
|
475 pressure: Word; |
|
476 end; |
|
477 |
|
478 TSDL_TouchButtonEvent = record |
|
479 type_: LongWord; |
|
480 windowId: LongWord; |
|
481 touchId: Int64; |
|
482 state, button, padding1, padding2: Byte; |
|
483 end; |
|
484 |
|
485 TSDL_MultiGestureEvent = record |
|
486 type_: LongWord; |
|
487 windowId: LongWord; |
|
488 touchId: Int64; |
|
489 dTheta, dDist, x, y: Single; |
|
490 numFingers, padding: Word; |
|
491 end; |
|
492 |
|
493 TSDL_DollarGestureEvent = record |
|
494 type_: LongWord; |
|
495 windowId: LongWord; |
|
496 touchId: Int64; |
|
497 gesturedId: Int64; |
|
498 numFingers: LongWord; |
|
499 error: Single; |
|
500 end; |
|
501 |
|
502 TSDL_SysWMEvent = record |
|
503 type_: LongWord; |
|
504 msg: Pointer; |
441 end; |
505 end; |
442 {$ELSE} |
506 {$ELSE} |
443 TSDL_KeySym = record |
507 TSDL_KeySym = record |
444 scancode: Byte; |
508 scancode: Byte; |
445 sym: Longword; |
509 sym: LongWord; |
446 modifier: Longword; |
510 modifier: LongWord; |
447 unicode: Word; |
511 unicode: Word; |
448 end; |
512 end; |
449 |
513 |
450 // these two are present in sdl1.3 but only for backward compatibility |
|
451 // and in 1.3 type_ is LongInt, not byte |
|
452 TSDL_ActiveEvent = record |
514 TSDL_ActiveEvent = record |
453 type_: byte; |
515 type_: Byte; |
454 gain: byte; |
516 gain: Byte; |
455 state: byte; |
517 state: Byte; |
456 end; |
518 end; |
457 |
519 |
458 TSDL_ResizeEvent = record |
520 TSDL_ResizeEvent = record |
459 type_: Byte; |
521 type_: Byte; |
460 w, h: LongInt; |
522 w, h: LongInt; |
461 end; |
523 end; |
462 {$ENDIF} |
524 {$ENDIF} |
463 |
525 |
464 TSDL_KeyboardEvent = record |
526 TSDL_KeyboardEvent = record |
465 {$IFDEF SDL13} |
527 {$IFDEF SDL13} |
466 type_: LongInt; |
528 type_: LongWord; |
467 windowID: LongInt; |
529 windowID: LongWord; |
468 state, repeat_, padding2, padding3: byte; |
530 state, repeat_, padding2, padding3: Byte; |
469 {$ELSE} |
531 {$ELSE} |
470 type_: byte; |
532 type_, which, state: Byte; |
471 which: byte; |
|
472 state: byte; |
|
473 {$ENDIF} |
533 {$ENDIF} |
474 keysym: TSDL_KeySym; |
534 keysym: TSDL_KeySym; |
475 end; |
535 end; |
476 |
536 |
477 //TODO: implement SDL_TextEditingEvent + SDL_TextInputEvent for sdl13 |
|
478 |
|
479 // this structure is wrong but the correct version makes the game hang |
|
480 TSDL_MouseMotionEvent = record |
537 TSDL_MouseMotionEvent = record |
481 which: byte; |
538 {$IFDEF SDL13} |
482 state: byte; |
539 type_: LongWord; |
483 {$IFDEF SDL13} |
540 windowID: LongWord; |
484 type_: LongInt; |
541 state, padding1, padding2, padding3: Byte; |
485 windowID: LongInt; |
|
486 padding1, padding2: byte; |
|
487 x, y, z, xrel, yrel : LongInt; |
542 x, y, z, xrel, yrel : LongInt; |
488 pressure, pressure_max, pressure_min, |
543 {$ELSE} |
489 rotation, tilt, cursor: LongInt; |
544 type_, which, state: Byte; |
490 {$ELSE} |
545 x, y, xrel, yrel : Word; |
491 type_: byte; |
|
492 x, y, xrel, yrel : word; |
|
493 {$ENDIF} |
546 {$ENDIF} |
494 end; |
547 end; |
495 |
548 |
496 TSDL_MouseButtonEvent = record |
549 TSDL_MouseButtonEvent = record |
497 {$IFDEF SDL13} |
550 {$IFDEF SDL13} |
498 type_: LongInt; |
551 type_: LongWord; |
499 windowID: LongInt; |
552 windowID: LongWord; |
|
553 buttonm, state, padding1, padding2: Byte; |
500 x, y: LongInt; |
554 x, y: LongInt; |
501 padding1: byte; |
555 {$ELSE} |
502 {$ELSE} |
556 type_, which, button, state: Byte; |
503 type_, |
557 x, y: Word; |
504 which, |
558 {$ENDIF} |
505 button, |
559 end; |
506 state: byte; |
560 |
507 x, y: word; |
|
508 {$ENDIF} |
|
509 end; |
|
510 |
|
511 {$IFDEF SDL13} |
|
512 TSDL_MouseWheelEvent = record |
561 TSDL_MouseWheelEvent = record |
513 type_: LongInt; |
562 type_: LongWord; |
514 windowID: LongInt; |
563 {$IFDEF SDL13} |
|
564 windowID: LongWord; |
|
565 {$ELSE} |
515 which: Byte; |
566 which: Byte; |
516 x, y: LongInt; |
567 x, y: LongInt; |
517 end; |
568 end; |
518 |
569 |
519 //TODO: implement SDL_ProximityEvent |
|
520 {$ENDIF} |
|
521 |
|
522 TSDL_JoyAxisEvent = record |
570 TSDL_JoyAxisEvent = record |
523 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
571 type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; |
524 which: Byte; |
572 which: Byte; |
525 axis: Byte; |
573 axis: Byte; |
526 {$IFDEF SDL13} |
574 {$IFDEF SDL13} |
527 padding1, padding2: Byte; |
575 padding1, padding2: Byte; |
528 value: LongInt; |
576 value: LongInt; |
529 {$ELSE} |
577 {$ELSE} |
530 value: Smallint; |
578 value: SmallInt; |
531 {$ENDIF} |
579 {$ENDIF} |
532 end; |
580 end; |
533 |
581 |
534 TSDL_JoyBallEvent = record |
582 TSDL_JoyBallEvent = record |
535 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
583 type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; |
536 which: Byte; |
584 which: Byte; |
537 ball: Byte; |
585 ball: Byte; |
538 {$IFDEF SDL13} |
586 {$IFDEF SDL13} |
539 padding1, padding2: Byte; |
587 padding1, padding2: Byte; |
540 xrel, yrel: LongInt; |
588 xrel, yrel: LongInt; |
541 {$ELSE} |
589 {$ELSE} |
542 xrel, yrel: Smallint; |
590 xrel, yrel: SmallInt; |
543 {$ENDIF} |
591 {$ENDIF} |
544 end; |
592 end; |
545 |
593 |
546 TSDL_JoyHatEvent = record |
594 TSDL_JoyHatEvent = record |
547 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
595 type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; |
548 which: Byte; |
596 which: Byte; |
549 hat: Byte; |
597 hat: Byte; |
550 value: Byte; |
598 value: Byte; |
551 {$IFDEF SDL13} |
599 {$IFDEF SDL13} |
552 padding1: Byte; |
600 padding1: Byte; |
553 {$ENDIF} |
601 {$ENDIF} |
554 end; |
602 end; |
555 |
603 |
556 TSDL_JoyButtonEvent = record |
604 TSDL_JoyButtonEvent = record |
557 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
605 type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF}; |
558 which: Byte; |
606 which: Byte; |
559 button: Byte; |
607 button: Byte; |
560 state: Byte; |
608 state: Byte; |
561 {$IFDEF SDL13} |
609 {$IFDEF SDL13} |
562 padding1: Byte; |
610 padding1: Byte; |
750 ///////////////////// FUNCTION DEFINITIONS ///////////////////// |
805 ///////////////////// FUNCTION DEFINITIONS ///////////////////// |
751 ///////////////////////////////////////////////////////////////// |
806 ///////////////////////////////////////////////////////////////// |
752 |
807 |
753 |
808 |
754 {* SDL *} |
809 {* SDL *} |
755 function SDL_Init(flags: Longword): LongInt; cdecl; external SDLLibName; |
810 function SDL_Init(flags: LongWord): LongInt; cdecl; external SDLLibName; |
756 function SDL_InitSubSystem(flags: LongWord): LongInt; cdecl; external SDLLibName; |
811 function SDL_InitSubSystem(flags: LongWord): LongInt; cdecl; external SDLLibName; |
757 procedure SDL_Quit; cdecl; external SDLLibName; |
812 procedure SDL_Quit; cdecl; external SDLLibName; |
758 |
813 |
759 function SDL_VideoDriverName(var namebuf; maxlen: LongInt): PChar; cdecl; external SDLLibName; |
814 procedure SDL_Delay(msec: LongWord); cdecl; external SDLLibName; |
760 function SDL_EnableUNICODE(enable: LongInt): LongInt; cdecl; external SDLLibName; |
815 function SDL_GetTicks: LongWord; cdecl; external SDLLibName; |
761 function SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; cdecl; external SDLLibName; |
|
762 |
|
763 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName; |
|
764 function SDL_GetTicks: Longword; cdecl; external SDLLibName; |
|
765 |
816 |
766 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
817 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
767 function SDL_LockSurface(Surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
818 function SDL_LockSurface(Surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
768 procedure SDL_UnlockSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
819 procedure SDL_UnlockSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
769 |
820 |
770 function SDL_GetError: PChar; cdecl; external SDLLibName; |
821 function SDL_GetError: PChar; cdecl; external SDLLibName; |
771 |
822 |
772 function SDL_SetVideoMode(width, height, bpp: LongInt; flags: Longword): PSDL_Surface; cdecl; external SDLLibName; |
823 function SDL_SetVideoMode(width, height, bpp: LongInt; flags: LongWord): PSDL_Surface; cdecl; external SDLLibName; |
773 function SDL_CreateRGBSurface(flags: Longword; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
824 function SDL_CreateRGBSurface(flags: LongWord; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName; |
774 function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: Longword): PSDL_Surface; cdecl; external SDLLibName; |
825 function SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName; |
775 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
826 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName; |
776 function SDL_SetColorKey(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; |
827 function SDL_SetColorKey(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName; |
777 function SDL_SetAlpha(surface: PSDL_Surface; flag, key: Longword): LongInt; cdecl; external SDLLibName; |
828 function SDL_SetAlpha(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName; |
778 function SDL_ConvertSurface(src: PSDL_Surface; fmt: PSDL_PixelFormat; flags: LongInt): PSDL_Surface; cdecl; external SDLLibName; |
829 function SDL_ConvertSurface(src: PSDL_Surface; fmt: PSDL_PixelFormat; flags: LongInt): PSDL_Surface; cdecl; external SDLLibName; |
779 |
830 |
780 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
831 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
781 function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: Longword): LongInt; cdecl; external SDLLibName; |
832 function SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: LongWord): LongInt; cdecl; external SDLLibName; |
782 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: Longword); cdecl; external SDLLibName; |
833 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: LongWord); cdecl; external SDLLibName; |
783 function SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
834 function SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
784 |
835 |
785 procedure SDL_GetRGB(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; |
836 procedure SDL_GetRGB(pixel: LongWord; fmt: PSDL_PixelFormat; r, g, b: PByte); cdecl; external SDLLibName; |
786 procedure SDL_GetRGBA(pixel: Longword; fmt: PSDL_PixelFormat; r, g, b, a: PByte); cdecl; external SDLLibName; |
837 procedure SDL_GetRGBA(pixel: LongWord; fmt: PSDL_PixelFormat; r, g, b, a: PByte); cdecl; external SDLLibName; |
787 function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): Longword; cdecl; external SDLLibName; |
838 function SDL_MapRGB(format: PSDL_PixelFormat; r, g, b: Byte): LongWord; cdecl; external SDLLibName; |
788 function SDL_MapRGBA(format: PSDL_PixelFormat; r, g, b, a: Byte): Longword; cdecl; external SDLLibName; |
839 function SDL_MapRGBA(format: PSDL_PixelFormat; r, g, b, a: Byte): LongWord; cdecl; external SDLLibName; |
789 |
840 |
790 function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
841 function SDL_DisplayFormat(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
791 function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
842 function SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName; |
792 |
843 |
793 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
844 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
794 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; |
845 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; |
795 |
846 |
796 {$IFDEF SDL13} |
847 {$IFDEF SDL13} |
797 function SDL_CreateWindow(title: PChar; x,y,w,h, flags: LongInt): PSDL_Window; cdecl; external SDLLibName; |
848 function SDL_CreateWindow(title: PChar; x,y,w,h: LongInt; flags: LongWord): PSDL_Window; cdecl; external SDLLibName; |
798 function SDL_CreateRenderer(window: PSDL_Window; index, flags: LongInt): PSDL_Renderer; cdecl; external SDLLibName; |
849 function SDL_CreateRenderer(window: PSDL_Window; index: LongInt; flags: LongWord): PSDL_Renderer; cdecl; external SDLLibName; |
799 function SDL_DestroyWindow(window: PSDL_Window): LongInt; cdecl; external SDLLibName; |
850 function SDL_DestroyWindow(window: PSDL_Window): LongInt; cdecl; external SDLLibName; |
800 function SDL_DestroyRenderer(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName; |
851 function SDL_DestroyRenderer(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName; |
801 procedure SDL_SetWindowSize(window: PSDL_Window; w, h: LongInt); cdecl; external SDLLibName; |
852 procedure SDL_SetWindowSize(window: PSDL_Window; w, h: LongInt); cdecl; external SDLLibName; |
|
853 function SDL_GetCurrentVideoDriver:Pchar; cdecl; external SDLLibName; |
802 |
854 |
803 function SDL_GL_CreateContext(window: PSDL_Window): PSDL_GLContext; cdecl; external SDLLibName; |
855 function SDL_GL_CreateContext(window: PSDL_Window): PSDL_GLContext; cdecl; external SDLLibName; |
804 procedure SDL_GL_DeleteContext(context: PSDL_GLContext); cdecl; external SDLLibName; |
856 procedure SDL_GL_DeleteContext(context: PSDL_GLContext); cdecl; external SDLLibName; |
805 function SDL_GL_SwapWindow(window: PSDL_Window): LongInt; cdecl; external SDLLibName; |
857 function SDL_GL_SwapWindow(window: PSDL_Window): LongInt; cdecl; external SDLLibName; |
806 function SDL_GL_SetSwapInterval(interval: LongInt): LongInt; cdecl; external SDLLibName; |
858 function SDL_GL_SetSwapInterval(interval: LongInt): LongInt; cdecl; external SDLLibName; |
807 |
859 |
808 procedure SDL_VideoQuit; cdecl; external SDLLibName; |
860 procedure SDL_VideoQuit; cdecl; external SDLLibName; |
809 function SDL_GetNumVideoDisplays: LongInt; cdecl; external SDLLibName; |
861 function SDL_GetNumVideoDisplays: LongInt; cdecl; external SDLLibName; |
810 procedure SDL_ShowWindow(window: PSDL_Window); cdecl; external SDLLibName; |
862 procedure SDL_ShowWindow(window: PSDL_Window); cdecl; external SDLLibName; |
811 |
863 |
812 function SDL_SetRenderDrawColor(renderer: PSDL_Renderer; r,g,b,a: byte): LongInt; cdecl; external SDLLibName; |
864 function SDL_SetRenderDrawColor(renderer: PSDL_Renderer; r,g,b,a: Byte): LongInt; cdecl; external SDLLibName; |
813 function SDL_GetRenderer(window: PSDL_Window): PSDL_Renderer; cdecl; external SDLLibName; |
865 function SDL_GetRenderer(window: PSDL_Window): PSDL_Renderer; cdecl; external SDLLibName; |
814 function SDL_RenderFillRect(renderer: PSDL_Renderer; rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
866 function SDL_RenderFillRect(renderer: PSDL_Renderer; rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
815 function SDL_RenderClear(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName; |
867 function SDL_RenderClear(renderer: PSDL_Renderer): LongInt; cdecl; external SDLLibName; |
816 procedure SDL_RenderPresent(renderer: PSDL_Renderer); cdecl; external SDLLibName; |
868 procedure SDL_RenderPresent(renderer: PSDL_Renderer); cdecl; external SDLLibName; |
817 function SDL_RenderReadPixels(renderer: PSDL_Renderer; rect: PSDL_Rect; format: LongInt; pixels: pointer; pitch: LongInt): LongInt; cdecl; external SDLLibName; |
869 function SDL_RenderReadPixels(renderer: PSDL_Renderer; rect: PSDL_Rect; format: LongInt; pixels: Pointer; pitch: LongInt): LongInt; cdecl; external SDLLibName; |
818 function SDL_RenderSetViewport(window: PSDL_Window; rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
870 function SDL_RenderSetViewport(window: PSDL_Window; rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
819 |
871 |
820 function SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName; |
|
821 function SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
872 function SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
822 function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; |
873 function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): Boolean; cdecl; external SDLLibName; |
823 function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; |
|
824 |
|
825 |
874 |
826 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName; |
875 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName; |
827 function SDL_SetHint(name, value: PChar): boolean; cdecl; external SDLLibName; |
876 function SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName; |
828 |
877 procedure SDL_StartTextInput; cdecl; external SDLLibName; |
829 function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongInt): LongInt; cdecl; external SDLLibName; |
878 |
830 {$ELSE} |
879 function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName; |
831 function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: Longword): LongInt; cdecl; external SDLLibName; |
880 {$ELSE} |
|
881 function SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName; |
832 {$ENDIF} |
882 {$ENDIF} |
833 |
883 |
834 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
884 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
835 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
885 function SDL_GetKeyName(key: LongWord): PChar; cdecl; external SDLLibName; |
836 |
886 |
837 procedure SDL_PumpEvents; cdecl; external SDLLibName; |
887 procedure SDL_PumpEvents; cdecl; external SDLLibName; |
838 function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
888 function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
839 function SDL_WaitEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
889 function SDL_WaitEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
840 procedure SDL_SetEventFilter( filter : TSDL_EventFilter ); cdecl; external SDLLibName; |
890 procedure SDL_SetEventFilter(filter: TSDL_EventFilter); cdecl; external SDLLibName; |
841 |
891 |
842 function SDL_ShowCursor(toggle: LongInt): LongInt; cdecl; external SDLLibName; |
892 function SDL_ShowCursor(toggle: LongInt): LongInt; cdecl; external SDLLibName; |
843 |
893 |
844 procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : byte); cdecl; external SDLLibName; |
894 procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : Byte); cdecl; external SDLLibName; |
845 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; |
895 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName; |
846 function SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
896 function SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName; |
847 |
897 |
848 function SDL_CreateThread(fn: pointer; data: pointer): PSDL_Thread; cdecl; external SDLLibName; |
|
849 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName; |
|
850 function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName; |
898 function SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName; |
851 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName; |
899 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName; |
852 function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; |
900 function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; |
853 function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; |
901 function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; |
854 |
902 |
951 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName; |
1002 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName; |
952 function SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName; |
1003 function SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName; |
953 function SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName; |
1004 function SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName; |
954 |
1005 |
955 |
1006 |
956 procedure SDLNet_Write16(value: Word; buf: pointer); |
1007 procedure SDLNet_Write16(value: Word; buf: Pointer); |
957 procedure SDLNet_Write32(value: LongWord; buf: pointer); |
1008 procedure SDLNet_Write32(value: LongWord; buf: Pointer); |
958 function SDLNet_Read16(buf: pointer): Word; |
1009 function SDLNet_Read16(buf: Pointer): Word; |
959 function SDLNet_Read32(buf: pointer): LongWord; |
1010 function SDLNet_Read32(buf: Pointer): LongWord; |
960 |
1011 |
961 implementation |
1012 implementation |
962 uses uVariables; |
1013 uses strings, uVariables; |
963 |
1014 |
964 {$IFDEF SDL13} |
1015 {$IFDEF SDL13} |
965 // this needs to be reimplemented because in SDL_compat.c the window is the one created in the SDL_SetVideoMode |
1016 // this needs to be reimplemented because in SDL_compat.c the window is the one created in the SDL_SetVideoMode |
966 // compatible function, but we use SDL_CreateWindow, so the window would be NULL |
1017 // compatible function, but we use SDL_CreateWindow, so the window would be NULL |
967 procedure SDL_WarpMouse(x, y: Word); |
1018 procedure SDL_WarpMouse(x, y: Word); |
968 begin |
1019 begin |
969 SDL_WarpMouseInWindow(SDLwindow, x, y); |
1020 SDL_WarpMouseInWindow(SDLwindow, x, y); |
970 end; |
1021 end; |
971 {$ELSE} |
1022 |
972 function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; |
1023 function SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar; |
|
1024 var name : PChar = nil; |
|
1025 begin |
|
1026 name:= SDL_GetCurrentVideoDriver(); |
|
1027 if (name <> nil) and (namebuf <> nil) then |
|
1028 begin |
|
1029 strlcopy(namebuf, name, maxlen); |
|
1030 exit(namebuf) |
|
1031 end; |
|
1032 exit(name); |
|
1033 end; |
|
1034 |
|
1035 function SDL_EnableUNICODE(enable: LongInt): LongInt; |
|
1036 begin |
|
1037 SDL_StartTextInput(); |
|
1038 exit(0); |
|
1039 end; |
|
1040 |
|
1041 function SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; |
|
1042 begin |
|
1043 exit(0); |
|
1044 end; |
|
1045 {$ELSE} |
|
1046 function SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; |
973 const conversionFormat: TSDL_PixelFormat = ( |
1047 const conversionFormat: TSDL_PixelFormat = ( |
974 palette: nil; BitsPerPixel: 32; BytesPerPixel: 4; |
1048 palette: nil; BitsPerPixel: 32; BytesPerPixel: 4; |
975 Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0; |
1049 Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0; |
976 Rshift: RShift; Gshift: GShift; Bshift: BShift; Ashift: AShift; |
1050 Rshift: RShift; Gshift: GShift; Bshift: BShift; Ashift: AShift; |
977 RMask: RMask; GMask: GMask; BMask: BMask; AMask: AMask; |
1051 RMask: RMask; GMask: GMask; BMask: BMask; AMask: AMask; |