Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Updated JEDI-SDL.inc for D2009

  1. #1

    Updated JEDI-SDL.inc for D2009

    If you get Delphi 2009, JEDI-SDL will no longer compile due to a missing version directive in JEDI-SDL.inc. Here's an updated version that fixes the problem:

    Code:
    {
      $Id: jedi-sdl.inc,v 1.15 2007/05/29 21:30:48 savage Exp $
    }
    {******************************************************************************}
    {                                                                              }
    {       Borland Delphi SDL - Simple DirectMedia Layer                          }
    {       Global Conditional Definitions for JEDI-SDL cross-compilation          }
    {                                                                              }
    {                                                                              }
    { The initial developer of this Pascal code was :                              }
    &#123;  Prof. Abimbola Olowofoyeku <http>         &#125;
    &#123;                                                                              &#125;
    &#123; Portions created by Prof. Abimbola Olowofoyeku are                           &#125;
    &#123; Copyright &#40;C&#41; 2000 - 2100 Prof. Abimbola Olowofoyeku.                        &#125;
    &#123;                                                                              &#125;
    &#123;                                                                              &#125;
    &#123; Contributor&#40;s&#41;                                                               &#125;
    &#123; --------------                                                               &#125;
    &#123;  Prof. Abimbola Olowofoyeku <http>         &#125;
    &#123;  Dominqiue Louis <Dominique>                           &#125;
    &#123;                                                                              &#125;
    &#123; Obtained through&#58;                                                            &#125;
    &#123; Joint Endeavour of Delphi Innovators &#40; Project JEDI &#41;                        &#125;
    &#123;                                                                              &#125;
    &#123; You may retrieve the latest version of this file at the Project              &#125;
    &#123; JEDI home page, located at http&#58;//delphi-jedi.org                            &#125;
    &#123;                                                                              &#125;
    &#123; The contents of this file are used with permission, subject to               &#125;
    &#123; the Mozilla Public License Version 1.1 &#40;the "License"&#41;; you may              &#125;
    &#123; not use this file except in compliance with the License. You may             &#125;
    &#123; obtain a copy of the License at                                              &#125;
    &#123; http&#58;//www.mozilla.org/MPL/MPL-1.1.html                                      &#125;
    &#123;                                                                              &#125;
    &#123; Software distributed under the License is distributed on an                  &#125;
    &#123; "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or               &#125;
    &#123; implied. See the License for the specific language governing                 &#125;
    &#123; rights and limitations under the License.                                    &#125;
    &#123;                                                                              &#125;
    &#123; Description                                                                  &#125;
    &#123; -----------                                                                  &#125;
    &#123; This code has been copied from...                                            &#125;
    &#123; Global Conditional Definitions for Chief's UNZIP package                     &#125;
    &#123; By Prof. Abimbola Olowofoyeku &#40;The African Chief&#41;                            &#125;
    &#123;          http&#58;//www.bigfoot.com/~African_Chief/                              &#125;
    &#123;                                                                              &#125;
    &#123;                                                                              &#125;
    &#123; Requires                                                                     &#125;
    &#123; --------                                                                     &#125;
    &#123;   The SDL Runtime libraris on Win32  &#58; SDL.dll on Linux &#58; libSDL.so          &#125;
    &#123;   They are available from...                                                 &#125;
    &#123;   http&#58;//www.libsdl.org .                                                    &#125;
    &#123;                                                                              &#125;
    &#123; Programming Notes                                                            &#125;
    &#123; -----------------                                                            &#125;
    &#123;                                                                              &#125;
    &#123;                                                                              &#125;
    &#123;                                                                              &#125;
    &#123;                                                                              &#125;
    &#123; Revision History                                                             &#125;
    &#123; ----------------                                                             &#125;
    &#123;   2003-04-03   DL - Initial addition                                         &#125;
    &#123;                                                                              &#125;
    &#123;   2003-04-07   DL - Added Macro ON derective for FPC and OpenGL and removed  &#125;
    &#123;                WEAKPACKAGE derective. WEAKPACKAGE should be set when         &#125;
    &#123;                appropriate.                                                  &#125;
    &#123;                                                                              &#125;
    &#123;   2003-04-23 - DL &#58; under instruction from Alexey Barkovoy I have added      &#125;
    &#123;                          better TMT Pascal support and under instruction     &#125;
    &#123;                          from Prof. Abimbola Olowofoyeku &#40;The African Chief&#41; &#125;
    &#123;                          I have added better Gnu Pascal support              &#125;
    &#123;                                                                              &#125;
    &#123;   2004-01-19 - DL &#58; Under instruction from Marco van de Voort, I have added  &#125;
    &#123;                     Better FPC support for FreeBSD.                          &#125;
    &#123;                                                                              &#125;
    &#40;*
      $Log&#58; jedi-sdl.inc,v $
      Revision 1.15  2007/05/29 21&#58;30&#58;48  savage
      Changes as suggested by Almindor for 64bit compatibility.
    
      Revision 1.14  2007/05/20 20&#58;29&#58;11  savage
      Initial Changes to Handle 64 Bits
    
      Revision 1.13  2007/01/21 15&#58;51&#58;45  savage
      Added Delphi 2006 support
    
      Revision 1.12  2006/11/19 18&#58;41&#58;01  savage
      removed THREADING ON flag as it is no longer needed in latest versions of FPC.
    
      Revision 1.11  2006/01/04 00&#58;52&#58;41  drellis
      Updated to include defined for ENDIAN values, SDL_BYTEORDER should now be correctly defined depending onthe platform. Code taken from sdl_mixer
    
      Revision 1.10  2005/05/22 18&#58;42&#58;31  savage
      Changes as suggested by Michalis Kamburelis. Thanks again.
    
      Revision 1.9  2004/12/23 23&#58;42&#58;17  savage
      Applied Patches supplied by Michalis Kamburelis &#40; THANKS! &#41;, for greater FreePascal compatability.
    
      Revision 1.8  2004/10/20 22&#58;43&#58;04  savage
      Ensure that UNSAFE type warning are off in D9 as well
    
      Revision 1.7  2004/04/05 09&#58;59&#58;51  savage
      Changes for FreePacal as suggested by Marco
    
      Revision 1.6  2004/03/31 22&#58;18&#58;15  savage
      Small comment for turning off warning under GnuPascal
    
      Revision 1.5  2004/03/30 22&#58;41&#58;02  savage
      Added extra commenting due to previous compiler directive
    
      Revision 1.4  2004/03/30 22&#58;08&#58;33  savage
      Added Kylix Define
    
      Revision 1.3  2004/03/30 21&#58;34&#58;40  savage
      &#123;$H+&#125; needed for FPC compatiblity
    
      Revision 1.2  2004/02/14 00&#58;23&#58;39  savage
      As UNIX is defined in jedi-sdl.inc this will be used to check linux compatability as well. Units have been changed to reflect this change.
    
    *&#41;
    &#123;******************************************************************************&#125;
    
    &#123;.$define Debug&#125;           &#123; uncomment for debugging &#125;
    
    &#123;$IFNDEF FPC&#125;
      &#123;$IFDEF __GPC__&#125;
        &#123;$I-&#125;
        &#123;$W-&#125; // turn off GPC warnings
        &#123;$X+&#125;
      &#123;$ELSE&#125; &#123;__GPC__&#125;
        &#123;$IFDEF Debug&#125;
          &#123;$F+,D+,Q-,L+,R+,I-,S+,Y+,A+&#125;
        &#123;$ELSE&#125;
          &#123;$F+,Q-,R-,S-,I-,A+&#125;
        &#123;$ENDIF&#125;
      &#123;$ENDIF&#125; &#123;__GPC__&#125;
    &#123;$ELSE&#125;  &#123;FPC&#125;
      //&#123;$M+&#125;
    &#123;$ENDIF&#125; &#123;FPC&#125;
    
    &#123;$IFDEF LINUX&#125;
    &#123;$DEFINE UNIX&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF ver70&#125;
       &#123;$IFDEF Windows&#125;
         &#123;$DEFINE Win16&#125;
       &#123;$ENDIF Windows&#125;
       &#123;$IFDEF MSDOS&#125;
         &#123;$DEFINE NO_EXPORTS&#125;
       &#123;$ENDIF MSDOS&#125;
       &#123;$IFDEF DPMI&#125;
         &#123;$DEFINE BP_DPMI&#125;
       &#123;$ENDIF&#125;
       &#123;$DEFINE OS_16_BIT&#125;
       &#123;$DEFINE __OS_DOS__&#125;
    &#123;$ENDIF ver70&#125;
    
    &#123;$IFDEF ver80&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 1.x&#125;
       &#123;$DEFINE Delphi16&#125;
       &#123;$DEFINE Win16&#125;
       &#123;$DEFINE OS_16_BIT&#125;
       &#123;$DEFINE __OS_DOS__&#125;
    &#123;$ENDIF ver80&#125;
    
    &#123;$IFDEF ver90&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 2.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE WIN32&#125;
       &#123;$DEFINE WINDOWS&#125;
    &#123;$ENDIF ver90&#125;
    
    &#123;$IFDEF ver100&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 3.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE WIN32&#125;
       &#123;$DEFINE WINDOWS&#125;
    &#123;$ENDIF ver100&#125;
    
    &#123;$IFDEF ver93&#125;
       &#123;$DEFINE Delphi&#125;      &#123;C++ Builder 1.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE WINDOWS&#125;
    &#123;$ENDIF ver93&#125;
    
    &#123;$IFDEF ver110&#125;
       &#123;$DEFINE Delphi&#125;      &#123;C++ Builder 3.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE WINDOWS&#125;
    &#123;$ENDIF ver110&#125;
    
    &#123;$IFDEF ver120&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 4.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE WINDOWS&#125;
    &#123;$ENDIF ver120&#125;
    
    &#123;$IFDEF ver130&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 5.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE WINDOWS&#125;
    &#123;$ENDIF ver130&#125;
    
    &#123;$IFDEF ver140&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 6.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver140&#125;
    
    &#123;$IFDEF ver150&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 7.x&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Delphi7UP&#125;
       &#123;$WARN UNSAFE_TYPE OFF&#125; &#123;Disable warning for unsafe types in Delphi 7&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver150&#125;
    
    &#123;$IFDEF ver160&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 8&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Delphi7UP&#125;
       &#123;$DEFINE Delphi8UP&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver160&#125;
    
    &#123;$IFDEF ver170&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 2005&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Delphi7UP&#125;
       &#123;$DEFINE Delphi8UP&#125;
       &#123;$DEFINE Delphi9UP&#125;
       &#123;$WARN UNSAFE_TYPE OFF&#125; &#123;Disable warning for unsafe types in Delphi 7&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver170&#125;
    
    &#123;$IFDEF ver180&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 2006&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Delphi7UP&#125;
       &#123;$DEFINE Delphi8UP&#125;
       &#123;$DEFINE Delphi9UP&#125;
       &#123;$DEFINE Delphi10UP&#125;
       &#123;$WARN UNSAFE_TYPE OFF&#125; &#123;Disable warning for unsafe types in Delphi 7&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver180&#125;
    
    &#123;$IFDEF ver185&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 2007&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Delphi7UP&#125;
       &#123;$DEFINE Delphi8UP&#125;
       &#123;$DEFINE Delphi9UP&#125;
       &#123;$DEFINE Delphi10UP&#125;
       &#123;$DEFINE Delphi11UP&#125;
       &#123;$WARN UNSAFE_TYPE OFF&#125; &#123;Disable warning for unsafe types in Delphi 7&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver185&#125;
    
    &#123;$IFDEF ver200&#125;
       &#123;$DEFINE Delphi&#125;      &#123;Delphi 2009&#125;
       &#123;$DEFINE Delphi32&#125;
       &#123;$DEFINE Delphi4UP&#125;
       &#123;$DEFINE Delphi5UP&#125;
       &#123;$DEFINE Delphi6UP&#125;
       &#123;$DEFINE Delphi7UP&#125;
       &#123;$DEFINE Delphi8UP&#125;
       &#123;$DEFINE Delphi9UP&#125;
       &#123;$DEFINE Delphi10UP&#125;
       &#123;$DEFINE Delphi11UP&#125;
       &#123;$DEFINE Delphi12UP&#125;
       &#123;$WARN UNSAFE_TYPE OFF&#125; &#123;Disable warning for unsafe types in Delphi 7&#125;
       &#123;$DEFINE Has_Int64&#125;
       &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF ver200&#125;
    
    &#123;$IFDEF UNIX&#125;
      &#123;$ifdef VER140&#125;    // Kylix 1 & 2
        &#123;$DEFINE KYLIX&#125;
        &#123;$DEFINE KYLIX1UP&#125;
        &#123;$DEFINE KYLIX2UP&#125;
        &#123;$DEFINE HAS_TYPES&#125;
      &#123;$endif&#125;
    
      &#123;$ifdef VER150&#125;   // Kylix 3
        &#123;$DEFINE KYLIX&#125;
        &#123;$DEFINE KYLIX1UP&#125;
        &#123;$DEFINE KYLIX2UP&#125;
        &#123;$DEFINE KYLIX3UP&#125;
        &#123;$DEFINE HAS_TYPES&#125;
      &#123;$endif&#125;
    &#123;$ENDIF UNIX&#125;
    
    &#123;$IFDEF VirtualPascal&#125; &#123;  Virtual Pascal 2.x &#125;
       &#123;$DEFINE Delphi&#125;    &#123;  Use Delphi Syntax &#125;
       &#123;$DEFINE VP2&#125;
       &#123;&Delphi+&#125;
    &#123;$ENDIF VirtualPascal&#125;
    
    &#123;$IFDEF Delphi&#125;
      &#123;$DEFINE Windows&#125;
      &#123;$DEFINE USE_STDCALL&#125;
      //&#123;$ALIGN ON&#125;
    &#123;$ENDIF Delphi&#125;
    
    &#123;$IFDEF FPC&#125;
      &#123;$MODE Delphi&#125;          &#123; use Delphi compatibility mode &#125;
      &#123;$H+&#125;
      &#123;$PACKRECORDS C&#125;        // Added for record
      &#123;$MACRO ON&#125;             // Added For OpenGL
      &#123;$DEFINE Delphi&#125;
      &#123;$DEFINE UseAT&#125;
      &#123;$UNDEF USE_STDCALL&#125;
      &#123;$DEFINE OS_BigMem&#125;
      &#123;$DEFINE NO_EXPORTS&#125;
      &#123;$DEFINE Has_Int64&#125;
      &#123;$DEFINE NOCRT&#125;
      &#123;$IFDEF UNIX&#125;
         &#123;$DEFINE fpc_unix&#125;
      &#123;$ELSE&#125;
         &#123;$DEFINE __OS_DOS__&#125;
      &#123;$ENDIF&#125;
      &#123;$IFDEF WIN32&#125;
       &#123;$DEFINE UseWin&#125;
      &#123;$ENDIF&#125;
      &#123;$DEFINE HAS_TYPES&#125;
    &#123;$ENDIF FPC&#125;
    
    &#123;$IFDEF Win16&#125;
      &#123;$K+&#125;   &#123;smart callbacks&#125;
    &#123;$ENDIF Win16&#125;
    
     &#123;$IFDEF OS2&#125;
        &#123;$UNDEF Windows&#125;
        &#123;$DEFINE UseWin&#125;
        &#123;$DEFINE OS_BigMem&#125;
     &#123;$ENDIF OS2&#125;
    
    &#123;$IFDEF __GPC__&#125;
      &#123;$UNDEF UseWin&#125;
      &#123;$UNDEF USE_STDCALL&#125;
      &#123;$DEFINE OS_BigMem&#125;
      &#123;$DEFINE NO_EXPORTS&#125;
      &#123;$DEFINE NOCRT&#125;
      &#123;$DEFINE cdecl attribute&#40;cdecl&#41;&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF __TMT__&#125;
      &#123;$DEFINE OS_BigMem&#125;
      &#123;$DEFINE NO_EXPORTS&#125;
      &#123;$DEFINE __OS_DOS__&#125;
      &#123;$DEFINE UseAT&#125;
      &#123;$IFNDEF MSDOS&#125;
        &#123;$DEFINE USE_STDCALL&#125;
      &#123;$ENDIF&#125;
    
      &#123;$IFDEF __WIN32__&#125;
        &#123;$DEFINE Win32&#125;
        &#123;$DEFINE UseWin&#125;
        &#123;$DEFINE NOCRT&#125;
        &#123;$DEFINE Win32&#125;
        &#123;$IFNDEF __CON__&#125;
          &#123;$DEFINE Windows&#125;
        &#123;$ENDIF&#125;
      &#123;$ENDIF&#125;
    
      &#123;$A+&#125;  // Word alignment data
      &#123;$OA+&#125; // Objects and structures align
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF Win32&#125;
      &#123;$DEFINE OS_BigMem&#125;
    &#123;$ELSE Win32&#125;
      &#123;$IFDEF ver70&#125;
        &#123;$DEFINE assembler&#125;
      &#123;$ENDIF&#125; &#123; use 16-bit assembler! &#125;
    &#123;$ENDIF Win32&#125;
    
    &#123; ************************** dos/dos-like platforms **************&#125;
    &#123;$IFDEF Windows&#125;
       &#123;$DEFINE __OS_DOS__&#125;
       &#123;$DEFINE UseWin&#125;
       &#123;$DEFINE MSWINDOWS&#125;
    &#123;$ENDIF Delphi&#125;
    
    &#123;$IFDEF OS2&#125;
       &#123;$DEFINE __OS_DOS__&#125;
       &#123;$DEFINE Can_Use_DLL&#125;
    &#123;$ENDIF Delphi&#125;
    
    &#123;$IFDEF UseWin&#125;
       &#123;$DEFINE Can_Use_DLL&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF Win16&#125;
       &#123;$DEFINE Can_Use_DLL&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF BP_DPMI&#125;
       &#123;$DEFINE Can_Use_DLL&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF USE_STDCALL&#125;
       &#123;$IFNDEF __TMT__&#125;
         &#123;$DEFINE BY_NAME&#125;
       &#123;$ENDIF&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFNDEF ver70&#125;
      &#123;$UNDEF assembler&#125;
    &#123;$ENDIF&#125;
    
    &#123;*************** define LITTLE ENDIAN platforms ********************&#125;
    
    
    &#123;$IFDEF Delphi&#125;
    &#123;$DEFINE IA32&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF KYLIX&#125;
    &#123;$DEFINE IA32&#125;
    &#123;$ENDIF&#125;
    
    &#123;$IFDEF FPC&#125;
    &#123;$IFDEF FPC_LITTLE_ENDIAN&#125;
    &#123;$DEFINE IA32&#125;
    &#123;$ENDIF&#125;
    &#123;$ENDIF&#125;

  2. #2

    Updated JEDI-SDL.inc for D2009

    Thanks for the update, changes have been made locally, but I'm having some problems commiting to CVS. I'm guessing they changed that interface again.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3

    Updated JEDI-SDL.inc for D2009

    Ok managed to get it checked in. Please download from there and retest if possible. I also checked in a small update to sdl.pas.

    If all goes well I'll upload a Release Candidate 3 later this week. That will be the very last RC before v1.0 is finally finally offically released.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #4

    Updated JEDI-SDL.inc for D2009

    I'm using Delphi 2009 and SDL_WM_SetCaption doesn't work as it should. PChar is actually PWideChar in Delphi 2009. When I call SDL_WM_SetCaption('Test', 'Test'), my window's caption is set to 'T'... all other characters are discarded (I guess wide representation of char T contains null character after T ASCII character and that is why SDL_WM_SetCaption use only first letter).

    I didn't test other functions that use PChar type, but they probably don't work either.

    Using PAnsiChar instead of PChar would solve the problem.

  5. #5

    Updated JEDI-SDL.inc for D2009

    Quote Originally Posted by Srki_82
    I'm using Delphi 2009 and SDL_WM_SetCaption doesn't work as it should. PChar is actually PWideChar in Delphi 2009. When I call SDL_WM_SetCaption('Test', 'Test'), my window's caption is set to 'T'... all other characters are discarded (I guess wide representation of char T contains null character after T ASCII character and that is why SDL_WM_SetCaption use only first letter).

    I didn't test other functions that use PChar type, but they probably don't work either.

    Using PAnsiChar instead of PChar would solve the problem.
    The second parameter to the SDL_WM_SetCaption should be a pointer to an Icon structure, not text. Unfortunately I don't have D2009, so can't confirm or deny this issue or suggest a workaround.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    Updated JEDI-SDL.inc for D2009

    As far as i know, second parametar is text that is displayed in linux and mac os taskbar, and first parameter is text that is used for window caption and taskpar in windows os.

  7. #7

    Updated JEDI-SDL.inc for D2009

    Quote Originally Posted by savage
    The second parameter to the SDL_WM_SetCaption should be a pointer to an Icon structure, not text. Unfortunately I don't have D2009, so can't confirm or deny this issue or suggest a workaround.
    Like Srki_82 writes, the second parameter is a text, not a pointer to any structure. See docs, http://sdl.beuc.net/sdl.wiki/SDL_WM_SetCaption. Just change all PChar to PAnsiChar (if you want to keep D2009 compat).

  8. #8

    Updated JEDI-SDL.inc for D2009

    Sorry guys, my mistake. Does anyone know FreePascal support PAnsiChar?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #9

    Updated JEDI-SDL.inc for D2009

    Sure it does. I use modified version of sdl.pas form my engine and PAnsyChar compiles fine in Delphi 2007, 2009 and FreePascal 2.2.2, Lazarus 0.9.26 (Windows and Linux... not sure for other OS-es).

  10. #10

    Updated JEDI-SDL.inc for D2009

    TAnsiChar, PAnsiChar are in FPC for all OSes, since at least 3 years + 6 months (looking at SVN repo, http://svn.freepascal.org/cgi-bin/vi...=1&view=markup). So it should be safe to use for *at least* all FPC >= 2.0.0.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •