From a48f71ee8e063bf734c6468c18303f8916c7e470 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Sat, 24 Apr 2010 12:52:20 +0000 Subject: [PATCH] Added explicitly the calling convention for calls to the CSFML DLLs, to make SFML.Net compatible with .Net 4.0 git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1517 4e206d99-4929-0410-ac5d-dfc041789085 --- dotnet/src/Audio/Listener.cs | 12 ++--- dotnet/src/Audio/Music.cs | 52 +++++++++---------- dotnet/src/Audio/Sound.cs | 50 +++++++++--------- dotnet/src/Audio/SoundBuffer.cs | 22 ++++---- dotnet/src/Audio/SoundRecorder.cs | 12 ++--- dotnet/src/Audio/SoundStream.cs | 48 +++++++++--------- dotnet/src/Graphics/Context.cs | 6 +-- dotnet/src/Graphics/Font.cs | 18 +++---- dotnet/src/Graphics/Image.cs | 40 +++++++-------- dotnet/src/Graphics/RenderImage.cs | 32 ++++++------ dotnet/src/Graphics/RenderWindow.cs | 64 +++++++++++------------ dotnet/src/Graphics/Shader.cs | 26 +++++----- dotnet/src/Graphics/Shape.cs | 78 ++++++++++++++--------------- dotnet/src/Graphics/Sprite.cs | 66 ++++++++++++------------ dotnet/src/Graphics/Text.cs | 62 +++++++++++------------ dotnet/src/Graphics/View.cs | 36 ++++++------- dotnet/src/Window/Input.cs | 12 ++--- dotnet/src/Window/VideoMode.cs | 6 +-- dotnet/src/Window/Window.cs | 48 +++++++++--------- 19 files changed, 345 insertions(+), 345 deletions(-) diff --git a/dotnet/src/Audio/Listener.cs b/dotnet/src/Audio/Listener.cs index bd04fbf7b..7c834d6ff 100644 --- a/dotnet/src/Audio/Listener.cs +++ b/dotnet/src/Audio/Listener.cs @@ -49,22 +49,22 @@ namespace SFML } #region Imports - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfListener_SetGlobalVolume(float Volume); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfListener_GetGlobalVolume(); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfListener_SetPosition(float X, float Y, float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfListener_GetPosition(out float X, out float Y, out float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfListener_SetDirection(float X, float Y, float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfListener_GetDirection(out float X, out float Y, out float Z); #endregion } diff --git a/dotnet/src/Audio/Music.cs b/dotnet/src/Audio/Music.cs index edf59f2ff..1dc5370c9 100644 --- a/dotnet/src/Audio/Music.cs +++ b/dotnet/src/Audio/Music.cs @@ -250,82 +250,82 @@ namespace SFML } #region Imports - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfMusic_CreateFromFile(string Filename); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern IntPtr sfMusic_CreateFromMemory(char* Data, uint SizeInBytes); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_Destroy(IntPtr MusicStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_Play(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_Pause(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_Stop(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern SoundStatus sfMusic_GetStatus(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfMusic_GetDuration(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfMusic_GetChannelsCount(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfMusic_GetSampleRate(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetPitch(IntPtr Music, float Pitch); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetLoop(IntPtr Music, bool Loop); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetVolume(IntPtr Music, float Volume); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetPosition(IntPtr Music, float X, float Y, float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetRelativeToListener(IntPtr Music, bool Relative); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetMinDistance(IntPtr Music, float MinDistance); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetAttenuation(IntPtr Music, float Attenuation); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_SetPlayingOffset(IntPtr Music, float TimeOffset); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfMusic_GetLoop(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfMusic_GetPitch(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfMusic_GetVolume(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfMusic_GetPosition(IntPtr Music, out float X, out float Y, out float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfMusic_IsRelativeToListener(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfMusic_GetMinDistance(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfMusic_GetAttenuation(IntPtr Music); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfMusic_GetPlayingOffset(IntPtr Music); #endregion } diff --git a/dotnet/src/Audio/Sound.cs b/dotnet/src/Audio/Sound.cs index e2eeb8195..ec70bdc02 100644 --- a/dotnet/src/Audio/Sound.cs +++ b/dotnet/src/Audio/Sound.cs @@ -245,79 +245,79 @@ namespace SFML private SoundBuffer myBuffer; #region Imports - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSound_Create(); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSound_Copy(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_Destroy(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_Play(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_Pause(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_Stop(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetBuffer(IntPtr Sound, IntPtr Buffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSound_GetBuffer(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetLoop(IntPtr Sound, bool Loop); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfSound_GetLoop(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern SoundStatus sfSound_GetStatus(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetPitch(IntPtr Sound, float Pitch); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetVolume(IntPtr Sound, float Volume); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetPosition(IntPtr Sound, float X, float Y, float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetRelativeToListener(IntPtr Sound, bool Relative); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetMinDistance(IntPtr Sound, float MinDistance); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetAttenuation(IntPtr Sound, float Attenuation); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_SetPlayingOffset(IntPtr Sound, float TimeOffset); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSound_GetPitch(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSound_GetVolume(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSound_GetPosition(IntPtr Sound, out float X, out float Y, out float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfSound_IsRelativeToListener(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSound_GetMinDistance(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSound_GetAttenuation(IntPtr Sound); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSound_GetPlayingOffset(IntPtr Sound); #endregion } diff --git a/dotnet/src/Audio/SoundBuffer.cs b/dotnet/src/Audio/SoundBuffer.cs index 3164ac5d9..026628932 100644 --- a/dotnet/src/Audio/SoundBuffer.cs +++ b/dotnet/src/Audio/SoundBuffer.cs @@ -171,37 +171,37 @@ namespace SFML } #region Imports - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSoundBuffer_CreateFromFile(string Filename); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern IntPtr sfSoundBuffer_CreateFromMemory(char* Data, uint SizeInBytes); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern IntPtr sfSoundBuffer_CreateFromSamples(short* Samples, uint SamplesCount, uint ChannelsCount, uint SampleRate); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSoundBuffer_Copy(IntPtr SoundBuffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundBuffer_Destroy(IntPtr SoundBuffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfSoundBuffer_SaveToFile(IntPtr SoundBuffer, string Filename); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSoundBuffer_GetSamples(IntPtr SoundBuffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfSoundBuffer_GetSamplesCount(IntPtr SoundBuffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfSoundBuffer_GetSampleRate(IntPtr SoundBuffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfSoundBuffer_GetChannelsCount(IntPtr SoundBuffer); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSoundBuffer_GetDuration(IntPtr SoundBuffer); #endregion } diff --git a/dotnet/src/Audio/SoundRecorder.cs b/dotnet/src/Audio/SoundRecorder.cs index c84dd8709..40761ff4e 100644 --- a/dotnet/src/Audio/SoundRecorder.cs +++ b/dotnet/src/Audio/SoundRecorder.cs @@ -169,22 +169,22 @@ namespace SFML private StopCallback myStopCallback; #region Imports - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSoundRecorder_Create(StartCallback OnStart, ProcessCallback OnProcess, StopCallback OnStop, IntPtr UserData); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundRecorder_Destroy(IntPtr SoundRecorder); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundRecorder_Start(IntPtr SoundRecorder, uint SampleRate); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundRecorder_Stop(IntPtr SoundRecorder); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfSoundRecorder_GetSampleRate(IntPtr SoundRecorder); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfSoundRecorder_IsAvailable(); #endregion } diff --git a/dotnet/src/Audio/SoundStream.cs b/dotnet/src/Audio/SoundStream.cs index dc670ccfa..5e7493552 100644 --- a/dotnet/src/Audio/SoundStream.cs +++ b/dotnet/src/Audio/SoundStream.cs @@ -309,76 +309,76 @@ namespace SFML private short[] myTempBuffer; #region Imports - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSoundStream_Create(GetDataCallbackType OnGetData, SeekCallbackType OnSeek, uint ChannelsCount, uint SampleRate, IntPtr UserData); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_Destroy(IntPtr SoundStreamStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_Play(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_Pause(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_Stop(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern SoundStatus sfSoundStream_GetStatus(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfSoundStream_GetChannelsCount(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfSoundStream_GetSampleRate(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetLoop(IntPtr SoundStream, bool Loop); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetPitch(IntPtr SoundStream, float Pitch); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetVolume(IntPtr SoundStream, float Volume); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetPosition(IntPtr SoundStream, float X, float Y, float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetRelativeToListener(IntPtr SoundStream, bool Relative); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetMinDistance(IntPtr SoundStream, float MinDistance); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetAttenuation(IntPtr SoundStream, float Attenuation); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_SetPlayingOffset(IntPtr SoundStream, float TimeOffset); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfSoundStream_GetLoop(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSoundStream_GetPitch(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSoundStream_GetVolume(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSoundStream_GetPosition(IntPtr SoundStream, out float X, out float Y, out float Z); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfSoundStream_IsRelativeToListener(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSoundStream_GetMinDistance(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSoundStream_GetAttenuation(IntPtr SoundStream); - [DllImport("csfml-audio"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-audio", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSoundStream_GetPlayingOffset(IntPtr SoundStream); #endregion } diff --git a/dotnet/src/Graphics/Context.cs b/dotnet/src/Graphics/Context.cs index 0a68fbdf2..c2d1f253d 100644 --- a/dotnet/src/Graphics/Context.cs +++ b/dotnet/src/Graphics/Context.cs @@ -77,13 +77,13 @@ namespace SFML private IntPtr myThis = IntPtr.Zero; #region Imports - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfContext_Create(); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfContext_Destroy(IntPtr View); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfContext_SetActive(IntPtr View, bool Active); #endregion } diff --git a/dotnet/src/Graphics/Font.cs b/dotnet/src/Graphics/Font.cs index 1a79d4ca5..60e58eb42 100644 --- a/dotnet/src/Graphics/Font.cs +++ b/dotnet/src/Graphics/Font.cs @@ -206,31 +206,31 @@ namespace SFML private static Font ourDefaultFont = null; #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfFont_CreateFromFile(string Filename); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern IntPtr sfFont_CreateFromMemory(char* Data, uint SizeInBytes); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfFont_Copy(IntPtr Font); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfFont_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Glyph sfFont_GetGlyph(IntPtr This, uint codePoint, uint characterSize, bool bold); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern int sfFont_GetKerning(IntPtr This, uint first, uint second, uint characterSize); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern int sfFont_GetLineSpacing(IntPtr This, uint characterSize); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfFont_GetImage(IntPtr This, uint characterSize); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfFont_GetDefaultFont(); #endregion } diff --git a/dotnet/src/Graphics/Image.cs b/dotnet/src/Graphics/Image.cs index 74bda10f1..b5d430195 100644 --- a/dotnet/src/Graphics/Image.cs +++ b/dotnet/src/Graphics/Image.cs @@ -383,64 +383,64 @@ namespace SFML } #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfImage_Create(); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfImage_CreateFromColor(uint Width, uint Height, Color Col); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern IntPtr sfImage_CreateFromPixels(uint Width, uint Height, Color* Pixels); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfImage_CreateFromFile(string Filename); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfImage_Copy(IntPtr Image); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern IntPtr sfImage_CreateFromMemory(char* Data, uint Size); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfImage_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfImage_SaveToFile(IntPtr This, string Filename); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfImage_CreateMaskFromColor(IntPtr This, Color Col, byte Alpha); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfImage_CopyScreen(IntPtr This, IntPtr Window, IntRect SourceRect); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfImage_Copy(IntPtr This, IntPtr Source, uint DestX, uint DestY, IntRect SourceRect); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfImage_SetPixel(IntPtr This, uint X, uint Y, Color Col); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfImage_GetPixel(IntPtr This, uint X, uint Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfImage_GetPixelsPtr(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern void sfImage_UpdatePixels(IntPtr This, Color* Pixels, IntRect Rectangle); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfImage_Bind(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfImage_SetSmooth(IntPtr This, bool Smooth); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfImage_GetWidth(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfImage_GetHeight(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfImage_IsSmooth(IntPtr This); #endregion } diff --git a/dotnet/src/Graphics/RenderImage.cs b/dotnet/src/Graphics/RenderImage.cs index 68953c54b..f8821315f 100644 --- a/dotnet/src/Graphics/RenderImage.cs +++ b/dotnet/src/Graphics/RenderImage.cs @@ -286,52 +286,52 @@ namespace SFML private Image myImage = null; #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderImage_Create(uint Width, uint Height, bool DepthBuffer); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_Clear(IntPtr This, Color ClearColor); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfRenderImage_GetWidth(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfRenderImage_GetHeight(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderImage_SetActive(IntPtr This, bool Active); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderImage_SaveGLStates(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderImage_RestoreGLStates(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderImage_Display(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_SetView(IntPtr This, IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderImage_GetView(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderImage_GetDefaultView(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntRect sfRenderImage_GetViewport(IntPtr This, IntPtr TargetView); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_ConvertCoords(IntPtr This, uint WindowX, uint WindowY, out float ViewX, out float ViewY, IntPtr TargetView); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderImage_GetImage(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderImage_IsAvailable(); #endregion diff --git a/dotnet/src/Graphics/RenderWindow.cs b/dotnet/src/Graphics/RenderWindow.cs index b40566044..91e95d0b4 100644 --- a/dotnet/src/Graphics/RenderWindow.cs +++ b/dotnet/src/Graphics/RenderWindow.cs @@ -496,100 +496,100 @@ namespace SFML private View myDefaultView = null; #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderWindow_Create(VideoMode Mode, string Title, Styles Style, ref ContextSettings Params); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderWindow_CreateFromHandle(IntPtr Handle, ref ContextSettings Params); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderWindow_GetInput(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderWindow_IsOpened(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_Close(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderWindow_GetEvent(IntPtr This, out Event Evt); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderWindow_WaitEvent(IntPtr This, out Event Evt); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_Clear(IntPtr This, Color ClearColor); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_Display(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfRenderWindow_GetWidth(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfRenderWindow_GetHeight(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern ContextSettings sfRenderWindow_GetSettings(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_UseVerticalSync(IntPtr This, bool Enable); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_ShowMouseCursor(IntPtr This, bool Show); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_SetCursorPosition(IntPtr This, uint X, uint Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_SetPosition(IntPtr This, int X, int Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_SetSize(IntPtr This, uint Width, uint Height); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_Show(IntPtr This, bool Show); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_EnableKeyRepeat(IntPtr This, bool Enable); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern void sfRenderWindow_SetIcon(IntPtr This, uint Width, uint Height, byte* Pixels); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderWindow_SetActive(IntPtr This, bool Active); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderWindow_SaveGLStates(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfRenderWindow_RestoreGLStates(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_SetFramerateLimit(IntPtr This, uint Limit); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfRenderWindow_GetFrameTime(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_SetJoystickThreshold(IntPtr This, float Threshold); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_SetView(IntPtr This, IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderWindow_GetView(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfRenderWindow_GetDefaultView(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntRect sfRenderWindow_GetViewport(IntPtr This, IntPtr TargetView); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_ConvertCoords(IntPtr This, uint WindowX, uint WindowY, out float ViewX, out float ViewY, IntPtr TargetView); #endregion diff --git a/dotnet/src/Graphics/Shader.cs b/dotnet/src/Graphics/Shader.cs index a96df5fef..6eea2aad3 100644 --- a/dotnet/src/Graphics/Shader.cs +++ b/dotnet/src/Graphics/Shader.cs @@ -220,43 +220,43 @@ namespace SFML Dictionary myTextures = new Dictionary(); #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShader_Create(); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShader_CreateFromFile(string Filename); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShader_CreateFromMemory(string Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShader_Copy(IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_Destroy(IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_SetParameter1(IntPtr Shader, string Name, float X); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_SetParameter2(IntPtr Shader, string Name, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_SetParameter3(IntPtr Shader, string Name, float X, float Y, float Z); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_SetParameter4(IntPtr Shader, string Name, float X, float Y, float Z, float W); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_SetTexture(IntPtr Shader, string Name, IntPtr Texture); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_Bind(IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShader_Unbind(IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfShader_IsAvailable(); #endregion diff --git a/dotnet/src/Graphics/Shape.cs b/dotnet/src/Graphics/Shape.cs index 346c00576..f7b132d0a 100644 --- a/dotnet/src/Graphics/Shape.cs +++ b/dotnet/src/Graphics/Shape.cs @@ -442,121 +442,121 @@ namespace SFML } #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShape_Create(); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShape_Copy(IntPtr Shape); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetPosition(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetRotation(IntPtr This, float Rotation); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetRotation(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetScale(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetScaleX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetScaleY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetOrigin(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetOriginX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetOriginY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetColor(IntPtr This, Color Color); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfShape_GetColor(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetBlendMode(IntPtr This, BlendMode Mode); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern BlendMode sfShape_GetBlendMode(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Vector2 sfShape_TransformToLocal(IntPtr This, float PointX, float PointY, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Vector2 sfShape_TransformToGlobal(IntPtr This, float PointX, float PointY, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_DrawShape(IntPtr This, IntPtr Shape); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_DrawShapeWithShader(IntPtr This, IntPtr Shape, IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_DrawShape(IntPtr This, IntPtr Shape); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_DrawShapeWithShader(IntPtr This, IntPtr Shape, IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShape_CreateLine(float P1X, float P1Y, float P2X, float P2Y, float Thickness, Color Col, float Outline, Color OutlineCol); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShape_CreateRectangle(float P1X, float P1Y, float P2X, float P2Y, Color Col, float Outline, Color OutlineCol); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfShape_CreateCircle(float X, float Y, float Radius, Color Col, float Outline, Color OutlineCol); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_AddPoint(IntPtr This, float X, float Y, Color Col, Color OutlineCol); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_EnableFill(IntPtr This, bool Enable); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_EnableOutline(IntPtr This, bool Enable); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetOutlineWidth(IntPtr This, float Width); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfShape_GetOutlineWidth(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfShape_GetPointsCount(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetPointPosition(IntPtr This, uint Index, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_GetPointPosition(IntPtr This, uint Index, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetPointColor(IntPtr This, uint Index, Color Col); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfShape_GetPointColor(IntPtr This, uint Index); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfShape_SetPointOutlineColor(IntPtr This, uint Index, Color Col); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfShape_GetPointOutlineColor(IntPtr This, uint Index); #endregion } diff --git a/dotnet/src/Graphics/Sprite.cs b/dotnet/src/Graphics/Sprite.cs index 11e48d5b7..da6ca45e5 100644 --- a/dotnet/src/Graphics/Sprite.cs +++ b/dotnet/src/Graphics/Sprite.cs @@ -292,103 +292,103 @@ namespace SFML private Image myImage = null; #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSprite_Create(); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfSprite_Copy(IntPtr Sprite); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetPosition(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetRotation(IntPtr This, float Rotation); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetRotation(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetScale(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetScaleX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetScaleY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetOrigin(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetOriginX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetOriginY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetColor(IntPtr This, Color Color); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfSprite_GetColor(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetBlendMode(IntPtr This, BlendMode Mode); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern BlendMode sfSprite_GetBlendMode(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Vector2 sfSprite_TransformToLocal(IntPtr This, float PointX, float PointY, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Vector2 sfSprite_TransformToGlobal(IntPtr This, float PointX, float PointY, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_DrawSprite(IntPtr This, IntPtr Sprite); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_DrawSpriteWithShader(IntPtr This, IntPtr Sprite, IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_DrawSprite(IntPtr This, IntPtr Sprite); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_DrawSpriteWithShader(IntPtr This, IntPtr Sprite, IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_Resize(IntPtr This, float Width, float Height); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetWidth(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfSprite_GetHeight(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetImage(IntPtr This, IntPtr Image, bool AdjustToNewSize); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_SetSubRect(IntPtr This, IntRect Rect); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntRect sfSprite_GetSubRect(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_FlipX(IntPtr This, bool Flipped); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfSprite_FlipY(IntPtr This, bool Flipped); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfSprite_GetPixel(IntPtr This, uint X, uint Y); #endregion } diff --git a/dotnet/src/Graphics/Text.cs b/dotnet/src/Graphics/Text.cs index 037e0a451..ea0e5488e 100644 --- a/dotnet/src/Graphics/Text.cs +++ b/dotnet/src/Graphics/Text.cs @@ -334,103 +334,103 @@ namespace SFML private Font myFont = Font.DefaultFont; #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfText_Create(); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfText_Copy(IntPtr Text); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_Destroy(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetPosition(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetRotation(IntPtr This, float Rotation); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetRotation(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetScale(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetScaleX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetScaleY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetOrigin(IntPtr This, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetOriginX(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfText_GetOriginY(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetColor(IntPtr This, Color Color); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Color sfText_GetColor(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetBlendMode(IntPtr This, BlendMode Mode); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern BlendMode sfText_GetBlendMode(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Vector2 sfText_TransformToLocal(IntPtr This, float PointX, float PointY, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Vector2 sfText_TransformToGlobal(IntPtr This, float PointX, float PointY, out float X, out float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_DrawText(IntPtr This, IntPtr String); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderWindow_DrawTextWithShader(IntPtr This, IntPtr String, IntPtr Shader); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_DrawText(IntPtr This, IntPtr String); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfRenderImage_DrawTextWithShader(IntPtr This, IntPtr String, IntPtr Shader); [DllImport("csfml-graphics", CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity] static extern void sfText_SetString(IntPtr This, string Text); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetFont(IntPtr This, IntPtr Font); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetCharacterSize(IntPtr This, uint Size); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_SetStyle(IntPtr This, Styles Style); [DllImport("csfml-graphics", CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity] static extern string sfText_GetString(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfText_GetCharacterSize(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern Styles sfText_GetStyle(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern FloatRect sfText_GetRect(IntPtr This); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfText_GetCharacterPos(IntPtr This, uint Index, out float X, out float Y); #endregion diff --git a/dotnet/src/Graphics/View.cs b/dotnet/src/Graphics/View.cs index 755ddfe8d..8fd8abba9 100644 --- a/dotnet/src/Graphics/View.cs +++ b/dotnet/src/Graphics/View.cs @@ -187,58 +187,58 @@ namespace SFML } #region Imports - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfView_Create(); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfView_CreateFromRect(FloatRect Rect); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfView_Copy(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_Destroy(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_SetCenter(IntPtr View, float X, float Y); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_SetSize(IntPtr View, float Width, float Height); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_SetRotation(IntPtr View, float Angle); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_SetViewport(IntPtr View, FloatRect Viewport); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_Reset(IntPtr View, FloatRect Rectangle); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfView_GetCenterX(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfView_GetCenterY(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfView_GetWidth(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfView_GetHeight(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfView_GetRotation(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern FloatRect sfView_GetViewport(IntPtr View); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_Move(IntPtr View, float OffsetX, float OffsetY); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_Rotate(IntPtr View, float Angle); - [DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-graphics", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfView_Zoom(IntPtr View, float Factor); #endregion diff --git a/dotnet/src/Window/Input.cs b/dotnet/src/Window/Input.cs index b312aac5a..74d31ceea 100644 --- a/dotnet/src/Window/Input.cs +++ b/dotnet/src/Window/Input.cs @@ -121,22 +121,22 @@ namespace SFML } #region Imports - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfInput_IsKeyDown(IntPtr This, KeyCode Key); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfInput_IsMouseButtonDown(IntPtr This, MouseButton Button); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfInput_IsJoystickButtonDown(IntPtr This, uint JoyId, uint Button); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern int sfInput_GetMouseX(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern int sfInput_GetMouseY(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfInput_GetJoystickAxis(IntPtr This, uint JoyId, JoyAxis Axis); #endregion } diff --git a/dotnet/src/Window/VideoMode.cs b/dotnet/src/Window/VideoMode.cs index 3524dc255..2636894bc 100644 --- a/dotnet/src/Window/VideoMode.cs +++ b/dotnet/src/Window/VideoMode.cs @@ -110,13 +110,13 @@ namespace SFML public uint BitsPerPixel; #region Imports - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern VideoMode sfVideoMode_GetDesktopMode(); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern VideoMode* sfVideoMode_GetFullscreenModes(out uint Count); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfVideoMode_IsValid(VideoMode Mode); #endregion } diff --git a/dotnet/src/Window/Window.cs b/dotnet/src/Window/Window.cs index f3b44919c..45fda1f1f 100644 --- a/dotnet/src/Window/Window.cs +++ b/dotnet/src/Window/Window.cs @@ -571,76 +571,76 @@ namespace SFML protected Input myInput = null; #region Imports - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfWindow_Create(VideoMode Mode, string Title, Styles Style, ref ContextSettings Params); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfWindow_CreateFromHandle(IntPtr Handle, ref ContextSettings Params); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_Destroy(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern IntPtr sfWindow_GetInput(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfWindow_IsOpened(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_Close(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfWindow_GetEvent(IntPtr This, out Event Evt); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfWindow_WaitEvent(IntPtr This, out Event Evt); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_Display(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfWindow_GetWidth(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern uint sfWindow_GetHeight(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern ContextSettings sfWindow_GetSettings(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_UseVerticalSync(IntPtr This, bool Enable); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_ShowMouseCursor(IntPtr This, bool Show); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_SetCursorPosition(IntPtr This, uint X, uint Y); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_SetPosition(IntPtr This, int X, int Y); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_SetSize(IntPtr This, uint Width, uint Height); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_Show(IntPtr This, bool Show); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_EnableKeyRepeat(IntPtr This, bool Enable); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] unsafe static extern void sfWindow_SetIcon(IntPtr This, uint Width, uint Height, byte* Pixels); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern bool sfWindow_SetActive(IntPtr This, bool Active); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_SetFramerateLimit(IntPtr This, uint Limit); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern float sfWindow_GetFrameTime(IntPtr This); - [DllImport("csfml-window"), SuppressUnmanagedCodeSecurity] + [DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] static extern void sfWindow_SetJoystickThreshold(IntPtr This, float Threshold); #endregion }