summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristoph Egger <Christoph.Egger@gmx.de>2008-11-01 17:37:58 +0100
committerChristoph Egger <Christoph.Egger@gmx.de>2008-11-01 17:37:58 +0100
commit9035708f4c5f7a78d8fb810e87e183fd61fd3350 (patch)
tree030e13b45c9882b799f793aa27007c74862fe934 /include
parenta96b4da2ed67a3e8dcc8e2a0d9af9463a23bb021 (diff)
Imported Upstream version 1.4~svn915
Diffstat (limited to 'include')
-rw-r--r--include/.svn/all-wcprops5
-rw-r--r--include/.svn/entries31
-rw-r--r--include/.svn/format1
-rw-r--r--include/SFML/.svn/all-wcprops41
-rw-r--r--include/SFML/.svn/entries247
-rw-r--r--include/SFML/.svn/format1
-rw-r--r--include/SFML/.svn/text-base/Audio.hpp.svn-base42
-rw-r--r--include/SFML/.svn/text-base/Config.hpp.svn-base160
-rw-r--r--include/SFML/.svn/text-base/Graphics.hpp.svn-base45
-rw-r--r--include/SFML/.svn/text-base/Network.hpp.svn-base42
-rw-r--r--include/SFML/.svn/text-base/System.hpp.svn-base43
-rw-r--r--include/SFML/.svn/text-base/Window.hpp.svn-base43
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio.hpp0
-rw-r--r--include/SFML/Audio/.svn/all-wcprops53
-rw-r--r--include/SFML/Audio/.svn/entries300
-rw-r--r--include/SFML/Audio/.svn/format1
-rw-r--r--include/SFML/Audio/.svn/text-base/AudioResource.hpp.svn-base67
-rw-r--r--include/SFML/Audio/.svn/text-base/Listener.hpp.svn-base122
-rw-r--r--include/SFML/Audio/.svn/text-base/Music.hpp.svn-base120
-rw-r--r--include/SFML/Audio/.svn/text-base/Sound.hpp.svn-base286
-rw-r--r--include/SFML/Audio/.svn/text-base/SoundBuffer.hpp.svn-base188
-rw-r--r--include/SFML/Audio/.svn/text-base/SoundBufferRecorder.hpp.svn-base71
-rw-r--r--include/SFML/Audio/.svn/text-base/SoundRecorder.hpp.svn-base148
-rw-r--r--include/SFML/Audio/.svn/text-base/SoundStream.hpp.svn-base225
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/AudioResource.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/Listener.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/Music.hpp18
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/Sound.hpp19
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/SoundBuffer.hpp4
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/SoundBufferRecorder.hpp2
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/SoundRecorder.hpp2
-rw-r--r--[-rwxr-xr-x]include/SFML/Audio/SoundStream.hpp52
-rw-r--r--[-rwxr-xr-x]include/SFML/Config.hpp63
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics.hpp1
-rw-r--r--include/SFML/Graphics/.svn/all-wcprops101
-rw-r--r--include/SFML/Graphics/.svn/entries572
-rw-r--r--include/SFML/Graphics/.svn/format1
-rw-r--r--include/SFML/Graphics/.svn/text-base/Color.hpp.svn-base147
-rw-r--r--include/SFML/Graphics/.svn/text-base/Drawable.hpp.svn-base361
-rw-r--r--include/SFML/Graphics/.svn/text-base/Font.hpp.svn-base145
-rw-r--r--include/SFML/Graphics/.svn/text-base/Glyph.hpp.svn-base61
-rw-r--r--include/SFML/Graphics/.svn/text-base/Image.hpp.svn-base335
-rw-r--r--include/SFML/Graphics/.svn/text-base/Matrix3.hpp.svn-base148
-rw-r--r--include/SFML/Graphics/.svn/text-base/Matrix3.inl.svn-base186
-rw-r--r--include/SFML/Graphics/.svn/text-base/PostFX.hpp.svn-base194
-rw-r--r--include/SFML/Graphics/.svn/text-base/Rect.hpp.svn-base127
-rw-r--r--include/SFML/Graphics/.svn/text-base/Rect.inl.svn-base122
-rw-r--r--include/SFML/Graphics/.svn/text-base/RenderTarget.hpp.svn-base166
-rw-r--r--include/SFML/Graphics/.svn/text-base/RenderWindow.hpp.svn-base135
-rw-r--r--include/SFML/Graphics/.svn/text-base/Shape.hpp.svn-base310
-rw-r--r--include/SFML/Graphics/.svn/text-base/Sprite.hpp.svn-base176
-rw-r--r--include/SFML/Graphics/.svn/text-base/String.hpp.svn-base191
-rw-r--r--include/SFML/Graphics/.svn/text-base/View.hpp.svn-base188
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Color.hpp3
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Drawable.hpp60
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Font.hpp58
-rw-r--r--include/SFML/Graphics/Glyph.hpp61
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Image.hpp74
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Matrix3.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Matrix3.inl70
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/PostFX.hpp20
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Rect.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Rect.inl0
-rw-r--r--include/SFML/Graphics/RenderTarget.hpp166
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/RenderWindow.hpp81
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Shape.hpp118
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/Sprite.hpp12
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/String.hpp68
-rw-r--r--[-rwxr-xr-x]include/SFML/Graphics/View.hpp4
-rw-r--r--[-rwxr-xr-x]include/SFML/Network.hpp2
-rw-r--r--include/SFML/Network/.svn/all-wcprops71
-rw-r--r--include/SFML/Network/.svn/entries408
-rw-r--r--include/SFML/Network/.svn/format1
-rw-r--r--include/SFML/Network/.svn/text-base/Ftp.hpp.svn-base448
-rw-r--r--include/SFML/Network/.svn/text-base/Http.hpp.svn-base339
-rw-r--r--include/SFML/Network/.svn/text-base/IPAddress.hpp.svn-base229
-rw-r--r--include/SFML/Network/.svn/text-base/Packet.hpp.svn-base187
-rw-r--r--include/SFML/Network/.svn/text-base/Selector.hpp.svn-base116
-rw-r--r--include/SFML/Network/.svn/text-base/Selector.inl.svn-base97
-rw-r--r--include/SFML/Network/.svn/text-base/SelectorBase.hpp.svn-base112
-rw-r--r--include/SFML/Network/.svn/text-base/SocketHelper.hpp.svn-base64
-rw-r--r--include/SFML/Network/.svn/text-base/SocketTCP.hpp.svn-base225
-rw-r--r--include/SFML/Network/.svn/text-base/SocketUDP.hpp.svn-base224
-rw-r--r--include/SFML/Network/.svn/text-base/Sockets.hpp.svn-base45
-rw-r--r--include/SFML/Network/Ftp.hpp448
-rw-r--r--include/SFML/Network/Http.hpp339
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/IPAddress.hpp16
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/Packet.hpp27
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/Selector.hpp2
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/Selector.inl2
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/SelectorBase.hpp2
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/SocketHelper.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/SocketTCP.hpp14
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/SocketUDP.hpp11
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/Sockets.hpp0
-rw-r--r--include/SFML/Network/Unix/.svn/all-wcprops11
-rw-r--r--include/SFML/Network/Unix/.svn/entries62
-rw-r--r--include/SFML/Network/Unix/.svn/format1
-rw-r--r--include/SFML/Network/Unix/.svn/text-base/SocketHelper.hpp.svn-base96
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/Unix/SocketHelper.hpp191
-rw-r--r--include/SFML/Network/Win32/.svn/all-wcprops11
-rw-r--r--include/SFML/Network/Win32/.svn/entries62
-rw-r--r--include/SFML/Network/Win32/.svn/format1
-rw-r--r--include/SFML/Network/Win32/.svn/text-base/SocketHelper.hpp.svn-base90
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/Win32/SocketHelper.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System.hpp1
-rw-r--r--include/SFML/System/.svn/all-wcprops101
-rw-r--r--include/SFML/System/.svn/entries578
-rw-r--r--include/SFML/System/.svn/format1
-rw-r--r--[-rwxr-xr-x]include/SFML/System/.svn/text-base/Clock.hpp.svn-base (renamed from include/SFML/Graphics/VideoResource.hpp)35
-rw-r--r--include/SFML/System/.svn/text-base/Lock.hpp.svn-base71
-rw-r--r--include/SFML/System/.svn/text-base/Mutex.hpp.svn-base45
-rw-r--r--include/SFML/System/.svn/text-base/NonCopyable.hpp.svn-base70
-rw-r--r--include/SFML/System/.svn/text-base/Randomizer.hpp.svn-base94
-rw-r--r--include/SFML/System/.svn/text-base/Resource.hpp.svn-base216
-rw-r--r--include/SFML/System/.svn/text-base/Resource.inl.svn-base88
-rw-r--r--include/SFML/System/.svn/text-base/ResourcePtr.inl.svn-base149
-rw-r--r--include/SFML/System/.svn/text-base/Sleep.hpp.svn-base47
-rw-r--r--include/SFML/System/.svn/text-base/Thread.hpp.svn-base45
-rw-r--r--include/SFML/System/.svn/text-base/Unicode.hpp.svn-base290
-rw-r--r--include/SFML/System/.svn/text-base/Unicode.inl.svn-base474
-rw-r--r--include/SFML/System/.svn/text-base/Vector2.hpp.svn-base215
-rw-r--r--include/SFML/System/.svn/text-base/Vector2.inl.svn-base179
-rw-r--r--include/SFML/System/.svn/text-base/Vector3.hpp.svn-base217
-rw-r--r--include/SFML/System/.svn/text-base/Vector3.inl.svn-base185
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Clock.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Lock.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Mutex.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/NonCopyable.hpp1
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Randomizer.hpp0
-rw-r--r--include/SFML/System/Resource.hpp216
-rw-r--r--include/SFML/System/Resource.inl88
-rw-r--r--include/SFML/System/ResourcePtr.inl149
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Sleep.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Thread.hpp0
-rw-r--r--include/SFML/System/Unicode.hpp290
-rw-r--r--include/SFML/System/Unicode.inl474
-rw-r--r--include/SFML/System/Unix/.svn/all-wcprops17
-rw-r--r--include/SFML/System/Unix/.svn/entries96
-rw-r--r--include/SFML/System/Unix/.svn/format1
-rw-r--r--include/SFML/System/Unix/.svn/text-base/Mutex.hpp.svn-base82
-rw-r--r--include/SFML/System/Unix/.svn/text-base/Thread.hpp.svn-base124
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Unix/Mutex.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Unix/Thread.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Vector2.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Vector2.inl0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Vector3.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Vector3.inl0
-rw-r--r--include/SFML/System/Win32/.svn/all-wcprops17
-rw-r--r--include/SFML/System/Win32/.svn/entries96
-rw-r--r--include/SFML/System/Win32/.svn/format1
-rw-r--r--include/SFML/System/Win32/.svn/text-base/Mutex.hpp.svn-base84
-rw-r--r--include/SFML/System/Win32/.svn/text-base/Thread.hpp.svn-base123
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Win32/Mutex.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/System/Win32/Thread.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Window.hpp1
-rw-r--r--include/SFML/Window/.svn/all-wcprops65
-rw-r--r--include/SFML/Window/.svn/entries368
-rw-r--r--include/SFML/Window/.svn/format1
-rw-r--r--include/SFML/Window/.svn/text-base/Context.hpp.svn-base100
-rw-r--r--include/SFML/Window/.svn/text-base/Event.hpp.svn-base313
-rw-r--r--include/SFML/Window/.svn/text-base/Input.hpp.svn-base134
-rw-r--r--include/SFML/Window/.svn/text-base/OpenGL.hpp.svn-base46
-rw-r--r--include/SFML/Window/.svn/text-base/VideoMode.hpp.svn-base136
-rw-r--r--include/SFML/Window/.svn/text-base/Window.hpp.svn-base326
-rw-r--r--include/SFML/Window/.svn/text-base/WindowHandle.hpp.svn-base60
-rw-r--r--include/SFML/Window/.svn/text-base/WindowListener.hpp.svn-base66
-rw-r--r--include/SFML/Window/.svn/text-base/WindowSettings.hpp.svn-base62
-rw-r--r--include/SFML/Window/.svn/text-base/WindowStyle.hpp.svn-base51
-rw-r--r--include/SFML/Window/Context.hpp100
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/Event.hpp10
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/Input.hpp18
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/OpenGL.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/VideoMode.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/Window.hpp37
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/WindowHandle.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/WindowListener.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/WindowSettings.hpp0
-rw-r--r--[-rwxr-xr-x]include/SFML/Window/WindowStyle.hpp0
179 files changed, 17255 insertions, 457 deletions
diff --git a/include/.svn/all-wcprops b/include/.svn/all-wcprops
new file mode 100644
index 0000000..7d2ab0e
--- /dev/null
+++ b/include/.svn/all-wcprops
@@ -0,0 +1,5 @@
+K 25
+svn:wc:ra_dav:version-url
+V 34
+/svnroot/sfml/!svn/ver/912/include
+END
diff --git a/include/.svn/entries b/include/.svn/entries
new file mode 100644
index 0000000..b9f0d6c
--- /dev/null
+++ b/include/.svn/entries
@@ -0,0 +1,31 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-10-21T18:42:24.730017Z
+912
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+SFML
+dir
+
diff --git a/include/.svn/format b/include/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/.svn/all-wcprops b/include/SFML/.svn/all-wcprops
new file mode 100644
index 0000000..723c140
--- /dev/null
+++ b/include/SFML/.svn/all-wcprops
@@ -0,0 +1,41 @@
+K 25
+svn:wc:ra_dav:version-url
+V 39
+/svnroot/sfml/!svn/ver/912/include/SFML
+END
+Network.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 51
+/svnroot/sfml/!svn/ver/905/include/SFML/Network.hpp
+END
+Graphics.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svnroot/sfml/!svn/ver/798/include/SFML/Graphics.hpp
+END
+Audio.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svnroot/sfml/!svn/ver/383/include/SFML/Audio.hpp
+END
+System.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svnroot/sfml/!svn/ver/778/include/SFML/System.hpp
+END
+Config.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svnroot/sfml/!svn/ver/801/include/SFML/Config.hpp
+END
+Window.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svnroot/sfml/!svn/ver/855/include/SFML/Window.hpp
+END
diff --git a/include/SFML/.svn/entries b/include/SFML/.svn/entries
new file mode 100644
index 0000000..a8b94d1
--- /dev/null
+++ b/include/SFML/.svn/entries
@@ -0,0 +1,247 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-10-21T18:42:24.730017Z
+912
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+Network.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+f2bb42bd3d1f17e0a5b62a1f2661d38b
+2008-10-11T19:31:03.152262Z
+905
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1636
+
+Graphics
+dir
+
+Audio
+dir
+
+System
+dir
+
+Graphics.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+28fa278b5786163360e1beb7b126560d
+2008-08-04T17:27:29.138748Z
+798
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1749
+
+Window
+dir
+
+Audio.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+863f7a0f7025b2125949854f0951f213
+2007-12-26T07:14:50.320767Z
+383
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1640
+
+Network
+dir
+
+System.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+0c7c290af6e1696539b8a7963aace69b
+2008-07-26T15:04:43.683405Z
+778
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1690
+
+Config.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+93016e31c3c7096df5644f4e77be3947
+2008-08-08T05:50:13.228335Z
+801
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4607
+
+Window.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+682d5ee95f6a310d0b57911bc4bcdd6f
+2008-09-03T12:26:42.301059Z
+855
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1685
+
diff --git a/include/SFML/.svn/format b/include/SFML/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/.svn/text-base/Audio.hpp.svn-base b/include/SFML/.svn/text-base/Audio.hpp.svn-base
new file mode 100644
index 0000000..574d4d2
--- /dev/null
+++ b/include/SFML/.svn/text-base/Audio.hpp.svn-base
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_AUDIO_HPP
+#define SFML_AUDIO_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+
+#include <SFML/System.hpp>
+#include <SFML/Audio/Listener.hpp>
+#include <SFML/Audio/Music.hpp>
+#include <SFML/Audio/Sound.hpp>
+#include <SFML/Audio/SoundBuffer.hpp>
+#include <SFML/Audio/SoundBufferRecorder.hpp>
+#include <SFML/Audio/SoundRecorder.hpp>
+#include <SFML/Audio/SoundStream.hpp>
+
+
+#endif // SFML_AUDIO_HPP
diff --git a/include/SFML/.svn/text-base/Config.hpp.svn-base b/include/SFML/.svn/text-base/Config.hpp.svn-base
new file mode 100644
index 0000000..86800e4
--- /dev/null
+++ b/include/SFML/.svn/text-base/Config.hpp.svn-base
@@ -0,0 +1,160 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_CONFIG_HPP
+#define SFML_CONFIG_HPP
+
+////////////////////////////////////////////////////////////
+// Identify the operating system
+////////////////////////////////////////////////////////////
+#if defined(_WIN32) || defined(__WIN32__)
+
+ // Windows
+ #define SFML_SYSTEM_WINDOWS
+ #ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+ #endif
+ #ifndef NOMINMAX
+ #define NOMINMAX
+ #endif
+
+#elif defined(linux) || defined(__linux)
+
+ // Linux
+ #define SFML_SYSTEM_LINUX
+
+#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
+
+ // MacOS
+ #define SFML_SYSTEM_MACOS
+
+#else
+
+ // Unsupported system
+ #error This operating system is not supported by SFML library
+
+#endif
+
+
+////////////////////////////////////////////////////////////
+// Define a portable debug macro
+////////////////////////////////////////////////////////////
+#if !defined(NDEBUG)
+
+ #define SFML_DEBUG
+
+#endif
+
+
+////////////////////////////////////////////////////////////
+// Define portable import / export macros
+////////////////////////////////////////////////////////////
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ #ifdef SFML_DYNAMIC
+
+ // Windows platforms
+ #ifdef SFML_EXPORTS
+
+ // From DLL side, we must export
+ #define SFML_API __declspec(dllexport)
+
+ #else
+
+ // From client application side, we must import
+ #define SFML_API __declspec(dllimport)
+
+ #endif
+
+ // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
+ // You can read lots ot different things about it, but the point is the code will
+ // just work fine, and so the simplest way to get rid of this warning is to disable it
+ #ifdef _MSC_VER
+
+ #pragma warning(disable : 4251)
+
+ #endif
+
+ #else
+
+ // No specific directive needed for static build
+ #define SFML_API
+
+ #endif
+
+#else
+
+ // Other platforms don't need to define anything
+ #define SFML_API
+
+#endif
+
+
+////////////////////////////////////////////////////////////
+// Define portable fixed-size types
+////////////////////////////////////////////////////////////
+#include <climits>
+
+namespace sf
+{
+ // 8 bits integer types
+ #if UCHAR_MAX == 0xFF
+ typedef signed char Int8;
+ typedef unsigned char Uint8;
+ #else
+ #error No 8 bits integer type for this platform
+ #endif
+
+ // 16 bits integer types
+ #if USHRT_MAX == 0xFFFF
+ typedef signed short Int16;
+ typedef unsigned short Uint16;
+ #elif UINT_MAX == 0xFFFF
+ typedef signed int Int16;
+ typedef unsigned int Uint16;
+ #elif ULONG_MAX == 0xFFFF
+ typedef signed long Int16;
+ typedef unsigned long Uint16;
+ #else
+ #error No 16 bits integer type for this platform
+ #endif
+
+ // 32 bits integer types
+ #if USHRT_MAX == 0xFFFFFFFF
+ typedef signed short Int32;
+ typedef unsigned short Uint32;
+ #elif UINT_MAX == 0xFFFFFFFF
+ typedef signed int Int32;
+ typedef unsigned int Uint32;
+ #elif ULONG_MAX == 0xFFFFFFFF
+ typedef signed long Int32;
+ typedef unsigned long Uint32;
+ #else
+ #error No 32 bits integer type for this platform
+ #endif
+
+} // namespace sf
+
+
+#endif // SFML_CONFIG_HPP
diff --git a/include/SFML/.svn/text-base/Graphics.hpp.svn-base b/include/SFML/.svn/text-base/Graphics.hpp.svn-base
new file mode 100644
index 0000000..c6282c5
--- /dev/null
+++ b/include/SFML/.svn/text-base/Graphics.hpp.svn-base
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GRAPHICS_HPP
+#define SFML_GRAPHICS_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+
+#include <SFML/Window.hpp>
+#include <SFML/Graphics/Color.hpp>
+#include <SFML/Graphics/Font.hpp>
+#include <SFML/Graphics/Glyph.hpp>
+#include <SFML/Graphics/Image.hpp>
+#include <SFML/Graphics/PostFX.hpp>
+#include <SFML/Graphics/RenderWindow.hpp>
+#include <SFML/Graphics/Shape.hpp>
+#include <SFML/Graphics/Sprite.hpp>
+#include <SFML/Graphics/String.hpp>
+#include <SFML/Graphics/View.hpp>
+
+
+#endif // SFML_GRAPHICS_HPP
diff --git a/include/SFML/.svn/text-base/Network.hpp.svn-base b/include/SFML/.svn/text-base/Network.hpp.svn-base
new file mode 100644
index 0000000..fe1730a
--- /dev/null
+++ b/include/SFML/.svn/text-base/Network.hpp.svn-base
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_NETWORK_HPP
+#define SFML_NETWORK_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+
+#include <SFML/System.hpp>
+#include <SFML/Network/Ftp.hpp>
+#include <SFML/Network/Http.hpp>
+#include <SFML/Network/IPAddress.hpp>
+#include <SFML/Network/Packet.hpp>
+#include <SFML/Network/Selector.hpp>
+#include <SFML/Network/SocketTCP.hpp>
+#include <SFML/Network/SocketUDP.hpp>
+
+
+#endif // SFML_NETWORK_HPP
diff --git a/include/SFML/.svn/text-base/System.hpp.svn-base b/include/SFML/.svn/text-base/System.hpp.svn-base
new file mode 100644
index 0000000..6350210
--- /dev/null
+++ b/include/SFML/.svn/text-base/System.hpp.svn-base
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SYSTEM_HPP
+#define SFML_SYSTEM_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+
+#include <SFML/Config.hpp>
+#include <SFML/System/Clock.hpp>
+#include <SFML/System/Lock.hpp>
+#include <SFML/System/Mutex.hpp>
+#include <SFML/System/Randomizer.hpp>
+#include <SFML/System/Sleep.hpp>
+#include <SFML/System/Thread.hpp>
+#include <SFML/System/Unicode.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <SFML/System/Vector3.hpp>
+
+#endif // SFML_SYSTEM_HPP
diff --git a/include/SFML/.svn/text-base/Window.hpp.svn-base b/include/SFML/.svn/text-base/Window.hpp.svn-base
new file mode 100644
index 0000000..a73ff1b
--- /dev/null
+++ b/include/SFML/.svn/text-base/Window.hpp.svn-base
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SFML_WINDOW_HPP
+#define SFML_SFML_WINDOW_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+
+#include <SFML/System.hpp>
+#include <SFML/Window/Context.hpp>
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/Input.hpp>
+#include <SFML/Window/VideoMode.hpp>
+#include <SFML/Window/Window.hpp>
+#include <SFML/Window/WindowListener.hpp>
+#include <SFML/Window/WindowStyle.hpp>
+#include <SFML/Window/OpenGL.hpp>
+
+
+#endif // SFML_SFML_WINDOW_HPP
diff --git a/include/SFML/Audio.hpp b/include/SFML/Audio.hpp
index 574d4d2..574d4d2 100755..100644
--- a/include/SFML/Audio.hpp
+++ b/include/SFML/Audio.hpp
diff --git a/include/SFML/Audio/.svn/all-wcprops b/include/SFML/Audio/.svn/all-wcprops
new file mode 100644
index 0000000..bf1f890
--- /dev/null
+++ b/include/SFML/Audio/.svn/all-wcprops
@@ -0,0 +1,53 @@
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/svnroot/sfml/!svn/ver/885/include/SFML/Audio
+END
+AudioResource.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svnroot/sfml/!svn/ver/434/include/SFML/Audio/AudioResource.hpp
+END
+SoundRecorder.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svnroot/sfml/!svn/ver/707/include/SFML/Audio/SoundRecorder.hpp
+END
+Music.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svnroot/sfml/!svn/ver/872/include/SFML/Audio/Music.hpp
+END
+SoundBuffer.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/804/include/SFML/Audio/SoundBuffer.hpp
+END
+SoundStream.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/885/include/SFML/Audio/SoundStream.hpp
+END
+Listener.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/503/include/SFML/Audio/Listener.hpp
+END
+Sound.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svnroot/sfml/!svn/ver/830/include/SFML/Audio/Sound.hpp
+END
+SoundBufferRecorder.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 69
+/svnroot/sfml/!svn/ver/707/include/SFML/Audio/SoundBufferRecorder.hpp
+END
diff --git a/include/SFML/Audio/.svn/entries b/include/SFML/Audio/.svn/entries
new file mode 100644
index 0000000..84dfb64
--- /dev/null
+++ b/include/SFML/Audio/.svn/entries
@@ -0,0 +1,300 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/Audio
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-09-24T18:46:09.132169Z
+885
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+AudioResource.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+74bd090faac0b624472c6d1033b6b1d3
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2385
+
+SoundRecorder.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+01563e97cc6d40e76d9d62c2af90ef27
+2008-06-17T15:16:46.665668Z
+707
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5627
+
+Music.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+04510903de3d2f9b457233857c4354d5
+2008-09-14T09:14:33.345912Z
+872
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4323
+
+SoundBuffer.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+7ea21ab73a8e6b87ee36e57332b210c3
+2008-08-09T14:50:25.623007Z
+804
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6984
+
+SoundStream.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+a8476b0883d9034764e913df522e299a
+2008-09-24T18:46:09.132169Z
+885
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8388
+
+Listener.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+5e3f6a5afcd43e5818674a1c552b8fb9
+2008-03-16T13:28:08.545602Z
+503
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4720
+
+Sound.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+306a022a69a0b89d46e020ee92139e4e
+2008-08-27T06:33:31.826636Z
+830
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10234
+
+SoundBufferRecorder.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+5156c84257af647a3511dfca6733db0e
+2008-06-17T15:16:46.665668Z
+707
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2743
+
diff --git a/include/SFML/Audio/.svn/format b/include/SFML/Audio/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/Audio/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Audio/.svn/text-base/AudioResource.hpp.svn-base b/include/SFML/Audio/.svn/text-base/AudioResource.hpp.svn-base
new file mode 100644
index 0000000..c0dbdb2
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/AudioResource.hpp.svn-base
@@ -0,0 +1,67 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_AUDIORESOURCE_HPP
+#define SFML_AUDIORESOURCE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Abstract base class for every class that owns a
+/// device-dependant resource -- allow them to initialize / shutdown
+/// even when the audio context is not created
+////////////////////////////////////////////////////////////
+class SFML_API AudioResource
+{
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ AudioResource();
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ AudioResource(const AudioResource&);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~AudioResource();
+};
+
+} // namespace sf
+
+
+#endif // SFML_AUDIORESOURCE_HPP
diff --git a/include/SFML/Audio/.svn/text-base/Listener.hpp.svn-base b/include/SFML/Audio/.svn/text-base/Listener.hpp.svn-base
new file mode 100644
index 0000000..c6679b3
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/Listener.hpp.svn-base
@@ -0,0 +1,122 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_LISTENER_HPP
+#define SFML_LISTENER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/Vector3.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Listener is a global interface for defining the audio
+/// listener properties ; the audio listener is the point in
+/// the scene from where all the sounds are heard
+////////////////////////////////////////////////////////////
+class SFML_API Listener
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Change the global volume of all the sounds.
+ /// The default volume is 100
+ ///
+ /// \param Volume : New global volume, in the range [0, 100]
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetGlobalVolume(float Volume);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current value of the global volume of all the sounds
+ ///
+ /// \return Current global volume, in the range [0, 100]
+ ///
+ ////////////////////////////////////////////////////////////
+ static float GetGlobalVolume();
+
+ ////////////////////////////////////////////////////////////
+ /// Change the position of the listener (take 3 values).
+ /// The default position is (0, 0, 0)
+ ///
+ /// \param X, Y, Z : Position of the listener in the world
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetPosition(float X, float Y, float Z);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the position of the listener (take a 3D vector).
+ /// The default position is (0, 0, 0)
+ ///
+ /// \param Position : Position of the listener in the world
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetPosition(const Vector3f& Position);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current position of the listener
+ ///
+ /// \return Position of the listener in the world
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector3f GetPosition();
+
+ ////////////////////////////////////////////////////////////
+ /// Change the orientation of the listener (the point
+ /// he must look at) (take 3 values).
+ /// The default target is (0, 0, -1)
+ ///
+ /// \param X, Y, Z : Position of the point the listener must look at
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetTarget(float X, float Y, float Z);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the orientation of the listener (the point
+ /// he must look at) (take a 3D vector).
+ /// The default target is (0, 0, -1)
+ ///
+ /// \param Target : Position of the point the listener must look at
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetTarget(const Vector3f& Target);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current orientation of the listener (the point
+ /// he's looking at)
+ ///
+ /// \return : Position of the point the listener is looking at
+ ///
+ ////////////////////////////////////////////////////////////
+ static Vector3f GetTarget();
+};
+
+} // namespace sf
+
+
+#endif // SFML_LISTENER_HPP
diff --git a/include/SFML/Audio/.svn/text-base/Music.hpp.svn-base b/include/SFML/Audio/.svn/text-base/Music.hpp.svn-base
new file mode 100644
index 0000000..2820c2a
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/Music.hpp.svn-base
@@ -0,0 +1,120 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MUSIC_HPP
+#define SFML_MUSIC_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundStream.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+namespace priv
+{
+ class SoundFile;
+}
+
+////////////////////////////////////////////////////////////
+/// Music defines a big sound played using streaming,
+/// so usually what we call a music :)
+////////////////////////////////////////////////////////////
+class SFML_API Music : public SoundStream
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the music with a buffer size
+ ///
+ /// \param BufferSize : Size of the internal buffer, expressed in number of samples
+ /// (ie. size taken by the music in memory) (44100 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Music(std::size_t BufferSize = 44100);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Music();
+
+ ////////////////////////////////////////////////////////////
+ /// Open a music file (doesn't play it -- call Play() for that)
+ ///
+ /// \param Filename : Path of the music file to open
+ ///
+ /// \return True if loading has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool OpenFromFile(const std::string& Filename);
+
+ ////////////////////////////////////////////////////////////
+ /// Open a music file from memory (doesn't play it -- call Play() for that)
+ ///
+ /// \param Data : Pointer to the file data in memory
+ /// \param SizeInBytes : Size of the data to load, in bytes
+ ///
+ /// \return True if loading has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool OpenFromMemory(const char* Data, std::size_t SizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the music duration
+ ///
+ /// \return Music duration, in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetDuration() const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// /see SoundStream::OnStart
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool OnStart();
+
+ ////////////////////////////////////////////////////////////
+ /// /see SoundStream::OnGetData
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool OnGetData(Chunk& Data);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ priv::SoundFile* myFile; ///< Sound file
+ float myDuration; ///< Music duration, in seconds
+ std::vector<Int16> mySamples; ///< Temporary buffer of samples
+};
+
+} // namespace sf
+
+
+#endif // SFML_MUSIC_HPP
diff --git a/include/SFML/Audio/.svn/text-base/Sound.hpp.svn-base b/include/SFML/Audio/.svn/text-base/Sound.hpp.svn-base
new file mode 100644
index 0000000..cced19e
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/Sound.hpp.svn-base
@@ -0,0 +1,286 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOUND_HPP
+#define SFML_SOUND_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/System/Vector3.hpp>
+#include <SFML/Audio/AudioResource.hpp>
+#include <cstdlib>
+
+
+namespace sf
+{
+class SoundBuffer;
+
+////////////////////////////////////////////////////////////
+/// Sound defines the properties of a sound such as position,
+/// volume, pitch, etc.
+////////////////////////////////////////////////////////////
+class SFML_API Sound : public AudioResource
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumeration of the sound states
+ ////////////////////////////////////////////////////////////
+ enum Status
+ {
+ Stopped, ///< Sound is not playing
+ Paused, ///< Sound is paused
+ Playing ///< Sound is playing
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Sound();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the sound from its parameters
+ ///
+ /// \param Buffer : Sound buffer to play (NULL by default)
+ /// \param Loop : Loop flag (false by default)
+ /// \param Pitch : Value of the pitch (1 by default)
+ /// \param Volume : Volume (100 by default)
+ /// \param Position : Position (0, 0, 0 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Sound(const SoundBuffer& Buffer, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, const Vector3f& Position = Vector3f(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Instance to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ Sound(const Sound& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Sound();
+
+ ////////////////////////////////////////////////////////////
+ /// Play the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ void Play();
+
+ ////////////////////////////////////////////////////////////
+ /// Pause the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ void Pause();
+
+ ////////////////////////////////////////////////////////////
+ /// Stop the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ void Stop();
+
+ ////////////////////////////////////////////////////////////
+ /// Set the source buffer
+ ///
+ /// \param Buffer : New sound buffer to bind to the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetBuffer(const SoundBuffer& Buffer);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the sound loop state.
+ /// This parameter is disabled by default
+ ///
+ /// \param Loop : True to play in loop, false to play once
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetLoop(bool Loop);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the sound pitch.
+ /// The default pitch is 1
+ ///
+ /// \param Pitch : New pitch
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPitch(float Pitch);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the sound volume.
+ /// The default volume is 100
+ ///
+ /// \param Volume : Volume (in range [0, 100])
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetVolume(float Volume);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the sound position (take 3 values).
+ /// The default position is (0, 0, 0)
+ ///
+ /// \param X, Y, Z : Position of the sound in the world
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPosition(float X, float Y, float Z);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the sound position (take a 3D vector).
+ /// The default position is (0, 0, 0)
+ ///
+ /// \param Position : Position of the sound in the world
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPosition(const Vector3f& Position);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the minimum distance - closer than this distance,
+ /// the listener will hear the sound at its maximum volume.
+ /// The default minimum distance is 1.0
+ ///
+ /// \param MinDistance : New minimum distance for the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetMinDistance(float MinDistance);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the attenuation factor - the higher the attenuation, the
+ /// more the sound will be attenuated with distance from listener.
+ /// The default attenuation factor 1.0
+ ///
+ /// \param Attenuation : New attenuation factor for the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetAttenuation(float Attenuation);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the current playing position of the sound
+ ///
+ /// \param TimeOffset : New playing position, expressed in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPlayingOffset(float TimeOffset);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the source buffer
+ ///
+ /// \return Sound buffer bound to the sound (can be NULL)
+ ///
+ ////////////////////////////////////////////////////////////
+ const SoundBuffer* GetBuffer() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Tell whether or not the sound is looping
+ ///
+ /// \return True if the sound is looping, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool GetLoop() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the pitch
+ ///
+ /// \return Pitch value
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetPitch() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the volume
+ ///
+ /// \return Volume value (in range [1, 100])
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetVolume() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sound position
+ ///
+ /// \return Position of the sound in the world
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3f GetPosition() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the minimum distance
+ ///
+ /// \return Minimum distance for the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetMinDistance() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the attenuation factor
+ ///
+ /// \return Attenuation factor of the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetAttenuation() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the status of the sound (stopped, paused, playing)
+ ///
+ /// \return Current status of the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ Status GetStatus() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current playing position of the sound
+ ///
+ /// \return Current playing position, expressed in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetPlayingOffset() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator
+ ///
+ /// \param Other : Instance to assign
+ ///
+ /// \return Reference to the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ Sound& operator =(const Sound& Other);
+
+private :
+
+ friend class SoundStream;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int mySource; ///< OpenAL source identifier
+ ResourcePtr<SoundBuffer> myBuffer; ///< Sound buffer bound to the source
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOUND_HPP
diff --git a/include/SFML/Audio/.svn/text-base/SoundBuffer.hpp.svn-base b/include/SFML/Audio/.svn/text-base/SoundBuffer.hpp.svn-base
new file mode 100644
index 0000000..f9194b2
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/SoundBuffer.hpp.svn-base
@@ -0,0 +1,188 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOUNDBUFFER_HPP
+#define SFML_SOUNDBUFFER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/Audio/AudioResource.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// SoundBuffer is the low-level for loading and manipulating
+/// sound buffers
+////////////////////////////////////////////////////////////
+class SFML_API SoundBuffer : public AudioResource, public Resource<SoundBuffer>
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundBuffer();
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Instance to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundBuffer(const SoundBuffer& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~SoundBuffer();
+
+ ////////////////////////////////////////////////////////////
+ /// Load the sound buffer from a file
+ ///
+ /// \param Filename : Path of the sound file to load
+ ///
+ /// \return True if loading has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromFile(const std::string& Filename);
+
+ ////////////////////////////////////////////////////////////
+ /// Load the sound buffer from a file in memory
+ ///
+ /// \param Data : Pointer to the file data in memory
+ /// \param SizeInBytes : Size of the data to load, in bytes
+ ///
+ /// \return True if loading has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// Load the sound buffer from an array of samples - assumed format for
+ /// samples is 16 bits signed integer
+ ///
+ /// \param Samples : Pointer to the samples in memory
+ /// \param SamplesCount : Number of samples pointed by Samples
+ /// \param ChannelsCount : Number of channels (1 = mono, 2 = stereo, ...)
+ /// \param SampleRate : Frequency (number of samples to play per second)
+ ///
+ /// \return True if loading has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromSamples(const Int16* Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate);
+
+ ////////////////////////////////////////////////////////////
+ /// Save the sound buffer to a file
+ ///
+ /// \param Filename : Path of the sound file to write
+ ///
+ /// \return True if saving has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool SaveToFile(const std::string& Filename) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the sound samples
+ ///
+ /// \return Pointer to the array of sound samples, in 16 bits signed integer format
+ ///
+ ////////////////////////////////////////////////////////////
+ const Int16* GetSamples() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the samples count
+ ///
+ /// \return Number of samples
+ ///
+ ////////////////////////////////////////////////////////////
+ std::size_t GetSamplesCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sample rate
+ ///
+ /// \return Sound frequency (number of samples per second)
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetSampleRate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the number of channels (1 = mono, 2 = stereo, ...)
+ ///
+ /// \return Number of channels
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetChannelsCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sound duration
+ ///
+ /// \return Sound duration, in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetDuration() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator
+ ///
+ /// \param Other : Instance to assign
+ ///
+ /// \return Reference to the sound buffer
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundBuffer& operator =(const SoundBuffer& Other);
+
+private :
+
+ friend class Sound;
+
+ ////////////////////////////////////////////////////////////
+ /// Update the internal buffer with the audio samples
+ ///
+ /// \param ChannelsCount : Number of channels
+ /// \param SampleRate : Sample rate
+ ///
+ /// \return True on success
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Update(unsigned int ChannelsCount, unsigned int SampleRate);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int myBuffer; ///< OpenAL buffer identifier
+ std::vector<Int16> mySamples; ///< Samples buffer
+ float myDuration; ///< Sound duration, in seconds
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDBUFFER_HPP
diff --git a/include/SFML/Audio/.svn/text-base/SoundBufferRecorder.hpp.svn-base b/include/SFML/Audio/.svn/text-base/SoundBufferRecorder.hpp.svn-base
new file mode 100644
index 0000000..d70628a
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/SoundBufferRecorder.hpp.svn-base
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOUNDBUFFERRECORDER_HPP
+#define SFML_SOUNDBUFFERRECORDER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/SoundBuffer.hpp>
+#include <SFML/Audio/SoundRecorder.hpp>
+#include <vector>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Specialized SoundRecorder which saves the captured
+/// audio data into a sound buffer
+////////////////////////////////////////////////////////////
+class SFML_API SoundBufferRecorder : public SoundRecorder
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sound buffer containing the captured audio data
+ ///
+ /// \return Constant reference to the sound buffer
+ ///
+ ////////////////////////////////////////////////////////////
+ const SoundBuffer& GetBuffer();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// /see SoundBuffer::ProcessSamples
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCount);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::vector<Int16> mySamples; ///< Temporary sample buffer to hold the recorded data
+ SoundBuffer myBuffer; ///< Sound buffer that will contain the recorded data
+};
+
+} // namespace sf
+
+#endif // SFML_SOUNDBUFFERRECORDER_HPP
diff --git a/include/SFML/Audio/.svn/text-base/SoundRecorder.hpp.svn-base b/include/SFML/Audio/.svn/text-base/SoundRecorder.hpp.svn-base
new file mode 100644
index 0000000..9f4767e
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/SoundRecorder.hpp.svn-base
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOUNDRECORDER_HPP
+#define SFML_SOUNDRECORDER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Thread.hpp>
+#include <vector>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// SoundRecorder is an interface for capturing sound data,
+/// it is meant to be used as a base class
+////////////////////////////////////////////////////////////
+class SFML_API SoundRecorder : private Thread
+{
+public :
+
+ typedef bool (*FuncType)(const Int16*, std::size_t, void*);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the sound recorder with a callback function
+ /// for processing captured samples
+ ///
+ /// \param Callback : Callback for processing captured samples
+ /// \param UserData : Data to pass to the callback function (NULL by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundRecorder(FuncType Callback, void* UserData = NULL);
+
+ ////////////////////////////////////////////////////////////
+ /// Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~SoundRecorder();
+
+ ////////////////////////////////////////////////////////////
+ /// Start the capture.
+ /// Warning : only one capture can happen at the same time
+ ///
+ /// \param SampleRate : Sound frequency (the more samples, the higher the quality)
+ /// (44100 by default = CD quality)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Start(unsigned int SampleRate = 44100);
+
+ ////////////////////////////////////////////////////////////
+ /// Stop the capture
+ ///
+ ////////////////////////////////////////////////////////////
+ void Stop();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sample rate
+ ///
+ /// \return Frequency, in samples per second
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetSampleRate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Tell if the system supports sound capture.
+ /// If not, this class won't be usable
+ ///
+ /// \return True if audio capture is supported
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool CanCapture();
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundRecorder();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Process a new chunk of recorded samples
+ ///
+ /// \param Samples : Pointer to the new chunk of recorded samples
+ /// \param SamplesCount : Number of samples pointed by Samples
+ ///
+ /// \return False to stop recording audio data, true to continue
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCount);
+
+ ////////////////////////////////////////////////////////////
+ /// /see Thread::Run
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Run();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the available captured samples and process them
+ ///
+ ////////////////////////////////////////////////////////////
+ void ProcessCapturedSamples();
+
+ ////////////////////////////////////////////////////////////
+ /// Clean up the recorder internal resources
+ ///
+ ////////////////////////////////////////////////////////////
+ void CleanUp();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FuncType myCallback; ///< Callback for processing captured samples
+ void* myUserData; ///< User data to pass to the processing callback
+ std::vector<Int16> mySamples; ///< Buffer to store captured samples
+ unsigned int mySampleRate; ///< Sample rate
+ bool myIsCapturing; ///< Capturing state
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDRECORDER_HPP
diff --git a/include/SFML/Audio/.svn/text-base/SoundStream.hpp.svn-base b/include/SFML/Audio/.svn/text-base/SoundStream.hpp.svn-base
new file mode 100644
index 0000000..8cc2024
--- /dev/null
+++ b/include/SFML/Audio/.svn/text-base/SoundStream.hpp.svn-base
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOUNDSTREAM_HPP
+#define SFML_SOUNDSTREAM_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Audio/Sound.hpp>
+#include <SFML/System/Thread.hpp>
+#include <cstdlib>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// SoundStream is a streamed sound, ie samples are acquired
+/// while the sound is playing. Use it for big sounds that would
+/// require hundreds of MB in memory (see Music),
+/// or for streaming sound from the network
+////////////////////////////////////////////////////////////
+class SFML_API SoundStream : private Thread, private Sound
+{
+public :
+
+ using Sound::Status;
+ using Sound::Stopped;
+ using Sound::Paused;
+ using Sound::Playing;
+ using Sound::Pause;
+ using Sound::SetPitch;
+ using Sound::SetVolume;
+ using Sound::SetPosition;
+ using Sound::SetMinDistance;
+ using Sound::SetAttenuation;
+ using Sound::GetPitch;
+ using Sound::GetVolume;
+ using Sound::GetPosition;
+ using Sound::GetMinDistance;
+ using Sound::GetAttenuation;
+
+ ////////////////////////////////////////////////////////////
+ /// Structure defining a chunk of audio data to stream
+ ////////////////////////////////////////////////////////////
+ struct Chunk
+ {
+ const Int16* Samples; ///< Pointer to the audio samples
+ std::size_t NbSamples; ///< Number of samples pointed by Samples
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~SoundStream();
+
+ ////////////////////////////////////////////////////////////
+ /// Start playing the audio stream
+ ///
+ ////////////////////////////////////////////////////////////
+ void Play();
+
+ ////////////////////////////////////////////////////////////
+ /// Stop playing the audio stream
+ ///
+ ////////////////////////////////////////////////////////////
+ void Stop();
+
+ ////////////////////////////////////////////////////////////
+ /// Return the number of channels (1 = mono, 2 = stereo)
+ ///
+ /// \return Number of channels
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetChannelsCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the stream sample rate
+ ///
+ /// \return Stream frequency (number of samples per second)
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetSampleRate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the status of the stream (stopped, paused, playing)
+ ///
+ /// \return Current status of the sound
+ ///
+ ////////////////////////////////////////////////////////////
+ Status GetStatus() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current playing position of the stream
+ ///
+ /// \return Current playing position, expressed in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetPlayingOffset() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Set the stream loop state.
+ /// This parameter is disabled by default
+ ///
+ /// \param Loop : True to play in loop, false to play once
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetLoop(bool Loop);
+
+ ////////////////////////////////////////////////////////////
+ /// Tell whether or not the stream is looping
+ ///
+ /// \return True if the music is looping, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool GetLoop() const;
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SoundStream();
+
+ ////////////////////////////////////////////////////////////
+ /// Set the audio stream parameters, you must call it before Play()
+ ///
+ /// \param ChannelsCount : Number of channels
+ /// \param SampleRate : Sample rate
+ ///
+ ////////////////////////////////////////////////////////////
+ void Initialize(unsigned int ChannelsCount, unsigned int SampleRate);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// /see Thread::Run
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Run();
+
+ ////////////////////////////////////////////////////////////
+ /// Called when the sound restarts
+ ///
+ /// \return If false is returned, the playback is aborted
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool OnStart();
+
+ ////////////////////////////////////////////////////////////
+ /// Called each time new audio data is needed to feed the stream
+ ///
+ /// \param Data : New chunk of data to stream
+ ///
+ /// \return True to continue playback, false to stop
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool OnGetData(Chunk& Data) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Fill a new buffer with audio data, and push it to the
+ /// playing queue
+ ///
+ /// \param Buffer : Buffer to fill
+ ///
+ /// \return True if the derived class has requested to stop
+ ///
+ ////////////////////////////////////////////////////////////
+ bool FillAndPushBuffer(unsigned int Buffer);
+
+ ////////////////////////////////////////////////////////////
+ /// Fill the buffers queue with all available buffers
+ ///
+ /// \return True if the derived class has requested to stop
+ ///
+ ////////////////////////////////////////////////////////////
+ bool FillQueue();
+
+ ////////////////////////////////////////////////////////////
+ /// Clear the queue of any remaining buffers
+ ///
+ ////////////////////////////////////////////////////////////
+ void ClearQueue();
+
+ enum {BuffersCount = 3};
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ bool myIsStreaming; ///< Streaming state (true = playing, false = stopped)
+ unsigned int myBuffers[BuffersCount]; ///< Sound buffers used to store temporary audio data
+ unsigned int myChannelsCount; ///< Number of channels (1 = mono, 2 = stereo, ...)
+ unsigned int mySampleRate; ///< Frequency (samples / second)
+ unsigned long myFormat; ///< Format of the internal sound buffers
+ bool myLoop; ///< Loop flag (true to loop, false to play once)
+ unsigned int mySamplesProcessed; ///< Number of buffers processed since beginning of the stream
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOUNDSTREAM_HPP
diff --git a/include/SFML/Audio/AudioResource.hpp b/include/SFML/Audio/AudioResource.hpp
index c0dbdb2..c0dbdb2 100755..100644
--- a/include/SFML/Audio/AudioResource.hpp
+++ b/include/SFML/Audio/AudioResource.hpp
diff --git a/include/SFML/Audio/Listener.hpp b/include/SFML/Audio/Listener.hpp
index c6679b3..c6679b3 100755..100644
--- a/include/SFML/Audio/Listener.hpp
+++ b/include/SFML/Audio/Listener.hpp
diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp
index 898f1f3..2820c2a 100755..100644
--- a/include/SFML/Audio/Music.hpp
+++ b/include/SFML/Audio/Music.hpp
@@ -85,23 +85,6 @@ public :
bool OpenFromMemory(const char* Data, std::size_t SizeInBytes);
////////////////////////////////////////////////////////////
- /// Set the music loop state.
- /// This parameter is disabled by default
- ///
- /// \param Loop : True to play in loop, false to play once
- ///
- ////////////////////////////////////////////////////////////
- void SetLoop(bool Loop);
-
- ////////////////////////////////////////////////////////////
- /// Tell whether or not the music is looping
- ///
- /// \return True if the music is looping, false otherwise
- ///
- ////////////////////////////////////////////////////////////
- bool GetLoop() const;
-
- ////////////////////////////////////////////////////////////
/// Get the music duration
///
/// \return Music duration, in seconds
@@ -127,7 +110,6 @@ private :
// Member data
////////////////////////////////////////////////////////////
priv::SoundFile* myFile; ///< Sound file
- bool myLoop; ///< Loop flag (true to loop, false to play once)
float myDuration; ///< Music duration, in seconds
std::vector<Int16> mySamples; ///< Temporary buffer of samples
};
diff --git a/include/SFML/Audio/Sound.hpp b/include/SFML/Audio/Sound.hpp
index 60b1e2a..cced19e 100755..100644
--- a/include/SFML/Audio/Sound.hpp
+++ b/include/SFML/Audio/Sound.hpp
@@ -28,9 +28,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <cstdlib>
-#include <SFML/Audio/AudioResource.hpp>
+#include <SFML/System/Resource.hpp>
#include <SFML/System/Vector3.hpp>
+#include <SFML/Audio/AudioResource.hpp>
+#include <cstdlib>
namespace sf
@@ -38,7 +39,7 @@ namespace sf
class SoundBuffer;
////////////////////////////////////////////////////////////
-/// Sound defines the properties of the sound such as position,
+/// Sound defines the properties of a sound such as position,
/// volume, pitch, etc.
////////////////////////////////////////////////////////////
class SFML_API Sound : public AudioResource
@@ -179,6 +180,14 @@ public :
void SetAttenuation(float Attenuation);
////////////////////////////////////////////////////////////
+ /// Set the current playing position of the sound
+ ///
+ /// \param TimeOffset : New playing position, expressed in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPlayingOffset(float TimeOffset);
+
+ ////////////////////////////////////////////////////////////
/// Get the source buffer
///
/// \return Sound buffer bound to the sound (can be NULL)
@@ -267,8 +276,8 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- unsigned int mySource; ///< OpenAL source identifier
- const SoundBuffer* myBuffer; ///< Sound buffer bound to the source
+ unsigned int mySource; ///< OpenAL source identifier
+ ResourcePtr<SoundBuffer> myBuffer; ///< Sound buffer bound to the source
};
} // namespace sf
diff --git a/include/SFML/Audio/SoundBuffer.hpp b/include/SFML/Audio/SoundBuffer.hpp
index f28cc89..f9194b2 100755..100644
--- a/include/SFML/Audio/SoundBuffer.hpp
+++ b/include/SFML/Audio/SoundBuffer.hpp
@@ -28,7 +28,7 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Config.hpp>
+#include <SFML/System/Resource.hpp>
#include <SFML/Audio/AudioResource.hpp>
#include <string>
#include <vector>
@@ -40,7 +40,7 @@ namespace sf
/// SoundBuffer is the low-level for loading and manipulating
/// sound buffers
////////////////////////////////////////////////////////////
-class SFML_API SoundBuffer : public AudioResource
+class SFML_API SoundBuffer : public AudioResource, public Resource<SoundBuffer>
{
public :
diff --git a/include/SFML/Audio/SoundBufferRecorder.hpp b/include/SFML/Audio/SoundBufferRecorder.hpp
index b108af4..d70628a 100755..100644
--- a/include/SFML/Audio/SoundBufferRecorder.hpp
+++ b/include/SFML/Audio/SoundBufferRecorder.hpp
@@ -36,7 +36,7 @@
namespace sf
{
////////////////////////////////////////////////////////////
-/// Specialized sfSoundRecorder which saves the captured
+/// Specialized SoundRecorder which saves the captured
/// audio data into a sound buffer
////////////////////////////////////////////////////////////
class SFML_API SoundBufferRecorder : public SoundRecorder
diff --git a/include/SFML/Audio/SoundRecorder.hpp b/include/SFML/Audio/SoundRecorder.hpp
index 7f927cf..9f4767e 100755..100644
--- a/include/SFML/Audio/SoundRecorder.hpp
+++ b/include/SFML/Audio/SoundRecorder.hpp
@@ -115,7 +115,7 @@ private :
virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCount);
////////////////////////////////////////////////////////////
- /// /see sfThread::Run
+ /// /see Thread::Run
///
////////////////////////////////////////////////////////////
virtual void Run();
diff --git a/include/SFML/Audio/SoundStream.hpp b/include/SFML/Audio/SoundStream.hpp
index a5649e7..8cc2024 100755..100644
--- a/include/SFML/Audio/SoundStream.hpp
+++ b/include/SFML/Audio/SoundStream.hpp
@@ -38,7 +38,7 @@ namespace sf
////////////////////////////////////////////////////////////
/// SoundStream is a streamed sound, ie samples are acquired
/// while the sound is playing. Use it for big sounds that would
-/// require hundreds of MB in memory (see sfMusic),
+/// require hundreds of MB in memory (see Music),
/// or for streaming sound from the network
////////////////////////////////////////////////////////////
class SFML_API SoundStream : private Thread, private Sound
@@ -112,6 +112,31 @@ public :
////////////////////////////////////////////////////////////
Status GetStatus() const;
+ ////////////////////////////////////////////////////////////
+ /// Get the current playing position of the stream
+ ///
+ /// \return Current playing position, expressed in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetPlayingOffset() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Set the stream loop state.
+ /// This parameter is disabled by default
+ ///
+ /// \param Loop : True to play in loop, false to play once
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetLoop(bool Loop);
+
+ ////////////////////////////////////////////////////////////
+ /// Tell whether or not the stream is looping
+ ///
+ /// \return True if the music is looping, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool GetLoop() const;
+
protected :
////////////////////////////////////////////////////////////
@@ -156,10 +181,29 @@ private :
virtual bool OnGetData(Chunk& Data) = 0;
////////////////////////////////////////////////////////////
- /// Clean up stream internal resources
+ /// Fill a new buffer with audio data, and push it to the
+ /// playing queue
+ ///
+ /// \param Buffer : Buffer to fill
+ ///
+ /// \return True if the derived class has requested to stop
+ ///
+ ////////////////////////////////////////////////////////////
+ bool FillAndPushBuffer(unsigned int Buffer);
+
+ ////////////////////////////////////////////////////////////
+ /// Fill the buffers queue with all available buffers
+ ///
+ /// \return True if the derived class has requested to stop
+ ///
+ ////////////////////////////////////////////////////////////
+ bool FillQueue();
+
+ ////////////////////////////////////////////////////////////
+ /// Clear the queue of any remaining buffers
///
////////////////////////////////////////////////////////////
- void CleanUp();
+ void ClearQueue();
enum {BuffersCount = 3};
@@ -171,6 +215,8 @@ private :
unsigned int myChannelsCount; ///< Number of channels (1 = mono, 2 = stereo, ...)
unsigned int mySampleRate; ///< Frequency (samples / second)
unsigned long myFormat; ///< Format of the internal sound buffers
+ bool myLoop; ///< Loop flag (true to loop, false to play once)
+ unsigned int mySamplesProcessed; ///< Number of buffers processed since beginning of the stream
};
} // namespace sf
diff --git a/include/SFML/Config.hpp b/include/SFML/Config.hpp
index 762987d..86800e4 100755..100644
--- a/include/SFML/Config.hpp
+++ b/include/SFML/Config.hpp
@@ -58,37 +58,6 @@
////////////////////////////////////////////////////////////
-// Identify the platform
-////////////////////////////////////////////////////////////
-#if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__INTEL__) || defined(__i386)
-
- // Intel x86
- #define SFML_PLATFORM_X86
-
-#elif defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64)
-
- // AMD64
- #define SFML_PLATFORM_AMD64
-
-#elif defined(__IA64__) || defined(_M_IA64)
-
- // Intel IA64
- #define SFML_PLATFORM_IA64
-
-#elif defined(__powerpc__) || defined(_M_PPC) || defined(_ARCH_PPC)
-
- // Apple PowerPC
- #define SFML_PLATFORM_POWERPC
-
-#else
-
- // Unsupported platform
- #error This platform is not supported by SFML library
-
-#endif
-
-
-////////////////////////////////////////////////////////////
// Define a portable debug macro
////////////////////////////////////////////////////////////
#if !defined(NDEBUG)
@@ -143,23 +112,7 @@
////////////////////////////////////////////////////////////
-// Define endianness depending on current platform
-////////////////////////////////////////////////////////////
-#ifdef SFML_PLATFORM_POWERPC
-
- // Apple PowerPC processors are big endian
- #define SFML_BIG_ENDIAN
-
-#else
-
- // The other supported processors (x86, IA64, AMD64) are little endian
- #define SFML_LITTLE_ENDIAN
-
-#endif
-
-
-////////////////////////////////////////////////////////////
-// Define portable types
+// Define portable fixed-size types
////////////////////////////////////////////////////////////
#include <climits>
@@ -167,7 +120,7 @@ namespace sf
{
// 8 bits integer types
#if UCHAR_MAX == 0xFF
- typedef char Int8;
+ typedef signed char Int8;
typedef unsigned char Uint8;
#else
#error No 8 bits integer type for this platform
@@ -175,13 +128,13 @@ namespace sf
// 16 bits integer types
#if USHRT_MAX == 0xFFFF
- typedef short Int16;
+ typedef signed short Int16;
typedef unsigned short Uint16;
#elif UINT_MAX == 0xFFFF
- typedef int Int16;
+ typedef signed int Int16;
typedef unsigned int Uint16;
#elif ULONG_MAX == 0xFFFF
- typedef long Int16;
+ typedef signed long Int16;
typedef unsigned long Uint16;
#else
#error No 16 bits integer type for this platform
@@ -189,13 +142,13 @@ namespace sf
// 32 bits integer types
#if USHRT_MAX == 0xFFFFFFFF
- typedef short Int32;
+ typedef signed short Int32;
typedef unsigned short Uint32;
#elif UINT_MAX == 0xFFFFFFFF
- typedef int Int32;
+ typedef signed int Int32;
typedef unsigned int Uint32;
#elif ULONG_MAX == 0xFFFFFFFF
- typedef long Int32;
+ typedef signed long Int32;
typedef unsigned long Uint32;
#else
#error No 32 bits integer type for this platform
diff --git a/include/SFML/Graphics.hpp b/include/SFML/Graphics.hpp
index fab8851..c6282c5 100755..100644
--- a/include/SFML/Graphics.hpp
+++ b/include/SFML/Graphics.hpp
@@ -32,6 +32,7 @@
#include <SFML/Window.hpp>
#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Font.hpp>
+#include <SFML/Graphics/Glyph.hpp>
#include <SFML/Graphics/Image.hpp>
#include <SFML/Graphics/PostFX.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
diff --git a/include/SFML/Graphics/.svn/all-wcprops b/include/SFML/Graphics/.svn/all-wcprops
new file mode 100644
index 0000000..bf7d27a
--- /dev/null
+++ b/include/SFML/Graphics/.svn/all-wcprops
@@ -0,0 +1,101 @@
+K 25
+svn:wc:ra_dav:version-url
+V 48
+/svnroot/sfml/!svn/ver/904/include/SFML/Graphics
+END
+Rect.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/482/include/SFML/Graphics/Rect.hpp
+END
+Shape.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/798/include/SFML/Graphics/Shape.hpp
+END
+String.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svnroot/sfml/!svn/ver/829/include/SFML/Graphics/String.hpp
+END
+Sprite.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svnroot/sfml/!svn/ver/804/include/SFML/Graphics/Sprite.hpp
+END
+Font.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/823/include/SFML/Graphics/Font.hpp
+END
+RenderWindow.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svnroot/sfml/!svn/ver/746/include/SFML/Graphics/RenderWindow.hpp
+END
+View.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/746/include/SFML/Graphics/View.hpp
+END
+Color.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/829/include/SFML/Graphics/Color.hpp
+END
+Drawable.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/798/include/SFML/Graphics/Drawable.hpp
+END
+Matrix3.inl
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svnroot/sfml/!svn/ver/904/include/SFML/Graphics/Matrix3.inl
+END
+Image.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/859/include/SFML/Graphics/Image.hpp
+END
+PostFX.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svnroot/sfml/!svn/ver/859/include/SFML/Graphics/PostFX.hpp
+END
+Glyph.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/825/include/SFML/Graphics/Glyph.hpp
+END
+RenderTarget.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svnroot/sfml/!svn/ver/746/include/SFML/Graphics/RenderTarget.hpp
+END
+Matrix3.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svnroot/sfml/!svn/ver/652/include/SFML/Graphics/Matrix3.hpp
+END
+Rect.inl
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/434/include/SFML/Graphics/Rect.inl
+END
diff --git a/include/SFML/Graphics/.svn/entries b/include/SFML/Graphics/.svn/entries
new file mode 100644
index 0000000..434cc67
--- /dev/null
+++ b/include/SFML/Graphics/.svn/entries
@@ -0,0 +1,572 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/Graphics
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-10-10T15:32:31.196540Z
+904
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+Rect.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+b25dca360b812acc1917f2971d0a3473
+2008-03-05T13:21:19.473467Z
+482
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4673
+
+Shape.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+cdd6533a42d7b9329f26e2664f4e24fb
+2008-08-04T17:27:29.138748Z
+798
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+13542
+
+String.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+93c4a7a889edb2025049ac1a190a2c8e
+2008-08-26T13:50:00.906040Z
+829
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7264
+
+Sprite.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+b3c6fcf6f6671b52cf09fe8b7fe53699
+2008-08-09T14:50:25.623007Z
+804
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6721
+
+Font.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+84c492130362053af761fbf76770365f
+2008-08-23T13:57:04.388259Z
+823
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5686
+
+RenderWindow.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+f6fc82f6d5f77bd59b28ed6acc88e4d0
+2008-07-05T10:10:08.194875Z
+746
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5278
+
+View.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+18e273df6ddcc788bb3cafe1f92b67a9
+2008-07-05T10:10:08.194875Z
+746
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7131
+
+Color.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+7cef26a60cedab4ac8c4d85a67fe3462
+2008-08-26T13:50:00.906040Z
+829
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5431
+
+Drawable.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+0d6b6988fe1b7cf1749a0555384263f7
+2008-08-04T17:27:29.138748Z
+798
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+13756
+
+Matrix3.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+e3e551268aaa1319714ac289f22b96be
+2008-10-10T15:32:31.196540Z
+904
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8083
+
+Image.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+7ba5d61a527c870f5485d7e025405364
+2008-09-07T16:48:20.213384Z
+859
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+13454
+
+PostFX.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+85433af8c40ce2718531e0ea23a45fae
+2008-09-07T16:48:20.213384Z
+859
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7158
+
+Glyph.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+06a7b5081ca7915ecbabf895e2af24ba
+2008-08-24T16:13:56.204313Z
+825
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2283
+
+RenderTarget.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+c70064bc06dd3f6676c061dbda4f4da3
+2008-07-05T10:10:08.194875Z
+746
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6223
+
+Matrix3.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+f657ea65be8c4b87702d4d2d01bb2002
+2008-05-15T16:49:04.685797Z
+652
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5459
+
+Rect.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+72cbf0a7efad2641207f761e02ee1aa7
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3847
+
diff --git a/include/SFML/Graphics/.svn/format b/include/SFML/Graphics/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/Graphics/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Graphics/.svn/text-base/Color.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Color.hpp.svn-base
new file mode 100644
index 0000000..1898e4d
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Color.hpp.svn-base
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_COLOR_HPP
+#define SFML_COLOR_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Color is an utility class for manipulating
+/// 32-bits RGBA colors
+////////////////////////////////////////////////////////////
+class SFML_API Color
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Color();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the color from its 4 RGBA components
+ ///
+ /// \param R : Red component (0 .. 255)
+ /// \param G : Green component (0 .. 255)
+ /// \param B : Blue component (0 .. 255)
+ /// \param A : Alpha component (0 .. 255) (255 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A = 255);
+
+ ////////////////////////////////////////////////////////////
+ /// Operator += overload to add a color
+ ///
+ /// \param Other : Color to add
+ ///
+ /// \return Component-wise saturated addition of the two colors
+ ///
+ ////////////////////////////////////////////////////////////
+ Color& operator +=(const Color& Other);
+
+ ////////////////////////////////////////////////////////////
+ /// Operator *= overload to modulate a color
+ ///
+ /// \param Other : Color to modulate
+ ///
+ /// \return Component-wise multiplication of the two colors
+ ///
+ ////////////////////////////////////////////////////////////
+ Color& operator *=(const Color& Other);
+
+ ////////////////////////////////////////////////////////////
+ /// Compare two colors (for equality)
+ ///
+ /// \param Other : Color to compare
+ ///
+ /// \return True if colors are equal
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator ==(const Color& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Compare two colors (for difference)
+ ///
+ /// \param Other : Color to compare
+ ///
+ /// \return True if colors are different
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator !=(const Color& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ // Static member data
+ ////////////////////////////////////////////////////////////
+ static const Color Black; ///< Black predefined color
+ static const Color White; ///< White predefined color
+ static const Color Red; ///< Red predefined color
+ static const Color Green; ///< Green predefined color
+ static const Color Blue; ///< Blue predefined color
+ static const Color Yellow; ///< Yellow predefined color
+ static const Color Magenta; ///< Magenta predefined color
+ static const Color Cyan; ///< Cyan predefined color
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Uint8 r; ///< Red component
+ Uint8 g; ///< Green component
+ Uint8 b; ///< Blue component
+ Uint8 a; ///< Alpha (transparency) component
+};
+
+////////////////////////////////////////////////////////////
+/// Operator + overload to add two colors
+///
+/// \param Color1 : First color
+/// \param Color2 : Second color
+///
+/// \return Component-wise saturated addition of the two colors
+///
+////////////////////////////////////////////////////////////
+SFML_API Color operator +(const Color& Color1, const Color& Color2);
+
+////////////////////////////////////////////////////////////
+/// Operator * overload to modulate two colors
+///
+/// \param Color1 : First color
+/// \param Color2 : Second color
+///
+/// \return Component-wise multiplication of the two colors
+///
+////////////////////////////////////////////////////////////
+SFML_API Color operator *(const Color& Color1, const Color& Color2);
+
+} // namespace sf
+
+
+#endif // SFML_COLOR_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Drawable.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Drawable.hpp.svn-base
new file mode 100644
index 0000000..3586047
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Drawable.hpp.svn-base
@@ -0,0 +1,361 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_DRAWABLE_HPP
+#define SFML_DRAWABLE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Vector2.hpp>
+#include <SFML/Graphics/Color.hpp>
+#include <SFML/Graphics/Matrix3.hpp>
+
+
+namespace sf
+{
+class RenderTarget;
+
+////////////////////////////////////////////////////////////
+/// Enumerate the blending modes for drawable objects
+////////////////////////////////////////////////////////////
+namespace Blend
+{
+ enum Mode
+ {
+ Alpha, ///< Pixel = Src * a + Dest * (1 - a)
+ Add, ///< Pixel = Src + Dest
+ Multiply, ///< Pixel = Src * Dest
+ None ///< No blending
+ };
+}
+
+////////////////////////////////////////////////////////////
+/// Abstract base class for every object that can be drawn
+/// into a render window
+////////////////////////////////////////////////////////////
+class SFML_API Drawable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Position : Position of the object (0, 0 by default)
+ /// \param Scale : Scale factor (1, 1 by default)
+ /// \param Rotation : Orientation, in degrees (0 by default)
+ /// \param Col : Color of the object (white by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Drawable(const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255));
+
+ ////////////////////////////////////////////////////////////
+ /// Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~Drawable();
+
+ ////////////////////////////////////////////////////////////
+ /// Set the position of the object (take 2 values)
+ ///
+ /// \param X : New X coordinate
+ /// \param Y : New Y coordinate
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPosition(float X, float Y);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the position of the object (take a 2D vector)
+ ///
+ /// \param Position : New position
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPosition(const Vector2f& Position);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the X position of the object
+ ///
+ /// \param X : New X coordinate
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetX(float X);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the Y position of the object
+ ///
+ /// \param Y : New Y coordinate
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetY(float Y);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the scale of the object (take 2 values)
+ ///
+ /// \param ScaleX : New horizontal scale (must be strictly positive)
+ /// \param ScaleY : New vertical scale (must be strictly positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetScale(float ScaleX, float ScaleY);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the scale of the object (take a 2D vector)
+ ///
+ /// \param Scale : New scale (both values must be strictly positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetScale(const Vector2f& Scale);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the X scale factor of the object
+ ///
+ /// \param X : New X scale factor
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetScaleX(float FactorX);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the Y scale factor of the object
+ ///
+ /// \param Y : New Y scale factor
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetScaleY(float FactorY);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the center of the object, in coordinates relative to the
+ /// top-left of the object (take 2 values).
+ /// The default center is (0, 0)
+ ///
+ /// \param CenterX : X coordinate of the center
+ /// \param CenterY : Y coordinate of the center
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetCenter(float CenterX, float CenterY);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the center of the object, in coordinates relative to the
+ /// top-left of the object (take a 2D vector).
+ /// The default center is (0, 0)
+ ///
+ /// \param Center : New center
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetCenter(const Vector2f& Center);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the orientation of the object
+ ///
+ /// \param Rotation : Angle of rotation, in degrees
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetRotation(float Rotation);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the color of the object.
+ /// The default color is white
+ ///
+ /// \param Col : New color
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetColor(const Color& Col);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the blending mode for the object.
+ /// The default blend mode is Blend::Alpha
+ ///
+ /// \param Mode : New blending mode
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetBlendMode(Blend::Mode Mode);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the position of the object
+ ///
+ /// \return Current position
+ ///
+ ////////////////////////////////////////////////////////////
+ const Vector2f& GetPosition() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current scale of the object
+ ///
+ /// \return Current scale factor (always positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ const Vector2f& GetScale() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the center of the object
+ ///
+ /// \return Current position of the center
+ ///
+ ////////////////////////////////////////////////////////////
+ const Vector2f& GetCenter() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the orientation of the object.
+ /// Rotation is always in the range [0, 360]
+ ///
+ /// \return Current rotation, in degrees
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetRotation() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the color of the object
+ ///
+ /// \return Current color
+ ///
+ ////////////////////////////////////////////////////////////
+ const Color& GetColor() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current blending mode
+ ///
+ /// \return Current blending mode
+ ///
+ ////////////////////////////////////////////////////////////
+ Blend::Mode GetBlendMode() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Move the object of a given offset (take 2 values)
+ ///
+ /// \param OffsetX : X offset
+ /// \param OffsetY : Y offset
+ ///
+ ////////////////////////////////////////////////////////////
+ void Move(float OffsetX, float OffsetY);
+
+ ////////////////////////////////////////////////////////////
+ /// Move the object of a given offset (take a 2D vector)
+ ///
+ /// \param Offset : Amount of units to move the object of
+ ///
+ ////////////////////////////////////////////////////////////
+ void Move(const Vector2f& Offset);
+
+ ////////////////////////////////////////////////////////////
+ /// Scale the object (take 2 values)
+ ///
+ /// \param FactorX : Scaling factor on X (must be strictly positive)
+ /// \param FactorY : Scaling factor on Y (must be strictly positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Scale(float FactorX, float FactorY);
+
+ ////////////////////////////////////////////////////////////
+ /// Scale the object (take a 2D vector)
+ ///
+ /// \param Factor : Scaling factors (both values must be strictly positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Scale(const Vector2f& Factor);
+
+ ////////////////////////////////////////////////////////////
+ /// Rotate the object
+ ///
+ /// \param Angle : Angle of rotation, in degrees
+ ///
+ ////////////////////////////////////////////////////////////
+ void Rotate(float Angle);
+
+ ////////////////////////////////////////////////////////////
+ /// Transform a point from global coordinates into local coordinates
+ /// (ie it applies the inverse of object's center, translation, rotation and scale to the point)
+ ///
+ /// \param Point : Point to transform
+ ///
+ /// \return Transformed point
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f TransformToLocal(const sf::Vector2f& Point) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Transform a point from local coordinates into global coordinates
+ /// (ie it applies the object's center, translation, rotation and scale to the point)
+ ///
+ /// \param Point : Point to transform
+ ///
+ /// \return Transformed point
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f TransformToGlobal(const sf::Vector2f& Point) const;
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Get the transform matrix of the drawable
+ ///
+ /// \return Transform matrix
+ ///
+ ////////////////////////////////////////////////////////////
+ const Matrix3& GetMatrix() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the inverse transform matrix of the drawable
+ ///
+ /// \return Inverse transform matrix
+ ///
+ ////////////////////////////////////////////////////////////
+ const Matrix3& GetInverseMatrix() const;
+
+private :
+
+ friend class RenderTarget;
+
+ ////////////////////////////////////////////////////////////
+ /// Draw the object into the specified window
+ ///
+ /// \param Target : Target into which render the object
+ ///
+ ////////////////////////////////////////////////////////////
+ void Draw(RenderTarget& Target) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Render the specific geometry of the object
+ ///
+ /// \param Target : Target into which render the object
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Render(RenderTarget& Target) const = 0;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Vector2f myPosition; ///< Position of the object on screen
+ Vector2f myScale; ///< Scale of the object
+ Vector2f myCenter; ///< Origin of translation / rotation / scaling of the object
+ float myRotation; ///< Orientation of the object, in degrees
+ Color myColor; ///< Overlay color of the object
+ Blend::Mode myBlendMode; ///< Blending mode
+ mutable bool myNeedUpdate; ///< Do we need to recompute the transform matrix ?
+ mutable bool myInvNeedUpdate; ///< Do we need to recompute the inverse transform matrix ?
+ mutable Matrix3 myMatrix; ///< Precomputed transform matrix gathering the translation / rotation / scale / center
+ mutable Matrix3 myInvMatrix; ///< Precomputed inverse transform matrix gathering the translation / rotation / scale / center
+};
+
+} // namespace sf
+
+
+#endif // SFML_DRAWABLE_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Font.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Font.hpp.svn-base
new file mode 100644
index 0000000..293954e
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Font.hpp.svn-base
@@ -0,0 +1,145 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_FONT_HPP
+#define SFML_FONT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <SFML/System/Unicode.hpp>
+#include <SFML/Graphics/Glyph.hpp>
+#include <SFML/Graphics/Image.hpp>
+#include <SFML/Graphics/Rect.hpp>
+#include <map>
+#include <string>
+
+
+namespace sf
+{
+class String;
+
+namespace priv
+{
+class FontLoader;
+}
+////////////////////////////////////////////////////////////
+/// Font is the low-level class for loading and
+/// manipulating character fonts. This class is meant to
+/// be used by sf::String
+////////////////////////////////////////////////////////////
+class SFML_API Font : public Resource<Font>
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Font();
+
+ ////////////////////////////////////////////////////////////
+ /// Load the font from a file
+ ///
+ /// \param Filename : Font file to load
+ /// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
+ /// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromFile(const std::string& Filename, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset);
+
+ ////////////////////////////////////////////////////////////
+ /// Load the font from a file in memory
+ ///
+ /// \param Data : Pointer to the data to load
+ /// \param SizeInBytes : Size of the data, in bytes
+ /// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
+ /// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromMemory(const char* Data, std::size_t SizeInBytes, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the base size of characters in the font;
+ /// All glyphs dimensions are based on this value
+ ///
+ /// \return Base size of characters
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetCharacterSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the description of a glyph (character)
+ /// given by its unicode value
+ ///
+ /// \param CodePoint : Unicode value of the character to get
+ ///
+ /// \return Glyph's visual settings, or an invalid glyph if character not found
+ ///
+ ////////////////////////////////////////////////////////////
+ const Glyph& GetGlyph(Uint32 CodePoint) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the image containing the rendered characters (glyphs)
+ ///
+ /// \return Image containing glyphs
+ ///
+ ////////////////////////////////////////////////////////////
+ const Image& GetImage() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the SFML default built-in font (Arial)
+ ///
+ /// \return Instance of the default font
+ ///
+ ////////////////////////////////////////////////////////////
+ static const Font& GetDefaultFont();
+
+private :
+
+ friend class priv::FontLoader;
+
+ ////////////////////////////////////////////////////////////
+ // Static member data
+ ////////////////////////////////////////////////////////////
+ static Uint32 ourDefaultCharset[]; ///< The default charset (all printable ISO-8859-1 characters)
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Image myTexture; ///< Texture holding the bitmap font
+ unsigned int myCharSize; ///< Size of characters in the bitmap font
+ std::map<Uint32, Glyph> myGlyphs; ///< Rendering settings of each character (glyph)
+};
+
+} // namespace sf
+
+
+#endif // SFML_FONT_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Glyph.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Glyph.hpp.svn-base
new file mode 100644
index 0000000..602cfef
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Glyph.hpp.svn-base
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GLYPH_HPP
+#define SFML_GLYPH_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Graphics/Rect.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Structure describing a glyph (a visual character)
+////////////////////////////////////////////////////////////
+class SFML_API Glyph
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Glyph() : Advance(0) {}
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ int Advance; ///< Offset to move horizontically to the next character
+ IntRect Rectangle; ///< Bounding rectangle of the glyph, in relative coordinates
+ FloatRect TexCoords; ///< Texture coordinates of the glyph inside the bitmap font
+};
+
+} // namespace sf
+
+
+#endif // SFML_GLYPH_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Image.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Image.hpp.svn-base
new file mode 100644
index 0000000..e950ec3
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Image.hpp.svn-base
@@ -0,0 +1,335 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_IMAGE_HPP
+#define SFML_IMAGE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/Graphics/Color.hpp>
+#include <SFML/Graphics/Rect.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+class RenderImage;
+class RenderWindow;
+
+////////////////////////////////////////////////////////////
+/// Image is the low-level class for loading and
+/// manipulating images
+////////////////////////////////////////////////////////////
+class SFML_API Image : public Resource<Image>
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Image();
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : instance to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ Image(const Image& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct an empty image
+ ///
+ /// \param Width : Image width
+ /// \param Height : Image height
+ /// \param Col : Image color (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Image(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255));
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the image from pixels in memory
+ ///
+ /// \param Width : Image width
+ /// \param Height : Image height
+ /// \param Data : Pointer to the pixels in memory (assumed format is RGBA)
+ ///
+ ////////////////////////////////////////////////////////////
+ Image(unsigned int Width, unsigned int Height, const Uint8* Data);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Image();
+
+ ////////////////////////////////////////////////////////////
+ /// Load the image from a file
+ ///
+ /// \param Filename : Path of the image file to load
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromFile(const std::string& Filename);
+
+ ////////////////////////////////////////////////////////////
+ /// Load the image from a file in memory
+ ///
+ /// \param Data : Pointer to the file data in memory
+ /// \param SizeInBytes : Size of the data to load, in bytes
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// Load the image directly from an array of pixels
+ ///
+ /// \param Width : Image width
+ /// \param Height : Image height
+ /// \param Data : Pointer to the pixels in memory (assumed format is RGBA)
+ ///
+ /// \return True if loading was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromPixels(unsigned int Width, unsigned int Height, const Uint8* Data);
+
+ ////////////////////////////////////////////////////////////
+ /// Save the content of the image to a file
+ ///
+ /// \param Filename : Path of the file to save (overwritten if already exist)
+ ///
+ /// \return True if saving was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool SaveToFile(const std::string& Filename) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Create an empty image
+ ///
+ /// \param Width : Image width
+ /// \param Height : Image height
+ /// \param Col : Image color (black by default)
+ ///
+ /// \return True if creation was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Create(unsigned int Width, unsigned int Height, Color Col = Color(0, 0, 0, 255));
+
+ ////////////////////////////////////////////////////////////
+ /// Create transparency mask from a specified colorkey
+ ///
+ /// \param ColorKey : Color to become transparent
+ /// \param Alpha : Alpha value to use for transparent pixels (0 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ void CreateMaskFromColor(Color ColorKey, Uint8 Alpha = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// Copy pixels from another image onto this one.
+ /// This function does a slow pixel copy and should only
+ /// be used at initialization time
+ ///
+ /// \param Source : Source image to copy
+ /// \param DestX : X coordinate of the destination position
+ /// \param DestY : Y coordinate of the destination position
+ /// \param SourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Copy(const Image& Source, unsigned int DestX, unsigned int DestY, const IntRect& SourceRect = IntRect(0, 0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create the image from the current contents of the
+ /// given window
+ ///
+ /// \param Window : Window to capture
+ /// \param SourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
+ ///
+ /// \return True if copy was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool CopyScreen(RenderWindow& Window, const IntRect& SourceRect = IntRect(0, 0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Change the color of a pixel
+ ///
+ /// \param X : X coordinate of pixel in the image
+ /// \param Y : Y coordinate of pixel in the image
+ /// \param Col : New color for pixel (X, Y)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPixel(unsigned int X, unsigned int Y, const Color& Col);
+
+ ////////////////////////////////////////////////////////////
+ /// Get a pixel from the image
+ ///
+ /// \param X : X coordinate of pixel in the image
+ /// \param Y : Y coordinate of pixel in the image
+ ///
+ /// \return Color of pixel (X, Y)
+ ///
+ ////////////////////////////////////////////////////////////
+ const Color& GetPixel(unsigned int X, unsigned int Y) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get a read-only pointer to the array of pixels (RGBA 8 bits integers components)
+ /// Array size is GetWidth() x GetHeight() x 4
+ /// This pointer becomes invalid if you reload or resize the image
+ ///
+ /// \return Const pointer to the array of pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ const Uint8* GetPixelsPtr() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Bind the image for rendering
+ ///
+ ////////////////////////////////////////////////////////////
+ void Bind() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Enable or disable image smooth filter.
+ /// This parameter is enabled by default
+ ///
+ /// \param Smooth : True to enable smoothing filter, false to disable it
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetSmooth(bool Smooth);
+
+ ////////////////////////////////////////////////////////////
+ /// Return the width of the image
+ ///
+ /// \return Width in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetWidth() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the height of the image
+ ///
+ /// \return Height in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetHeight() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Tells whether the smooth filtering is enabled or not
+ ///
+ /// \return True if image smoothing is enabled
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsSmooth() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Convert a subrect expressed in pixels, into float
+ /// texture coordinates
+ ///
+ /// \param Rect : Sub-rectangle of image to convert
+ /// \param Adjust : Pass true to apply the half-texel adjustment
+ ///
+ /// \return Texture coordinates corresponding to the sub-rectangle
+ ///
+ ////////////////////////////////////////////////////////////
+ FloatRect GetTexCoords(const IntRect& Rect, bool Adjust = true) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get a valid texture size according to hardware support
+ ///
+ /// \param Size : Size to convert
+ ///
+ /// \return Valid nearest size (greater than or equal to specified size)
+ ///
+ ////////////////////////////////////////////////////////////
+ static unsigned int GetValidTextureSize(unsigned int Size);
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator
+ ///
+ /// \param Other : instance to assign
+ ///
+ /// \return Reference to the image
+ ///
+ ////////////////////////////////////////////////////////////
+ Image& operator =(const Image& Other);
+
+private :
+
+ friend class RenderImage;
+
+ ////////////////////////////////////////////////////////////
+ /// Create the OpenGL texture
+ ///
+ /// \return True if texture has been successfully created
+ ///
+ ////////////////////////////////////////////////////////////
+ bool CreateTexture();
+
+ ////////////////////////////////////////////////////////////
+ /// Make sure the texture in video memory is updated with the
+ /// array of pixels
+ ////////////////////////////////////////////////////////////
+ void EnsureTextureUpdate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Make sure the array of pixels is updated with the
+ /// texture in video memory
+ ////////////////////////////////////////////////////////////
+ void EnsureArrayUpdate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Reset the image attributes
+ ///
+ ////////////////////////////////////////////////////////////
+ void Reset();
+
+ ////////////////////////////////////////////////////////////
+ /// Destroy the OpenGL texture
+ ///
+ ////////////////////////////////////////////////////////////
+ void DestroyTexture();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int myWidth; ///< Image width
+ unsigned int myHeight; ///< Image Height
+ unsigned int myTextureWidth; ///< Actual texture width (can be greater than image width because of padding)
+ unsigned int myTextureHeight; ///< Actual texture height (can be greater than image height because of padding)
+ unsigned int myTexture; ///< Internal texture identifier
+ bool myIsSmooth; ///< Status of the smooth filter
+ mutable std::vector<Color> myPixels; ///< Pixels of the image
+ mutable bool myNeedTextureUpdate; ///< Status of synchronization between pixels in central memory and the internal texture un video memory
+ mutable bool myNeedArrayUpdate; ///< Status of synchronization between pixels in central memory and the internal texture un video memory
+};
+
+} // namespace sf
+
+
+#endif // SFML_IMAGE_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Matrix3.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Matrix3.hpp.svn-base
new file mode 100644
index 0000000..2d1ea74
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Matrix3.hpp.svn-base
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MATRIX3_HPP
+#define SFML_MATRIX3_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <math.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Utility class to manipulate 3x3 matrices representing
+/// 2D transformations
+////////////////////////////////////////////////////////////
+class SFML_API Matrix3
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor (builds an identity matrix)
+ ///
+ ////////////////////////////////////////////////////////////
+ Matrix3();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct a matrix from its 9 elements
+ ///
+ ////////////////////////////////////////////////////////////
+ Matrix3(float a00, float a01, float a02,
+ float a10, float a11, float a12,
+ float a20, float a21, float a22);
+
+ ////////////////////////////////////////////////////////////
+ /// Build a matrix from a set of transformations
+ ///
+ /// \param Center : Origin for the transformations
+ /// \param Translation : Translation offset
+ /// \param Rotation : Rotation angle in degrees
+ /// \param Scale : Scaling factors
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale);
+
+ ////////////////////////////////////////////////////////////
+ /// Transform a point by the matrix
+ ///
+ /// \param Point : Point to transform
+ ///
+ /// \return Transformed point
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector2f Transform(const Vector2f& Point) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the inverse of the matrix
+ ///
+ /// \return A new matrix which is the inverse of this
+ ///
+ ////////////////////////////////////////////////////////////
+ Matrix3 GetInverse() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the elements of the matrix as a 4x4,
+ /// in an array of 16 floats
+ ///
+ /// \return Pointer to the 4x4 matrix elements
+ ///
+ ////////////////////////////////////////////////////////////
+ const float* Get4x4Elements() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator () overloads to access the matrix elements
+ ///
+ /// \param Row : Element row (0 based)
+ /// \param Col : Element column (0 based)
+ ///
+ /// \return Matrix element (Row, Col)
+ ///
+ ////////////////////////////////////////////////////////////
+ float operator ()(unsigned int Row, unsigned int Col) const;
+ float& operator ()(unsigned int Row, unsigned int Col);
+
+ ////////////////////////////////////////////////////////////
+ /// Operator * overload to multiply two matrices
+ ///
+ /// \param Mat : Matrix to multiply
+ ///
+ /// \return this * Mat
+ ///
+ ////////////////////////////////////////////////////////////
+ Matrix3 operator *(const Matrix3& Mat) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator *= overload to multiply-assign two matrices
+ ///
+ /// \param Mat : Matrix to multiply
+ ///
+ /// \return this * Mat
+ ///
+ ////////////////////////////////////////////////////////////
+ Matrix3& operator *=(const Matrix3& Mat);
+
+ ////////////////////////////////////////////////////////////
+ // Static member data
+ ////////////////////////////////////////////////////////////
+ static const Matrix3 Identity; ///< Identity matrix
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ float myData[16]; /// Matrix elements (we directly store it as a 4x4 matrix for optimization purpose)
+};
+
+#include <SFML/Graphics/Matrix3.inl>
+
+} // namespace sf
+
+
+#endif // SFML_MATRIX3_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Matrix3.inl.svn-base b/include/SFML/Graphics/.svn/text-base/Matrix3.inl.svn-base
new file mode 100644
index 0000000..658157c
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Matrix3.inl.svn-base
@@ -0,0 +1,186 @@
+////////////////////////////////////////////////////////////
+//
+// SFGE - Simple and Fast Game Engine
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor (builds an identity matrix)
+////////////////////////////////////////////////////////////
+inline Matrix3::Matrix3()
+{
+ myData[0] = 1.f; myData[4] = 0.f; myData[8] = 0.f; myData[12] = 0.f;
+ myData[1] = 0.f; myData[5] = 1.f; myData[9] = 0.f; myData[13] = 0.f;
+ myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
+ myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Construct a matrix from its 9 elements
+////////////////////////////////////////////////////////////
+inline Matrix3::Matrix3(float a00, float a01, float a02,
+ float a10, float a11, float a12,
+ float a20, float a21, float a22)
+{
+ myData[0] = a00; myData[4] = a01; myData[8] = 0.f; myData[12] = a02;
+ myData[1] = a10; myData[5] = a11; myData[9] = 0.f; myData[13] = a12;
+ myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
+ myData[3] = a20; myData[7] = a21; myData[11] = 0.f; myData[15] = a22;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Build a matrix from a set of transformations
+////////////////////////////////////////////////////////////
+inline void Matrix3::SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale)
+{
+ float Angle = Rotation * 3.141592654f / 180.f;
+ float Cos = static_cast<float>(cos(Angle));
+ float Sin = static_cast<float>(sin(Angle));
+ float SxCos = Scale.x * Cos;
+ float SyCos = Scale.y * Cos;
+ float SxSin = Scale.x * Sin;
+ float SySin = Scale.y * Sin;
+ float Tx = -Center.x * SxCos - Center.y * SySin + Translation.x;
+ float Ty = Center.x * SxSin - Center.y * SyCos + Translation.y;
+
+ myData[0] = SxCos; myData[4] = SySin; myData[8] = 0.f; myData[12] = Tx;
+ myData[1] = -SxSin; myData[5] = SyCos; myData[9] = 0.f; myData[13] = Ty;
+ myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
+ myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Transform a point by the matrix
+////////////////////////////////////////////////////////////
+inline Vector2f Matrix3::Transform(const Vector2f& Point) const
+{
+ return Vector2f(myData[0] * Point.x + myData[4] * Point.y + myData[12],
+ myData[1] * Point.x + myData[5] * Point.y + myData[13]);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Return the inverse of the matrix
+////////////////////////////////////////////////////////////
+inline Matrix3 Matrix3::GetInverse() const
+{
+ // Compute the determinant
+ float Det = myData[0] * (myData[15] * myData[5] - myData[7] * myData[13]) -
+ myData[1] * (myData[15] * myData[4] - myData[7] * myData[12]) +
+ myData[3] * (myData[13] * myData[4] - myData[5] * myData[12]);
+
+ // Compute the inverse if determinant is not zero
+ if ((Det < -1E-7f) || (Det > 1E-7f))
+ {
+ return Matrix3( (myData[15] * myData[5] - myData[7] * myData[13]) / Det,
+ -(myData[15] * myData[4] - myData[7] * myData[12]) / Det,
+ (myData[13] * myData[4] - myData[5] * myData[12]) / Det,
+ -(myData[15] * myData[1] - myData[3] * myData[13]) / Det,
+ (myData[15] * myData[0] - myData[3] * myData[12]) / Det,
+ -(myData[13] * myData[0] - myData[1] * myData[12]) / Det,
+ (myData[7] * myData[1] - myData[3] * myData[5]) / Det,
+ -(myData[7] * myData[0] - myData[3] * myData[4]) / Det,
+ (myData[5] * myData[0] - myData[1] * myData[4]) / Det);
+ }
+ else
+ {
+ return Identity;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Return the elements of the matrix as a 4x4,
+/// in an array of 16 floats
+////////////////////////////////////////////////////////////
+inline const float* Matrix3::Get4x4Elements() const
+{
+ return myData;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator () overloads to access the matrix elements
+////////////////////////////////////////////////////////////
+inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const
+{
+ switch (Row + Col * 3)
+ {
+ case 0 : return myData[0];
+ case 1 : return myData[1];
+ case 2 : return myData[3];
+ case 3 : return myData[4];
+ case 4 : return myData[5];
+ case 5 : return myData[7];
+ case 6 : return myData[12];
+ case 7 : return myData[13];
+ case 8 : return myData[15];
+
+ default : return myData[0];
+ }
+}
+inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
+{
+ switch (Row + Col * 3)
+ {
+ case 0 : return myData[0];
+ case 1 : return myData[1];
+ case 2 : return myData[3];
+ case 3 : return myData[4];
+ case 4 : return myData[5];
+ case 5 : return myData[7];
+ case 6 : return myData[12];
+ case 7 : return myData[13];
+ case 8 : return myData[15];
+
+ default : return myData[0];
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload to multiply two matrices
+////////////////////////////////////////////////////////////
+inline Matrix3 Matrix3::operator *(const Matrix3& Mat) const
+{
+ return Matrix3(myData[0] * Mat.myData[0] + myData[4] * Mat.myData[1] + myData[12] * Mat.myData[3],
+ myData[0] * Mat.myData[4] + myData[4] * Mat.myData[5] + myData[12] * Mat.myData[7],
+ myData[0] * Mat.myData[12] + myData[4] * Mat.myData[13] + myData[12] * Mat.myData[15],
+ myData[1] * Mat.myData[0] + myData[5] * Mat.myData[1] + myData[13] * Mat.myData[3],
+ myData[1] * Mat.myData[4] + myData[5] * Mat.myData[5] + myData[13] * Mat.myData[7],
+ myData[1] * Mat.myData[12] + myData[5] * Mat.myData[13] + myData[13] * Mat.myData[15],
+ myData[3] * Mat.myData[0] + myData[7] * Mat.myData[1] + myData[15] * Mat.myData[3],
+ myData[3] * Mat.myData[4] + myData[7] * Mat.myData[5] + myData[15] * Mat.myData[7],
+ myData[3] * Mat.myData[12] + myData[7] * Mat.myData[13] + myData[15] * Mat.myData[15]);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator *= overload to multiply-assign two matrices
+////////////////////////////////////////////////////////////
+inline Matrix3& Matrix3::operator *=(const Matrix3& Mat)
+{
+ return *this = *this * Mat;
+}
diff --git a/include/SFML/Graphics/.svn/text-base/PostFX.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/PostFX.hpp.svn-base
new file mode 100644
index 0000000..7890a42
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/PostFX.hpp.svn-base
@@ -0,0 +1,194 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_POSTFX_HPP
+#define SFML_POSTFX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Drawable.hpp>
+#include <SFML/Graphics/Image.hpp>
+#include <istream>
+#include <map>
+#include <string>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// PostFX is used to apply a post effect to a window
+////////////////////////////////////////////////////////////
+class SFML_API PostFX : public Drawable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ PostFX();
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Instance to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ PostFX(const PostFX& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~PostFX();
+
+ ////////////////////////////////////////////////////////////
+ /// Load the effect from a file
+ ///
+ /// \param Filename : Path of the effect file to load
+ ///
+ /// \return True on success
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromFile(const std::string& Filename);
+
+ ////////////////////////////////////////////////////////////
+ /// Load the effect from a text in memory
+ ///
+ /// \param Effect : String containing the effect code
+ ///
+ /// \return True on success
+ ///
+ ////////////////////////////////////////////////////////////
+ bool LoadFromMemory(const std::string& Effect);
+
+ ////////////////////////////////////////////////////////////
+ /// Change a parameter of the effect (1 float)
+ ///
+ /// \param Name : Parameter name in the effect
+ /// \param X : Value to assign
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetParameter(const std::string& Name, float X);
+
+ ////////////////////////////////////////////////////////////
+ /// Change a parameter of the effect (2 floats)
+ ///
+ /// \param Name : Parameter name in the effect
+ /// \param X, Y : Values to assign
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetParameter(const std::string& Name, float X, float Y);
+
+ ////////////////////////////////////////////////////////////
+ /// Change a parameter of the effect (3 floats)
+ ///
+ /// \param Name : Parameter name in the effect
+ /// \param X, Y, Z : Values to assign
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetParameter(const std::string& Name, float X, float Y, float Z);
+
+ ////////////////////////////////////////////////////////////
+ /// Change a parameter of the effect (4 floats)
+ ///
+ /// \param Name : Parameter name in the effect
+ /// \param X, Y, Z, W : Values to assign
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetParameter(const std::string& Name, float X, float Y, float Z, float W);
+
+ ////////////////////////////////////////////////////////////
+ /// Set a texture parameter
+ ///
+ /// \param Name : Texture name in the effect
+ /// \param Texture : Image to set (pass NULL to use content of current framebuffer)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetTexture(const std::string& Name, Image* Texture);
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator
+ ///
+ /// \param Other : Instance to assign
+ ///
+ /// \return Reference to the post-effect
+ ///
+ ////////////////////////////////////////////////////////////
+ PostFX& operator =(const PostFX& Other);
+
+ ////////////////////////////////////////////////////////////
+ /// Tell whether or not the system supports post-effects
+ ///
+ /// \return True if the system can use post-effects
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool CanUsePostFX();
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// /see Drawable::Render
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Render(RenderTarget& Target) const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Preprocess a SFML effect file
+ /// to convert it to a valid GLSL fragment shader
+ ///
+ /// \param File : Stream containing the code to process
+ ///
+ /// \return Valid fragment shader source code
+ ///
+ ////////////////////////////////////////////////////////////
+ static std::string PreprocessEffect(std::istream& File);
+
+ ////////////////////////////////////////////////////////////
+ /// Create the program and attach the shaders
+ ///
+ ////////////////////////////////////////////////////////////
+ void CreateProgram();
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::map<std::string, const Image*> TextureTable;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int myShaderProgram; ///< OpenGL identifier for the program
+ TextureTable myTextures; ///< Texture variables in the effect
+ std::string myFragmentShader; ///< Fragment shader source code
+ mutable Image myFrameBuffer; ///< Texture containing the current frame buffer
+};
+
+} // namespace sf
+
+
+#endif // SFML_POSTFX_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Rect.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Rect.hpp.svn-base
new file mode 100644
index 0000000..b8e693d
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Rect.hpp.svn-base
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RECT_HPP
+#define SFML_RECT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <algorithm>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Rect is an utility class for manipulating rectangles.
+/// Template parameter defines the type of coordinates (integer, float, ...)
+////////////////////////////////////////////////////////////
+template <typename T>
+class Rect
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Rect();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the rectangle from its coordinates
+ ///
+ /// \param LeftCoord : Left coordinate of the rectangle
+ /// \param TopCoord : Top coordinate of the rectangle
+ /// \param RightCoord : Right coordinate of the rectangle
+ /// \param BottomCoord : Bottom coordinate of the rectangle
+ ///
+ ////////////////////////////////////////////////////////////
+ Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the width of the rectangle
+ ///
+ /// \return Width of rectangle
+ ///
+ ////////////////////////////////////////////////////////////
+ T GetWidth() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the height of the rectangle
+ ///
+ /// \return Height of rectangle
+ ///
+ ////////////////////////////////////////////////////////////
+ T GetHeight() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Move the whole rectangle by the given offset
+ ///
+ /// \param OffsetX : Horizontal offset
+ /// \param OffsetY : Vertical offset
+ ///
+ ////////////////////////////////////////////////////////////
+ void Offset(T OffsetX, T OffsetY);
+
+ ////////////////////////////////////////////////////////////
+ /// Check if a point is inside the rectangle's area
+ ///
+ /// \param X : X coordinate of the point to test
+ /// \param Y : Y coordinate of the point to test
+ ///
+ /// \return True if the point is inside
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Contains(T X, T Y) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Check intersection between two rectangles
+ ///
+ /// \param Rectangle : Rectangle to test
+ /// \param OverlappingRect : Rectangle to be filled with overlapping rect (NULL by default)
+ ///
+ /// \return True if rectangles overlap
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Intersects(const Rect<T>& Rectangle, Rect<T>* OverlappingRect = NULL) const;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ T Left; ///< Left coordinate of the rectangle
+ T Top; ///< Top coordinate of the rectangle
+ T Right; ///< Right coordinate of the rectangle
+ T Bottom; ///< Bottom coordinate of the rectangle
+};
+
+#include <SFML/Graphics/Rect.inl>
+
+// Define the most common types
+typedef Rect<int> IntRect;
+typedef Rect<float> FloatRect;
+
+} // namespace sf
+
+
+#endif // SFML_RECT_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Rect.inl.svn-base b/include/SFML/Graphics/.svn/text-base/Rect.inl.svn-base
new file mode 100644
index 0000000..8391119
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Rect.inl.svn-base
@@ -0,0 +1,122 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Rect<T>::Rect() :
+Left (0),
+Top (0),
+Right (0),
+Bottom(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Construct the color from its coordinates
+////////////////////////////////////////////////////////////
+template <typename T>
+Rect<T>::Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) :
+Left (LeftCoord),
+Top (TopCoord),
+Right (RightCoord),
+Bottom(BottomCoord)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the width of the rectangle
+////////////////////////////////////////////////////////////
+template <typename T>
+T Rect<T>::GetWidth() const
+{
+ return Right - Left;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the height of the rectangle
+////////////////////////////////////////////////////////////
+template <typename T>
+T Rect<T>::GetHeight() const
+{
+ return Bottom - Top;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Move the whole rectangle by the given offset
+////////////////////////////////////////////////////////////
+template <typename T>
+void Rect<T>::Offset(T OffsetX, T OffsetY)
+{
+ Left += OffsetX;
+ Right += OffsetX;
+ Top += OffsetY;
+ Bottom += OffsetY;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Check if a point is inside the rectangle's area
+////////////////////////////////////////////////////////////
+template <typename T>
+bool Rect<T>::Contains(T X, T Y) const
+{
+ return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Check intersection between two rectangles
+////////////////////////////////////////////////////////////
+template <typename T>
+bool Rect<T>::Intersects(const Rect<T>& Rectangle, Rect<T>* OverlappingRect) const
+{
+ // Compute overlapping rect
+ Rect Overlapping(std::max(Left, Rectangle.Left),
+ std::max(Top, Rectangle.Top),
+ std::min(Right, Rectangle.Right),
+ std::min(Bottom, Rectangle.Bottom));
+
+ // If overlapping rect is valid, then there is intersection
+ if ((Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom))
+ {
+ if (OverlappingRect)
+ *OverlappingRect = Overlapping;
+ return true;
+ }
+ else
+ {
+ if (OverlappingRect)
+ *OverlappingRect = Rect(0, 0, 0, 0);
+ return false;
+ }
+}
diff --git a/include/SFML/Graphics/.svn/text-base/RenderTarget.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/RenderTarget.hpp.svn-base
new file mode 100644
index 0000000..93131f3
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/RenderTarget.hpp.svn-base
@@ -0,0 +1,166 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RENDERTARGET_HPP
+#define SFML_RENDERTARGET_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Color.hpp>
+#include <SFML/Graphics/View.hpp>
+#include <SFML/Graphics/Rect.hpp>
+
+
+namespace sf
+{
+class Drawable;
+
+////////////////////////////////////////////////////////////
+/// Base class for all render targets (window, image, ...)
+////////////////////////////////////////////////////////////
+class SFML_API RenderTarget
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~RenderTarget();
+
+ ////////////////////////////////////////////////////////////
+ /// Clear the entire target with a single color
+ ///
+ /// \param FillColor : Color to use to clear the render target
+ ///
+ ////////////////////////////////////////////////////////////
+ void Clear(const Color& FillColor = Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Draw something into the target
+ ///
+ /// \param Object : Object to draw
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Draw(const Drawable& Object);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the width of the rendering region of the target
+ ///
+ /// \return Width in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual unsigned int GetWidth() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the height of the rendering region of the target
+ ///
+ /// \return Height in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual unsigned int GetHeight() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Change the current active view.
+ ///
+ /// \param NewView : New view to use (pass GetDefaultView() to set the default view)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetView(const View& NewView);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current view
+ ///
+ /// \return Current view active in the window
+ ///
+ ////////////////////////////////////////////////////////////
+ const View& GetView() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the default view of the window for read / write
+ ///
+ /// \return Default view
+ ///
+ ////////////////////////////////////////////////////////////
+ View& GetDefaultView();
+
+ ////////////////////////////////////////////////////////////
+ /// Tell SFML to preserve external OpenGL states, at the expense of
+ /// more CPU charge. Use this function if you don't want SFML
+ /// to mess up your own OpenGL states (if any).
+ /// Don't enable state preservation if not needed, as it will allow
+ /// SFML to do internal optimizations and improve performances.
+ /// This parameter is false by default
+ ///
+ /// \param Preserve : True to preserve OpenGL states, false to let SFML optimize
+ ///
+ ////////////////////////////////////////////////////////////
+ void PreserveOpenGLStates(bool Preserve);
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ RenderTarget();
+
+ ////////////////////////////////////////////////////////////
+ /// Called by the derived class when it's ready to be initialized
+ ///
+ ////////////////////////////////////////////////////////////
+ void Initialize();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Activate the target for rendering
+ ///
+ /// \param Active : True to activate rendering, false to deactivate
+ ///
+ /// \return True if activation succeeded
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool Activate(bool Active) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Set the OpenGL render states needed for the SFML rendering
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetRenderStates();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ View myDefaultView; ///< Default view
+ const View* myCurrentView; ///< Current active view
+ bool myPreserveStates; ///< Should we preserve external OpenGL states ?
+ bool myIsDrawing; ///< True when Draw is called from inside, to allow some renderstates optimizations
+};
+
+} // namespace sf
+
+
+#endif // SFML_RENDERTARGET_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/RenderWindow.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/RenderWindow.hpp.svn-base
new file mode 100644
index 0000000..91f78ad
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/RenderWindow.hpp.svn-base
@@ -0,0 +1,135 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RENDERWINDOW_HPP
+#define SFML_RENDERWINDOW_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Image.hpp>
+#include <SFML/Graphics/RenderTarget.hpp>
+#include <SFML/Window/Window.hpp>
+#include <string>
+
+
+namespace sf
+{
+class Drawable;
+
+////////////////////////////////////////////////////////////
+/// Simple wrapper for sf::Window that allows easy
+/// 2D rendering
+////////////////////////////////////////////////////////////
+class SFML_API RenderWindow : public Window, public RenderTarget
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ RenderWindow();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the window
+ ///
+ /// \param Mode : Video mode to use
+ /// \param Title : Title of the window
+ /// \param WindowStyle : Window style (Resize | Close by default)
+ /// \param Params : Creation parameters (see default constructor for default values)
+ ///
+ ////////////////////////////////////////////////////////////
+ RenderWindow(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the window from an existing control
+ ///
+ /// \param Handle : Platform-specific handle of the control
+ /// \param Params : Creation parameters (see default constructor for default values)
+ ///
+ ////////////////////////////////////////////////////////////
+ RenderWindow(WindowHandle Handle, const WindowSettings& Params = WindowSettings());
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~RenderWindow();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the width of the rendering region of the window
+ ///
+ /// \return Width in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual unsigned int GetWidth() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the height of the rendering region of the window
+ ///
+ /// \return Height in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual unsigned int GetHeight() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Save the content of the window to an image
+ ///
+ /// \return Image instance containing the contents of the screen
+ ///
+ ////////////////////////////////////////////////////////////
+ Image Capture() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Convert a point in window coordinates into view coordinates
+ ///
+ /// \param WindowX : X coordinate of the point to convert, relative to the window
+ /// \param WindowY : Y coordinate of the point to convert, relative to the window
+ /// \param TargetView : Target view to convert the point to (NULL by default -- uses the current view)
+ ///
+ /// \return Converted point
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f ConvertCoords(unsigned int WindowX, unsigned int WindowY, const View* TargetView = NULL) const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// /see Window::OnCreate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void OnCreate();
+
+ ////////////////////////////////////////////////////////////
+ /// /see RenderTarget::Activate
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool Activate(bool Active);
+};
+
+} // namespace sf
+
+
+#endif // SFML_RENDERWINDOW_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Shape.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Shape.hpp.svn-base
new file mode 100644
index 0000000..0db529a
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Shape.hpp.svn-base
@@ -0,0 +1,310 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SHAPE_HPP
+#define SFML_SHAPE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Drawable.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <vector>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Shape defines a drawable convex shape ; it also defines
+/// helper functions to draw simple shapes like
+/// lines, rectangles, circles, etc.
+////////////////////////////////////////////////////////////
+class SFML_API Shape : public sf::Drawable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Shape();
+
+ ////////////////////////////////////////////////////////////
+ /// Add a point to the shape
+ ///
+ /// \param X, Y : Position of the point
+ /// \param Col : Color of the point (white by default)
+ /// \param OutlineCol : Outline color of the point (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ void AddPoint(float X, float Y, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Add a point to the shape
+ ///
+ /// \param Position : Position of the point
+ /// \param Col : Color of the point (white by default)
+ /// \param OutlineCol : Outline color of the point (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ void AddPoint(const Vector2f& Position, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of points composing the shape
+ ///
+ /// \param Total number of points
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetNbPoints() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Enable or disable filling the shape.
+ /// Fill is enabled by default
+ ///
+ /// \param Enable : True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void EnableFill(bool Enable);
+
+ ////////////////////////////////////////////////////////////
+ /// Enable or disable drawing the shape outline.
+ /// Outline is enabled by default
+ ///
+ /// \param Enable : True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void EnableOutline(bool Enable);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the position of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param Position : New position of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointPosition(unsigned int Index, const Vector2f& Position);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the position of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param X : New X coordinate of the Index-th point
+ /// \param Y : New Y coordinate of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointPosition(unsigned int Index, float X, float Y);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param Col : New color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointColor(unsigned int Index, const Color& Col);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the outline color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param OutlineCol : New outline color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointOutlineColor(unsigned int Index, const Color& OutlineCol);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the width of the shape outline
+ ///
+ /// \param Width : New width
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetOutlineWidth(float Width);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the position of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ ///
+ /// \return Position of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ const Vector2f& GetPointPosition(unsigned int Index) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ ///
+ /// \return Color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ const Color& GetPointColor(unsigned int Index) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the outline color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ ///
+ /// \return Outline color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ const Color& GetPointOutlineColor(unsigned int Index) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the width of the shape outline
+ ///
+ /// \return Current outline width
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetOutlineWidth() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single line (use floats)
+ ///
+ /// \param P1X, P1Y : Position of the first point
+ /// \param P2X, P2Y : Position second point
+ /// \param Thickness : Line thickness
+ /// \param Col : Color used to draw the line
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Line(float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single line (use vectors)
+ ///
+ /// \param P1X, P1Y : Position of the first point
+ /// \param P2X, P2Y : Position second point
+ /// \param Thickness : Line thickness
+ /// \param Col : Color used to draw the line
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Line(const Vector2f& P1, const Vector2f& P2, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single rectangle (use floats)
+ ///
+ /// \param P1X, P1Y : Position of the first point
+ /// \param P2X, P2Y : Position second point
+ /// \param Col : Color used to fill the rectangle
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Rectangle(float P1X, float P1Y, float P2X, float P2Y, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single rectangle (use vectors)
+ ///
+ /// \param P1 : Position of the first point
+ /// \param P2 : Position second point
+ /// \param Col : Color used to fill the rectangle
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Rectangle(const Vector2f& P1, const Vector2f& P2, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single circle (use floats)
+ ///
+ /// \param X, Y : Position of the center
+ /// \param Radius : Radius
+ /// \param Col : Color used to fill the circle
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Circle(float X, float Y, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single circle (use vectors)
+ ///
+ /// \param Center : Position of the center
+ /// \param Radius : Radius
+ /// \param Col : Color used to fill the circle
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Circle(const Vector2f& Center, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// /see Drawable::Render
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Render(RenderTarget& Target) const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Compile the shape : compute its center and its outline
+ ///
+ ////////////////////////////////////////////////////////////
+ void Compile();
+
+ ////////////////////////////////////////////////////////////
+ /// Compute the normal of a given 2D segment
+ ///
+ /// \param P1 : First point of the segment
+ /// \param P2 : Second point of the segment
+ /// \param Normal : Calculated normal
+ ///
+ /// \return False if the normal couldn't be calculated (segment is null)
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool ComputeNormal(const Vector2f& P1, const Vector2f& P2, Vector2f& Normal);
+
+ ////////////////////////////////////////////////////////////
+ /// Defines a simple 2D point
+ ////////////////////////////////////////////////////////////
+ struct Point
+ {
+ Point(const Vector2f& Pos = Vector2f(0, 0), const Color& C = Color(255, 255, 255), const Color& OutlineC = Color(255, 255, 255));
+
+ Vector2f Position; ///< Position
+ Vector2f Normal; ///< Extruded normal
+ Color Col; ///< Color of the point
+ Color OutlineCol; ///< Outline color of the point
+ };
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::vector<Point> myPoints; ///< Points composing the shape
+ float myOutline; ///< Outline width
+ bool myIsFillEnabled; ///< Should we draw the inside if the shape ?
+ bool myIsOutlineEnabled; ///< Should we draw the outline if the shape ?
+ bool myIsCompiled; ///< Compiled state of the shape
+};
+
+} // namespace sf
+
+
+#endif // SFML_SHAPE_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/Sprite.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/Sprite.hpp.svn-base
new file mode 100644
index 0000000..c7aa348
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/Sprite.hpp.svn-base
@@ -0,0 +1,176 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SPRITE_HPP
+#define SFML_SPRITE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/Graphics/Drawable.hpp>
+#include <SFML/Graphics/Rect.hpp>
+
+
+namespace sf
+{
+class Image;
+
+////////////////////////////////////////////////////////////
+/// Sprite defines a sprite : texture, transformations,
+/// color, and draw on screen
+////////////////////////////////////////////////////////////
+class SFML_API Sprite : public Drawable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Sprite();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the sprite from a source image
+ ///
+ /// \param Img : Image of the sprite
+ /// \param Position : Position of the sprite (0, 0 by default)
+ /// \param Scale : Scale factor (1, 1 by default)
+ /// \param Rotation : Orientation, in degrees (0 by default)
+ /// \param Col : Color of the sprite (white by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Sprite(const Image& Img, const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255));
+
+ ////////////////////////////////////////////////////////////
+ /// Change the image of the sprite
+ ///
+ /// \param Img : New image
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetImage(const Image& Img);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the sub-rectangle of the sprite inside the source image.
+ /// By default, the subrect covers the entire source image
+ ///
+ /// \param SubRect : New sub-rectangle
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetSubRect(const IntRect& SubRect);
+
+ ////////////////////////////////////////////////////////////
+ /// Resize the sprite (by changing its scale factors) (take 2 values).
+ /// The default size is defined by the subrect
+ ///
+ /// \param Width : New width (must be strictly positive)
+ /// \param Height : New height (must be strictly positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Resize(float Width, float Height);
+
+ ////////////////////////////////////////////////////////////
+ /// Resize the sprite (by changing its scale factors) (take a 2D vector).
+ /// The default size is defined by the subrect
+ ///
+ /// \param Size : New size (both coordinates must be strictly positive)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Resize(const Vector2f& Size);
+
+ ////////////////////////////////////////////////////////////
+ /// Flip the sprite horizontally
+ ///
+ /// \param Flipped : True to flip the sprite
+ ///
+ ////////////////////////////////////////////////////////////
+ void FlipX(bool Flipped);
+
+ ////////////////////////////////////////////////////////////
+ /// Flip the sprite vertically
+ ///
+ /// \param Flipped : True to flip the sprite
+ ///
+ ////////////////////////////////////////////////////////////
+ void FlipY(bool Flipped);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the source image of the sprite
+ ///
+ /// \return Pointer to the image (can be NULL)
+ ///
+ ////////////////////////////////////////////////////////////
+ const Image* GetImage() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sub-rectangle of the sprite inside the source image
+ ///
+ /// \return Sub-rectangle
+ ///
+ ////////////////////////////////////////////////////////////
+ const IntRect& GetSubRect() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the sprite size
+ ///
+ /// \return Size of the sprite
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector2f GetSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the color of a given pixel in the sprite
+ /// (point is in local coordinates)
+ ///
+ /// \param X : X coordinate of the pixel to get
+ /// \param Y : Y coordinate of the pixel to get
+ ///
+ /// \return Color of pixel (X, Y)
+ ///
+ ////////////////////////////////////////////////////////////
+ Color GetPixel(unsigned int X, unsigned int Y) const;
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// /see Drawable::Render
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Render(RenderTarget& Target) const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ ResourcePtr<Image> myImage; ///< Image used to draw the sprite
+ IntRect mySubRect; ///< Sub-rectangle of source image to assign to the sprite
+ bool myIsFlippedX; ///< Is the sprite flipped on the X axis ?
+ bool myIsFlippedY; ///< Is the sprite flipped on the Y axis ?
+};
+
+} // namespace sf
+
+
+#endif // SFML_SPRITE_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/String.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/String.hpp.svn-base
new file mode 100644
index 0000000..a7f4718
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/String.hpp.svn-base
@@ -0,0 +1,191 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_STRING_HPP
+#define SFML_STRING_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/System/Unicode.hpp>
+#include <SFML/Graphics/Drawable.hpp>
+#include <SFML/Graphics/Font.hpp>
+#include <SFML/Graphics/Rect.hpp>
+#include <string>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// String defines a graphical 2D text, that can be drawn on screen
+////////////////////////////////////////////////////////////
+class SFML_API String : public Drawable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate the string drawing styles
+ ////////////////////////////////////////////////////////////
+ enum Style
+ {
+ Regular = 0, ///< Regular characters, no style
+ Bold = 1 << 0, ///< Characters are bold
+ Italic = 1 << 1, ///< Characters are in italic
+ Underlined = 1 << 2 ///< Characters are underlined
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ String();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the string from any kind of text
+ ///
+ /// \param Text : Text assigned to the string
+ /// \param Font : Font used to draw the string (SFML built-in font by default)
+ /// \param Size : Characters size (30 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ explicit String(const Unicode::Text& Text, const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the text (from any kind of string)
+ ///
+ /// \param Text : New text
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetText(const Unicode::Text& Text);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the font of the string
+ ///
+ /// \param Font : Font to use
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetFont(const Font& CharFont);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the size of the string
+ /// The default size is 30
+ ///
+ /// \param Size : New size, in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetSize(float Size);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the style of the text
+ /// The default style is Regular
+ ///
+ /// \param TextStyle : New text style, (combination of Style enum values)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetStyle(unsigned long TextStyle);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the text (the returned text can be converted implicitely to any kind of string)
+ ///
+ /// \return String's text
+ ///
+ ////////////////////////////////////////////////////////////
+ const Unicode::Text& GetText() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the font used by the string
+ ///
+ /// \return Font used
+ ///
+ ////////////////////////////////////////////////////////////
+ const Font& GetFont() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the size of the characters
+ ///
+ /// \return Size of the characters
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the style of the text
+ ///
+ /// \return Current string style (combination of Style enum values)
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned long GetStyle() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the visual position of the Index-th character of the string,
+ /// in coordinates relative to the string
+ /// (note : translation, center, rotation and scale are not applied)
+ ///
+ /// \param Index : Index of the character
+ ///
+ /// \return Position of the Index-th character (end of string if Index is out of range)
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f GetCharacterPos(std::size_t Index) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the string rectangle on screen
+ ///
+ /// \return Rectangle contaning the string in screen coordinates
+ ///
+ ////////////////////////////////////////////////////////////
+ FloatRect GetRect() const;
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// /see Drawable::Render
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Render(RenderTarget& Target) const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Recompute the bounding rectangle of the text
+ ///
+ ////////////////////////////////////////////////////////////
+ void RecomputeRect();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Unicode::Text myText; ///< Text to display
+ ResourcePtr<Font> myFont; ///< Font used to display the string
+ float mySize; ///< Size of the characters
+ unsigned long myStyle; ///< Text style (see Style enum)
+ FloatRect myBaseRect; ///< Bounding rectangle of the text in object coordinates
+ bool myNeedRectUpdate; ///< Does the bounding rect need an update ?
+};
+
+} // namespace sf
+
+
+#endif // SFML_STRING_HPP
diff --git a/include/SFML/Graphics/.svn/text-base/View.hpp.svn-base b/include/SFML/Graphics/.svn/text-base/View.hpp.svn-base
new file mode 100644
index 0000000..4ef9ef6
--- /dev/null
+++ b/include/SFML/Graphics/.svn/text-base/View.hpp.svn-base
@@ -0,0 +1,188 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_VIEW_HPP
+#define SFML_VIEW_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Graphics/Rect.hpp>
+#include <SFML/Graphics/Matrix3.hpp>
+#include <SFML/System/Vector2.hpp>
+
+
+namespace sf
+{
+class RenderTarget;
+
+////////////////////////////////////////////////////////////
+/// This class defines a view (position, size, etc.) ;
+/// you can consider it as a 2D camera
+////////////////////////////////////////////////////////////
+class SFML_API View
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the view from a rectangle
+ ///
+ /// \param ViewRect : Rectangle defining the position and size of the view (1000x1000 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ explicit View(const FloatRect& ViewRect = FloatRect(0, 0, 1000, 1000));
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the view from its center and half-size
+ ///
+ /// \param Center : Center of the view
+ /// \param HalfSize : Half-size of the view (from center to corner)
+ ///
+ ////////////////////////////////////////////////////////////
+ View(const sf::Vector2f& Center, const sf::Vector2f& HalfSize);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the center of the view (take 2 values)
+ ///
+ /// \param X : X coordinate of the new center
+ /// \param Y : Y coordinate of the new center
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetCenter(float X, float Y);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the center of the view (take a vector)
+ ///
+ /// \param Center : New center
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetCenter(const sf::Vector2f& Center);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the half-size of the view (take 2 values)
+ ///
+ /// \param HalfWidth : New half-width
+ /// \param HalfHeight : New half-height
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetHalfSize(float HalfWidth, float HalfHeight);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the half-size of the view (take a vector)
+ ///
+ /// \param HalfSize : New half-size
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetHalfSize(const sf::Vector2f& HalfSize);
+
+ ////////////////////////////////////////////////////////////
+ /// Rebuild the view from a rectangle
+ ///
+ /// \param ViewRect : Rectangle defining the position and size of the view
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetFromRect(const FloatRect& ViewRect);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the center of the view
+ ///
+ /// \return Center of the view
+ ///
+ ////////////////////////////////////////////////////////////
+ const sf::Vector2f& GetCenter() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the half-size of the view
+ ///
+ /// \return Half-size of the view
+ ///
+ ////////////////////////////////////////////////////////////
+ const sf::Vector2f& GetHalfSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the bounding rectangle of the view
+ ///
+ /// \return Bounding rectangle of the view
+ ///
+ ////////////////////////////////////////////////////////////
+ const sf::FloatRect& GetRect() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Move the view (take 2 values)
+ ///
+ /// \param OffsetX : Offset to move the view, on X axis
+ /// \param OffsetY : Offset to move the view, on Y axis
+ ///
+ ////////////////////////////////////////////////////////////
+ void Move(float OffsetX, float OffsetY);
+
+ ////////////////////////////////////////////////////////////
+ /// Move the view (take a vector)
+ ///
+ /// \param Offset : Offset to move the view
+ ///
+ ////////////////////////////////////////////////////////////
+ void Move(const sf::Vector2f& Offset);
+
+ ////////////////////////////////////////////////////////////
+ /// Resize the view rectangle to simulate a zoom / unzoom effect
+ ///
+ /// \param Factor : Zoom factor to apply, relative to the current zoom
+ ///
+ ////////////////////////////////////////////////////////////
+ void Zoom(float Factor);
+
+private :
+
+ friend class RenderTarget;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the projection matrix of the view
+ ///
+ /// \return Projection matrix containing the view settings
+ ///
+ ////////////////////////////////////////////////////////////
+ const Matrix3& GetMatrix() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Recompute the view rectangle and the projection matrix
+ ///
+ ////////////////////////////////////////////////////////////
+ void RecomputeMatrix();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f myCenter; ///< Center of the view
+ sf::Vector2f myHalfSize; ///< Half-size of the view
+ FloatRect myRect; ///< Rectangle defining the bounds of the view
+ Matrix3 myMatrix; ///< Precomputed projection matrix corresponding to the view
+ bool myNeedUpdate; ///< Internal state telling if the matrix needs to be updated
+};
+
+} // namespace sf
+
+
+#endif // SFML_VIEW_HPP
diff --git a/include/SFML/Graphics/Color.hpp b/include/SFML/Graphics/Color.hpp
index b4ca5b5..1898e4d 100755..100644
--- a/include/SFML/Graphics/Color.hpp
+++ b/include/SFML/Graphics/Color.hpp
@@ -34,7 +34,8 @@
namespace sf
{
////////////////////////////////////////////////////////////
-/// Color is an utility class for manipulating colors
+/// Color is an utility class for manipulating
+/// 32-bits RGBA colors
////////////////////////////////////////////////////////////
class SFML_API Color
{
diff --git a/include/SFML/Graphics/Drawable.hpp b/include/SFML/Graphics/Drawable.hpp
index 210b43d..3586047 100755..100644
--- a/include/SFML/Graphics/Drawable.hpp
+++ b/include/SFML/Graphics/Drawable.hpp
@@ -35,7 +35,7 @@
namespace sf
{
-class RenderWindow;
+class RenderTarget;
////////////////////////////////////////////////////////////
/// Enumerate the blending modes for drawable objects
@@ -280,6 +280,28 @@ public :
////////////////////////////////////////////////////////////
void Rotate(float Angle);
+ ////////////////////////////////////////////////////////////
+ /// Transform a point from global coordinates into local coordinates
+ /// (ie it applies the inverse of object's center, translation, rotation and scale to the point)
+ ///
+ /// \param Point : Point to transform
+ ///
+ /// \return Transformed point
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f TransformToLocal(const sf::Vector2f& Point) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Transform a point from local coordinates into global coordinates
+ /// (ie it applies the object's center, translation, rotation and scale to the point)
+ ///
+ /// \param Point : Point to transform
+ ///
+ /// \return Transformed point
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f TransformToGlobal(const sf::Vector2f& Point) const;
+
protected :
////////////////////////////////////////////////////////////
@@ -290,37 +312,47 @@ protected :
////////////////////////////////////////////////////////////
const Matrix3& GetMatrix() const;
+ ////////////////////////////////////////////////////////////
+ /// Get the inverse transform matrix of the drawable
+ ///
+ /// \return Inverse transform matrix
+ ///
+ ////////////////////////////////////////////////////////////
+ const Matrix3& GetInverseMatrix() const;
+
private :
- friend class RenderWindow;
+ friend class RenderTarget;
////////////////////////////////////////////////////////////
/// Draw the object into the specified window
///
- /// \param Window : Window into which draw the object
+ /// \param Target : Target into which render the object
///
////////////////////////////////////////////////////////////
- void Draw(const RenderWindow& Window) const;
+ void Draw(RenderTarget& Target) const;
////////////////////////////////////////////////////////////
/// Render the specific geometry of the object
///
- /// \param Window : Window into which render the object
+ /// \param Target : Target into which render the object
///
////////////////////////////////////////////////////////////
- virtual void Render(const RenderWindow& Window) const = 0;
+ virtual void Render(RenderTarget& Target) const = 0;
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- Vector2f myPosition; ///< Position of the object on screen
- Vector2f myScale; ///< Scale of the object
- Vector2f myCenter; ///< Origin of translation / rotation / scaling of the object
- float myRotation; ///< Orientation of the object, in degrees
- Color myColor; ///< Overlay color of the object
- Blend::Mode myBlendMode; ///< Blending mode
- mutable bool myNeedUpdate; ///< Do we need to recompute the transform matrix ?
- mutable Matrix3 myMatrix; ///< Precomputed transform matrix gathering the translation / rotation / scale / center
+ Vector2f myPosition; ///< Position of the object on screen
+ Vector2f myScale; ///< Scale of the object
+ Vector2f myCenter; ///< Origin of translation / rotation / scaling of the object
+ float myRotation; ///< Orientation of the object, in degrees
+ Color myColor; ///< Overlay color of the object
+ Blend::Mode myBlendMode; ///< Blending mode
+ mutable bool myNeedUpdate; ///< Do we need to recompute the transform matrix ?
+ mutable bool myInvNeedUpdate; ///< Do we need to recompute the inverse transform matrix ?
+ mutable Matrix3 myMatrix; ///< Precomputed transform matrix gathering the translation / rotation / scale / center
+ mutable Matrix3 myInvMatrix; ///< Precomputed inverse transform matrix gathering the translation / rotation / scale / center
};
} // namespace sf
diff --git a/include/SFML/Graphics/Font.hpp b/include/SFML/Graphics/Font.hpp
index 8bb3b3a..293954e 100755..100644
--- a/include/SFML/Graphics/Font.hpp
+++ b/include/SFML/Graphics/Font.hpp
@@ -28,6 +28,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/System/Vector2.hpp>
+#include <SFML/System/Unicode.hpp>
+#include <SFML/Graphics/Glyph.hpp>
#include <SFML/Graphics/Image.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <map>
@@ -47,7 +51,7 @@ class FontLoader;
/// manipulating character fonts. This class is meant to
/// be used by sf::String
////////////////////////////////////////////////////////////
-class SFML_API Font
+class SFML_API Font : public Resource<Font>
{
public :
@@ -62,12 +66,12 @@ public :
///
/// \param Filename : Font file to load
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
- /// \param Charset : Characters set to generate (empty by default - takes the ASCII range [31, 255])
+ /// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
- bool LoadFromFile(const std::string& Filename, unsigned int CharSize = 30, std::wstring Charset = L"");
+ bool LoadFromFile(const std::string& Filename, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset);
////////////////////////////////////////////////////////////
/// Load the font from a file in memory
@@ -75,12 +79,40 @@ public :
/// \param Data : Pointer to the data to load
/// \param SizeInBytes : Size of the data, in bytes
/// \param CharSize : Size of characters in bitmap - the bigger, the higher quality (30 by default)
- /// \param Charset : Characters set to generate (empty by default - takes the ASCII range [31, 255])
+ /// \param Charset : Characters set to generate (by default, contains the ISO-8859-1 printable characters)
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
- bool LoadFromMemory(const char* Data, std::size_t SizeInBytes, unsigned int CharSize = 30, std::wstring Charset = L"");
+ bool LoadFromMemory(const char* Data, std::size_t SizeInBytes, unsigned int CharSize = 30, const Unicode::Text& Charset = ourDefaultCharset);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the base size of characters in the font;
+ /// All glyphs dimensions are based on this value
+ ///
+ /// \return Base size of characters
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetCharacterSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the description of a glyph (character)
+ /// given by its unicode value
+ ///
+ /// \param CodePoint : Unicode value of the character to get
+ ///
+ /// \return Glyph's visual settings, or an invalid glyph if character not found
+ ///
+ ////////////////////////////////////////////////////////////
+ const Glyph& GetGlyph(Uint32 CodePoint) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the image containing the rendered characters (glyphs)
+ ///
+ /// \return Image containing glyphs
+ ///
+ ////////////////////////////////////////////////////////////
+ const Image& GetImage() const;
////////////////////////////////////////////////////////////
/// Get the SFML default built-in font (Arial)
@@ -92,25 +124,19 @@ public :
private :
- friend class String;
friend class priv::FontLoader;
////////////////////////////////////////////////////////////
- /// Defines the drawing attributes of a character
+ // Static member data
////////////////////////////////////////////////////////////
- struct Character
- {
- IntRect Rect; ///< Bouding rectangle in relative coordinates
- FloatRect Coord; ///< Texture coordinates inside the bitmap font
- int Advance; ///< Offset to move to the next character
- };
+ static Uint32 ourDefaultCharset[]; ///< The default charset (all printable ISO-8859-1 characters)
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- Image myTexture; ///< Texture holding the bitmap font
- unsigned int myCharSize; ///< Size of characters in the bitmap font
- std::map<wchar_t, Character> myCharacters; ///< Rendering settings of each character
+ Image myTexture; ///< Texture holding the bitmap font
+ unsigned int myCharSize; ///< Size of characters in the bitmap font
+ std::map<Uint32, Glyph> myGlyphs; ///< Rendering settings of each character (glyph)
};
} // namespace sf
diff --git a/include/SFML/Graphics/Glyph.hpp b/include/SFML/Graphics/Glyph.hpp
new file mode 100644
index 0000000..602cfef
--- /dev/null
+++ b/include/SFML/Graphics/Glyph.hpp
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_GLYPH_HPP
+#define SFML_GLYPH_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Graphics/Rect.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Structure describing a glyph (a visual character)
+////////////////////////////////////////////////////////////
+class SFML_API Glyph
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Glyph() : Advance(0) {}
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ int Advance; ///< Offset to move horizontically to the next character
+ IntRect Rectangle; ///< Bounding rectangle of the glyph, in relative coordinates
+ FloatRect TexCoords; ///< Texture coordinates of the glyph inside the bitmap font
+};
+
+} // namespace sf
+
+
+#endif // SFML_GLYPH_HPP
diff --git a/include/SFML/Graphics/Image.hpp b/include/SFML/Graphics/Image.hpp
index 200d3a7..e950ec3 100755..100644
--- a/include/SFML/Graphics/Image.hpp
+++ b/include/SFML/Graphics/Image.hpp
@@ -28,8 +28,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
#include <SFML/Graphics/Color.hpp>
-#include <SFML/Graphics/VideoResource.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <string>
#include <vector>
@@ -37,11 +37,14 @@
namespace sf
{
+class RenderImage;
+class RenderWindow;
+
////////////////////////////////////////////////////////////
/// Image is the low-level class for loading and
/// manipulating images
////////////////////////////////////////////////////////////
-class SFML_API Image : public VideoResource
+class SFML_API Image : public Resource<Image>
{
public :
@@ -150,17 +153,29 @@ public :
void CreateMaskFromColor(Color ColorKey, Uint8 Alpha = 0);
////////////////////////////////////////////////////////////
- /// Resize the image - warning : this function does not scale the image,
- /// it just adjusts its size (add padding or remove pixels)
+ /// Copy pixels from another image onto this one.
+ /// This function does a slow pixel copy and should only
+ /// be used at initialization time
///
- /// \param Width : New width
- /// \param Height : New height
- /// \param Col : Color to assign to new pixels (black by default)
+ /// \param Source : Source image to copy
+ /// \param DestX : X coordinate of the destination position
+ /// \param DestY : Y coordinate of the destination position
+ /// \param SourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)
///
- /// \return True if resize has been successful
+ ////////////////////////////////////////////////////////////
+ void Copy(const Image& Source, unsigned int DestX, unsigned int DestY, const IntRect& SourceRect = IntRect(0, 0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create the image from the current contents of the
+ /// given window
+ ///
+ /// \param Window : Window to capture
+ /// \param SourceRect : Sub-rectangle of the screen to copy (empty by default - entire image)
+ ///
+ /// \return True if copy was successful
///
////////////////////////////////////////////////////////////
- bool Resize(unsigned int Width, unsigned int Height, Color Col = Color(0, 0, 0, 255));
+ bool CopyScreen(RenderWindow& Window, const IntRect& SourceRect = IntRect(0, 0, 0, 0));
////////////////////////////////////////////////////////////
/// Change the color of a pixel
@@ -175,10 +190,10 @@ public :
////////////////////////////////////////////////////////////
/// Get a pixel from the image
///
- /// \param X : X coordinate of pixel in the image
- /// \param Y : Y coordinate of pixel in the image
+ /// \param X : X coordinate of pixel in the image
+ /// \param Y : Y coordinate of pixel in the image
///
- /// \return Color of pixel (x, y)
+ /// \return Color of pixel (X, Y)
///
////////////////////////////////////////////////////////////
const Color& GetPixel(unsigned int X, unsigned int Y) const;
@@ -266,6 +281,8 @@ public :
private :
+ friend class RenderImage;
+
////////////////////////////////////////////////////////////
/// Create the OpenGL texture
///
@@ -275,10 +292,16 @@ private :
bool CreateTexture();
////////////////////////////////////////////////////////////
- /// Update the internal texture in video memory
- ///
+ /// Make sure the texture in video memory is updated with the
+ /// array of pixels
+ ////////////////////////////////////////////////////////////
+ void EnsureTextureUpdate() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Make sure the array of pixels is updated with the
+ /// texture in video memory
////////////////////////////////////////////////////////////
- void Update();
+ void EnsureArrayUpdate() const;
////////////////////////////////////////////////////////////
/// Reset the image attributes
@@ -287,22 +310,23 @@ private :
void Reset();
////////////////////////////////////////////////////////////
- /// /see VideoResource::DestroyVideoResources
+ /// Destroy the OpenGL texture
///
////////////////////////////////////////////////////////////
- virtual void DestroyVideoResources();
+ void DestroyTexture();
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- unsigned int myWidth; ///< Image width
- unsigned int myHeight; ///< Image Height
- unsigned int myTextureWidth; ///< Actual texture width (can be greater than image width because of padding)
- unsigned int myTextureHeight; ///< Actual texture height (can be greater than image height because of padding)
- std::vector<Color> myPixels; ///< Pixels of the image
- unsigned int myTexture; ///< Internal texture identifier
- bool myIsSmooth; ///< Status if the smooth filter
- mutable bool myUpdated; ///< Tells if the internal texture needs to be updated
+ unsigned int myWidth; ///< Image width
+ unsigned int myHeight; ///< Image Height
+ unsigned int myTextureWidth; ///< Actual texture width (can be greater than image width because of padding)
+ unsigned int myTextureHeight; ///< Actual texture height (can be greater than image height because of padding)
+ unsigned int myTexture; ///< Internal texture identifier
+ bool myIsSmooth; ///< Status of the smooth filter
+ mutable std::vector<Color> myPixels; ///< Pixels of the image
+ mutable bool myNeedTextureUpdate; ///< Status of synchronization between pixels in central memory and the internal texture un video memory
+ mutable bool myNeedArrayUpdate; ///< Status of synchronization between pixels in central memory and the internal texture un video memory
};
} // namespace sf
diff --git a/include/SFML/Graphics/Matrix3.hpp b/include/SFML/Graphics/Matrix3.hpp
index 2d1ea74..2d1ea74 100755..100644
--- a/include/SFML/Graphics/Matrix3.hpp
+++ b/include/SFML/Graphics/Matrix3.hpp
diff --git a/include/SFML/Graphics/Matrix3.inl b/include/SFML/Graphics/Matrix3.inl
index 610c745..658157c 100755..100644
--- a/include/SFML/Graphics/Matrix3.inl
+++ b/include/SFML/Graphics/Matrix3.inl
@@ -44,8 +44,8 @@ inline Matrix3::Matrix3(float a00, float a01, float a02,
{
myData[0] = a00; myData[4] = a01; myData[8] = 0.f; myData[12] = a02;
myData[1] = a10; myData[5] = a11; myData[9] = 0.f; myData[13] = a12;
- myData[2] = a20; myData[6] = a21; myData[10] = 1.f; myData[14] = a22;
- myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
+ myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
+ myData[3] = a20; myData[7] = a21; myData[11] = 0.f; myData[15] = a22;
}
@@ -87,21 +87,21 @@ inline Vector2f Matrix3::Transform(const Vector2f& Point) const
inline Matrix3 Matrix3::GetInverse() const
{
// Compute the determinant
- float Det = myData[0] * (myData[14] * myData[5] - myData[6] * myData[13]) -
- myData[1] * (myData[14] * myData[4] - myData[6] * myData[12]) +
- myData[2] * (myData[13] * myData[4] - myData[5] * myData[12]);
+ float Det = myData[0] * (myData[15] * myData[5] - myData[7] * myData[13]) -
+ myData[1] * (myData[15] * myData[4] - myData[7] * myData[12]) +
+ myData[3] * (myData[13] * myData[4] - myData[5] * myData[12]);
// Compute the inverse if determinant is not zero
if ((Det < -1E-7f) || (Det > 1E-7f))
{
- return Matrix3( (myData[14] * myData[5] - myData[6] * myData[13]) / Det,
- -(myData[14] * myData[4] - myData[6] * myData[12]) / Det,
+ return Matrix3( (myData[15] * myData[5] - myData[7] * myData[13]) / Det,
+ -(myData[15] * myData[4] - myData[7] * myData[12]) / Det,
(myData[13] * myData[4] - myData[5] * myData[12]) / Det,
- -(myData[14] * myData[1] - myData[2] * myData[13]) / Det,
- (myData[14] * myData[0] - myData[2] * myData[12]) / Det,
+ -(myData[15] * myData[1] - myData[3] * myData[13]) / Det,
+ (myData[15] * myData[0] - myData[3] * myData[12]) / Det,
-(myData[13] * myData[0] - myData[1] * myData[12]) / Det,
- (myData[6] * myData[1] - myData[2] * myData[5]) / Det,
- -(myData[6] * myData[0] - myData[2] * myData[4]) / Det,
+ (myData[7] * myData[1] - myData[3] * myData[5]) / Det,
+ -(myData[7] * myData[0] - myData[3] * myData[4]) / Det,
(myData[5] * myData[0] - myData[1] * myData[4]) / Det);
}
else
@@ -126,11 +126,37 @@ inline const float* Matrix3::Get4x4Elements() const
////////////////////////////////////////////////////////////
inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const
{
- return myData[Row + (Col + Col / 2) * 4];
+ switch (Row + Col * 3)
+ {
+ case 0 : return myData[0];
+ case 1 : return myData[1];
+ case 2 : return myData[3];
+ case 3 : return myData[4];
+ case 4 : return myData[5];
+ case 5 : return myData[7];
+ case 6 : return myData[12];
+ case 7 : return myData[13];
+ case 8 : return myData[15];
+
+ default : return myData[0];
+ }
}
inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
{
- return myData[Row + (Col + Col / 2) * 4];
+ switch (Row + Col * 3)
+ {
+ case 0 : return myData[0];
+ case 1 : return myData[1];
+ case 2 : return myData[3];
+ case 3 : return myData[4];
+ case 4 : return myData[5];
+ case 5 : return myData[7];
+ case 6 : return myData[12];
+ case 7 : return myData[13];
+ case 8 : return myData[15];
+
+ default : return myData[0];
+ }
}
@@ -139,15 +165,15 @@ inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
////////////////////////////////////////////////////////////
inline Matrix3 Matrix3::operator *(const Matrix3& Mat) const
{
- return Matrix3(myData[0] * Mat.myData[0] + myData[4] * Mat.myData[1] + myData[12] * Mat.myData[2],
- myData[0] * Mat.myData[4] + myData[4] * Mat.myData[5] + myData[12] * Mat.myData[3],
- myData[0] * Mat.myData[12] + myData[4] * Mat.myData[13] + myData[12] * Mat.myData[14],
- myData[1] * Mat.myData[0] + myData[5] * Mat.myData[1] + myData[13] * Mat.myData[2],
- myData[1] * Mat.myData[4] + myData[5] * Mat.myData[5] + myData[13] * Mat.myData[3],
- myData[1] * Mat.myData[12] + myData[5] * Mat.myData[13] + myData[13] * Mat.myData[14],
- myData[2] * Mat.myData[0] + myData[6] * Mat.myData[1] + myData[14] * Mat.myData[2],
- myData[2] * Mat.myData[4] + myData[6] * Mat.myData[5] + myData[14] * Mat.myData[3],
- myData[2] * Mat.myData[12] + myData[6] * Mat.myData[13] + myData[14] * Mat.myData[14]);
+ return Matrix3(myData[0] * Mat.myData[0] + myData[4] * Mat.myData[1] + myData[12] * Mat.myData[3],
+ myData[0] * Mat.myData[4] + myData[4] * Mat.myData[5] + myData[12] * Mat.myData[7],
+ myData[0] * Mat.myData[12] + myData[4] * Mat.myData[13] + myData[12] * Mat.myData[15],
+ myData[1] * Mat.myData[0] + myData[5] * Mat.myData[1] + myData[13] * Mat.myData[3],
+ myData[1] * Mat.myData[4] + myData[5] * Mat.myData[5] + myData[13] * Mat.myData[7],
+ myData[1] * Mat.myData[12] + myData[5] * Mat.myData[13] + myData[13] * Mat.myData[15],
+ myData[3] * Mat.myData[0] + myData[7] * Mat.myData[1] + myData[15] * Mat.myData[3],
+ myData[3] * Mat.myData[4] + myData[7] * Mat.myData[5] + myData[15] * Mat.myData[7],
+ myData[3] * Mat.myData[12] + myData[7] * Mat.myData[13] + myData[15] * Mat.myData[15]);
}
diff --git a/include/SFML/Graphics/PostFX.hpp b/include/SFML/Graphics/PostFX.hpp
index 9bd254b..7890a42 100755..100644
--- a/include/SFML/Graphics/PostFX.hpp
+++ b/include/SFML/Graphics/PostFX.hpp
@@ -30,7 +30,6 @@
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Image.hpp>
-#include <SFML/Graphics/VideoResource.hpp>
#include <istream>
#include <map>
#include <string>
@@ -41,7 +40,7 @@ namespace sf
////////////////////////////////////////////////////////////
/// PostFX is used to apply a post effect to a window
////////////////////////////////////////////////////////////
-class SFML_API PostFX : public Drawable, public VideoResource
+class SFML_API PostFX : public Drawable
{
public :
@@ -151,10 +150,10 @@ public :
protected :
////////////////////////////////////////////////////////////
- /// /see sfDrawable::Render
+ /// /see Drawable::Render
///
////////////////////////////////////////////////////////////
- virtual void Render(const RenderWindow& Window) const;
+ virtual void Render(RenderTarget& Target) const;
private :
@@ -176,18 +175,17 @@ private :
void CreateProgram();
////////////////////////////////////////////////////////////
- /// /see sfVideoResource::DestroyVideoResources
- ///
+ // Types
////////////////////////////////////////////////////////////
- virtual void DestroyVideoResources();
+ typedef std::map<std::string, const Image*> TextureTable;
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- unsigned int myShaderProgram; ///< OpenGL identifier for the program
- std::map<std::string, Image*> mySamplers; ///< Sampler names and textures in the effect
- std::string myFragmentShader; ///< Fragment shader source code
- mutable Image myFrameBuffer; ///< Texture containing the current frame buffer
+ unsigned int myShaderProgram; ///< OpenGL identifier for the program
+ TextureTable myTextures; ///< Texture variables in the effect
+ std::string myFragmentShader; ///< Fragment shader source code
+ mutable Image myFrameBuffer; ///< Texture containing the current frame buffer
};
} // namespace sf
diff --git a/include/SFML/Graphics/Rect.hpp b/include/SFML/Graphics/Rect.hpp
index b8e693d..b8e693d 100755..100644
--- a/include/SFML/Graphics/Rect.hpp
+++ b/include/SFML/Graphics/Rect.hpp
diff --git a/include/SFML/Graphics/Rect.inl b/include/SFML/Graphics/Rect.inl
index 8391119..8391119 100755..100644
--- a/include/SFML/Graphics/Rect.inl
+++ b/include/SFML/Graphics/Rect.inl
diff --git a/include/SFML/Graphics/RenderTarget.hpp b/include/SFML/Graphics/RenderTarget.hpp
new file mode 100644
index 0000000..93131f3
--- /dev/null
+++ b/include/SFML/Graphics/RenderTarget.hpp
@@ -0,0 +1,166 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RENDERTARGET_HPP
+#define SFML_RENDERTARGET_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Graphics/Color.hpp>
+#include <SFML/Graphics/View.hpp>
+#include <SFML/Graphics/Rect.hpp>
+
+
+namespace sf
+{
+class Drawable;
+
+////////////////////////////////////////////////////////////
+/// Base class for all render targets (window, image, ...)
+////////////////////////////////////////////////////////////
+class SFML_API RenderTarget
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~RenderTarget();
+
+ ////////////////////////////////////////////////////////////
+ /// Clear the entire target with a single color
+ ///
+ /// \param FillColor : Color to use to clear the render target
+ ///
+ ////////////////////////////////////////////////////////////
+ void Clear(const Color& FillColor = Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Draw something into the target
+ ///
+ /// \param Object : Object to draw
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Draw(const Drawable& Object);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the width of the rendering region of the target
+ ///
+ /// \return Width in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual unsigned int GetWidth() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the height of the rendering region of the target
+ ///
+ /// \return Height in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual unsigned int GetHeight() const = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Change the current active view.
+ ///
+ /// \param NewView : New view to use (pass GetDefaultView() to set the default view)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetView(const View& NewView);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current view
+ ///
+ /// \return Current view active in the window
+ ///
+ ////////////////////////////////////////////////////////////
+ const View& GetView() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the default view of the window for read / write
+ ///
+ /// \return Default view
+ ///
+ ////////////////////////////////////////////////////////////
+ View& GetDefaultView();
+
+ ////////////////////////////////////////////////////////////
+ /// Tell SFML to preserve external OpenGL states, at the expense of
+ /// more CPU charge. Use this function if you don't want SFML
+ /// to mess up your own OpenGL states (if any).
+ /// Don't enable state preservation if not needed, as it will allow
+ /// SFML to do internal optimizations and improve performances.
+ /// This parameter is false by default
+ ///
+ /// \param Preserve : True to preserve OpenGL states, false to let SFML optimize
+ ///
+ ////////////////////////////////////////////////////////////
+ void PreserveOpenGLStates(bool Preserve);
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ RenderTarget();
+
+ ////////////////////////////////////////////////////////////
+ /// Called by the derived class when it's ready to be initialized
+ ///
+ ////////////////////////////////////////////////////////////
+ void Initialize();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Activate the target for rendering
+ ///
+ /// \param Active : True to activate rendering, false to deactivate
+ ///
+ /// \return True if activation succeeded
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual bool Activate(bool Active) = 0;
+
+ ////////////////////////////////////////////////////////////
+ /// Set the OpenGL render states needed for the SFML rendering
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetRenderStates();
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ View myDefaultView; ///< Default view
+ const View* myCurrentView; ///< Current active view
+ bool myPreserveStates; ///< Should we preserve external OpenGL states ?
+ bool myIsDrawing; ///< True when Draw is called from inside, to allow some renderstates optimizations
+};
+
+} // namespace sf
+
+
+#endif // SFML_RENDERTARGET_HPP
diff --git a/include/SFML/Graphics/RenderWindow.hpp b/include/SFML/Graphics/RenderWindow.hpp
index 1e708e5..91f78ad 100755..100644
--- a/include/SFML/Graphics/RenderWindow.hpp
+++ b/include/SFML/Graphics/RenderWindow.hpp
@@ -28,10 +28,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Image.hpp>
-#include <SFML/Graphics/View.hpp>
-#include <SFML/Graphics/Rect.hpp>
+#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Window/Window.hpp>
#include <string>
@@ -44,7 +42,7 @@ class Drawable;
/// Simple wrapper for sf::Window that allows easy
/// 2D rendering
////////////////////////////////////////////////////////////
-class SFML_API RenderWindow : public Window
+class SFML_API RenderWindow : public Window, public RenderTarget
{
public :
@@ -81,53 +79,28 @@ public :
virtual ~RenderWindow();
////////////////////////////////////////////////////////////
- /// Draw something on the window
+ /// Get the width of the rendering region of the window
///
- /// \param Object : Object to draw
+ /// \return Width in pixels
///
////////////////////////////////////////////////////////////
- void Draw(const Drawable& Object) const;
+ virtual unsigned int GetWidth() const;
////////////////////////////////////////////////////////////
- /// Save the content of the window to an image
+ /// Get the height of the rendering region of the window
///
- /// \return Image instance containing the contents of the screen
+ /// \return Height in pixels
///
////////////////////////////////////////////////////////////
- Image Capture() const;
+ virtual unsigned int GetHeight() const;
////////////////////////////////////////////////////////////
- /// Change the background color of the window.
- /// The default color is black
- ///
- /// \param Col : New background color
- ///
- ////////////////////////////////////////////////////////////
- void SetBackgroundColor(const Color& Col);
-
- ////////////////////////////////////////////////////////////
- /// Change the current active view.
- ///
- /// \param NewView : New view to use (pass GetDefaultView() to set the default view)
- ///
- ////////////////////////////////////////////////////////////
- void SetView(const View& NewView);
-
- ////////////////////////////////////////////////////////////
- /// Get the current view
- ///
- /// \return Current view active in the window
- ///
- ////////////////////////////////////////////////////////////
- const View& GetView() const;
-
- ////////////////////////////////////////////////////////////
- /// Get the default view of the window for read / write
+ /// Save the content of the window to an image
///
- /// \return Default view
+ /// \return Image instance containing the contents of the screen
///
////////////////////////////////////////////////////////////
- View& GetDefaultView();
+ Image Capture() const;
////////////////////////////////////////////////////////////
/// Convert a point in window coordinates into view coordinates
@@ -141,19 +114,6 @@ public :
////////////////////////////////////////////////////////////
sf::Vector2f ConvertCoords(unsigned int WindowX, unsigned int WindowY, const View* TargetView = NULL) const;
- ////////////////////////////////////////////////////////////
- /// Tell SFML to preserve external OpenGL states, at the expense of
- /// more CPU charge. Use this function if you don't want SFML
- /// to mess up your own OpenGL states (if any).
- /// Don't enable state preservation if not needed, as it will allow
- /// SFML to do internal optimizations and improve performances.
- /// This parameter is false by default
- ///
- /// \param Preserve : True to preserve OpenGL states, false to let SFML optimize
- ///
- ////////////////////////////////////////////////////////////
- void PreserveOpenGLStates(bool Preserve);
-
private :
////////////////////////////////////////////////////////////
@@ -163,25 +123,10 @@ private :
virtual void OnCreate();
////////////////////////////////////////////////////////////
- /// /see Window::OnDisplay
- ///
- ////////////////////////////////////////////////////////////
- virtual void OnDisplay();
-
- ////////////////////////////////////////////////////////////
- /// Set the OpenGL render states needed for the SFML rendering
+ /// /see RenderTarget::Activate
///
////////////////////////////////////////////////////////////
- void SetRenderStates() const;
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- Color myBackgroundColor; ///< Background color
- View myDefaultView; ///< Default view
- const View* myCurrentView; ///< Current active view
- bool myPreserveStates; ///< Should we preserve external OpenGL states ?
- mutable bool myIsDrawing; ///< True when Draw is called from inside, to allow some renderstates optimizations
+ virtual bool Activate(bool Active);
};
} // namespace sf
diff --git a/include/SFML/Graphics/Shape.hpp b/include/SFML/Graphics/Shape.hpp
index 17197bb..0db529a 100755..100644
--- a/include/SFML/Graphics/Shape.hpp
+++ b/include/SFML/Graphics/Shape.hpp
@@ -71,6 +71,14 @@ public :
void AddPoint(const Vector2f& Position, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
////////////////////////////////////////////////////////////
+ /// Get the number of points composing the shape
+ ///
+ /// \param Total number of points
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetNbPoints() const;
+
+ ////////////////////////////////////////////////////////////
/// Enable or disable filling the shape.
/// Fill is enabled by default
///
@@ -89,6 +97,43 @@ public :
void EnableOutline(bool Enable);
////////////////////////////////////////////////////////////
+ /// Set the position of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param Position : New position of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointPosition(unsigned int Index, const Vector2f& Position);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the position of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param X : New X coordinate of the Index-th point
+ /// \param Y : New Y coordinate of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointPosition(unsigned int Index, float X, float Y);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param Col : New color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointColor(unsigned int Index, const Color& Col);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the outline color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ /// \param OutlineCol : New outline color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPointOutlineColor(unsigned int Index, const Color& OutlineCol);
+
+ ////////////////////////////////////////////////////////////
/// Change the width of the shape outline
///
/// \param Width : New width
@@ -97,31 +142,45 @@ public :
void SetOutlineWidth(float Width);
////////////////////////////////////////////////////////////
- /// Get the number of points composing the shape
+ /// Get the position of a point
///
- /// \param Total number of points
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ ///
+ /// \return Position of the Index-th point
///
////////////////////////////////////////////////////////////
- unsigned int GetNbPoints() const;
+ const Vector2f& GetPointPosition(unsigned int Index) const;
////////////////////////////////////////////////////////////
- /// Get a point of the shape
+ /// Get the color of a point
///
- /// \param Index-th point
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ ///
+ /// \return Color of the Index-th point
///
////////////////////////////////////////////////////////////
- const Vector2f& GetPoint(unsigned int Index) const;
+ const Color& GetPointColor(unsigned int Index) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the outline color of a point
+ ///
+ /// \param Index : Index of the point, in range [0, GetNbPoints() - 1]
+ ///
+ /// \return Outline color of the Index-th point
+ ///
+ ////////////////////////////////////////////////////////////
+ const Color& GetPointOutlineColor(unsigned int Index) const;
////////////////////////////////////////////////////////////
/// Get the width of the shape outline
///
- /// \param return Current outline width
+ /// \return Current outline width
///
////////////////////////////////////////////////////////////
float GetOutlineWidth() const;
////////////////////////////////////////////////////////////
- /// Create a shape made of a single line
+ /// Create a shape made of a single line (use floats)
///
/// \param P1X, P1Y : Position of the first point
/// \param P2X, P2Y : Position second point
@@ -134,7 +193,20 @@ public :
static Shape Line(float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
- /// Create a shape made of a single rectangle
+ /// Create a shape made of a single line (use vectors)
+ ///
+ /// \param P1X, P1Y : Position of the first point
+ /// \param P2X, P2Y : Position second point
+ /// \param Thickness : Line thickness
+ /// \param Col : Color used to draw the line
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Line(const Vector2f& P1, const Vector2f& P2, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single rectangle (use floats)
///
/// \param P1X, P1Y : Position of the first point
/// \param P2X, P2Y : Position second point
@@ -146,7 +218,19 @@ public :
static Shape Rectangle(float P1X, float P1Y, float P2X, float P2Y, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
////////////////////////////////////////////////////////////
- /// Create a shape made of a single circle
+ /// Create a shape made of a single rectangle (use vectors)
+ ///
+ /// \param P1 : Position of the first point
+ /// \param P2 : Position second point
+ /// \param Col : Color used to fill the rectangle
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Rectangle(const Vector2f& P1, const Vector2f& P2, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single circle (use floats)
///
/// \param X, Y : Position of the center
/// \param Radius : Radius
@@ -157,13 +241,25 @@ public :
////////////////////////////////////////////////////////////
static Shape Circle(float X, float Y, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+ ////////////////////////////////////////////////////////////
+ /// Create a shape made of a single circle (use vectors)
+ ///
+ /// \param Center : Position of the center
+ /// \param Radius : Radius
+ /// \param Col : Color used to fill the circle
+ /// \param Outline : Outline width (0 by default)
+ /// \param OutlineCol : Color used to draw the outline (black by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ static Shape Circle(const Vector2f& Center, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
+
protected :
////////////////////////////////////////////////////////////
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
- virtual void Render(const RenderWindow& Window) const;
+ virtual void Render(RenderTarget& Target) const;
private :
diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp
index 3b00b72..c7aa348 100755..100644
--- a/include/SFML/Graphics/Sprite.hpp
+++ b/include/SFML/Graphics/Sprite.hpp
@@ -28,6 +28,7 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Rect.hpp>
@@ -140,6 +141,7 @@ public :
////////////////////////////////////////////////////////////
/// Get the color of a given pixel in the sprite
+ /// (point is in local coordinates)
///
/// \param X : X coordinate of the pixel to get
/// \param Y : Y coordinate of the pixel to get
@@ -155,17 +157,17 @@ protected :
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
- virtual void Render(const RenderWindow& Window) const;
+ virtual void Render(RenderTarget& Target) const;
private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- const Image* myImage; ///< Image used to draw the sprite
- IntRect mySubRect; ///< Sub-rectangle of source image to assign to the sprite
- bool myIsFlippedX; ///< Is the sprite flipped on the X axis ?
- bool myIsFlippedY; ///< Is the sprite flipped on the Y axis ?
+ ResourcePtr<Image> myImage; ///< Image used to draw the sprite
+ IntRect mySubRect; ///< Sub-rectangle of source image to assign to the sprite
+ bool myIsFlippedX; ///< Is the sprite flipped on the X axis ?
+ bool myIsFlippedY; ///< Is the sprite flipped on the Y axis ?
};
} // namespace sf
diff --git a/include/SFML/Graphics/String.hpp b/include/SFML/Graphics/String.hpp
index d3a1f73..a7f4718 100755..100644
--- a/include/SFML/Graphics/String.hpp
+++ b/include/SFML/Graphics/String.hpp
@@ -28,6 +28,8 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include <SFML/System/Resource.hpp>
+#include <SFML/System/Unicode.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/Rect.hpp>
@@ -55,40 +57,28 @@ public :
};
////////////////////////////////////////////////////////////
- /// Construct the string from a multibyte text
- ///
- /// \param Text : Text assigned to the string
- /// \param Font : Font used to draw the string (SFML built-in font by default)
- /// \param Size : Characters size (30 by default)
+ /// Default constructor
///
////////////////////////////////////////////////////////////
- String(const std::string& Text, const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
+ String();
////////////////////////////////////////////////////////////
- /// Construct the string from a unicode text
+ /// Construct the string from any kind of text
///
- /// \param Text : Text assigned to the string ("" by default)
+ /// \param Text : Text assigned to the string
/// \param Font : Font used to draw the string (SFML built-in font by default)
/// \param Size : Characters size (30 by default)
///
////////////////////////////////////////////////////////////
- String(const std::wstring& Text = L"", const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
-
- ////////////////////////////////////////////////////////////
- /// Set the text (from a multibyte string)
- ///
- /// \param Text : New text
- ///
- ////////////////////////////////////////////////////////////
- void SetText(const std::string& Text);
+ explicit String(const Unicode::Text& Text, const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
////////////////////////////////////////////////////////////
- /// Set the text (from a unicode string)
+ /// Set the text (from any kind of string)
///
/// \param Text : New text
///
////////////////////////////////////////////////////////////
- void SetText(const std::wstring& Text);
+ void SetText(const Unicode::Text& Text);
////////////////////////////////////////////////////////////
/// Set the font of the string
@@ -117,20 +107,12 @@ public :
void SetStyle(unsigned long TextStyle);
////////////////////////////////////////////////////////////
- /// Get the text (returns a unicode string)
+ /// Get the text (the returned text can be converted implicitely to any kind of string)
///
- /// \return Text
+ /// \return String's text
///
////////////////////////////////////////////////////////////
- const std::wstring& GetUnicodeText() const;
-
- ////////////////////////////////////////////////////////////
- /// Get the text (returns a multibyte string)
- ///
- /// \return Text
- ///
- ////////////////////////////////////////////////////////////
- std::string GetText() const;
+ const Unicode::Text& GetText() const;
////////////////////////////////////////////////////////////
/// Get the font used by the string
@@ -157,6 +139,18 @@ public :
unsigned long GetStyle() const;
////////////////////////////////////////////////////////////
+ /// Return the visual position of the Index-th character of the string,
+ /// in coordinates relative to the string
+ /// (note : translation, center, rotation and scale are not applied)
+ ///
+ /// \param Index : Index of the character
+ ///
+ /// \return Position of the Index-th character (end of string if Index is out of range)
+ ///
+ ////////////////////////////////////////////////////////////
+ sf::Vector2f GetCharacterPos(std::size_t Index) const;
+
+ ////////////////////////////////////////////////////////////
/// Get the string rectangle on screen
///
/// \return Rectangle contaning the string in screen coordinates
@@ -170,7 +164,7 @@ protected :
/// /see Drawable::Render
///
////////////////////////////////////////////////////////////
- virtual void Render(const RenderWindow& Window) const;
+ virtual void Render(RenderTarget& Target) const;
private :
@@ -183,12 +177,12 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- std::wstring myText; ///< Text to display
- const Font* myFont; ///< Font used to display the string
- float mySize; ///< Size of the characters
- unsigned long myStyle; ///< Text style (see Style enum)
- FloatRect myBaseRect; ///< Bounding rectangle of the text in object coordinates
- bool myNeedRectUpdate; ///< Does the bounding rect need an update ?
+ Unicode::Text myText; ///< Text to display
+ ResourcePtr<Font> myFont; ///< Font used to display the string
+ float mySize; ///< Size of the characters
+ unsigned long myStyle; ///< Text style (see Style enum)
+ FloatRect myBaseRect; ///< Bounding rectangle of the text in object coordinates
+ bool myNeedRectUpdate; ///< Does the bounding rect need an update ?
};
} // namespace sf
diff --git a/include/SFML/Graphics/View.hpp b/include/SFML/Graphics/View.hpp
index d3de605..4ef9ef6 100755..100644
--- a/include/SFML/Graphics/View.hpp
+++ b/include/SFML/Graphics/View.hpp
@@ -36,6 +36,8 @@
namespace sf
{
+class RenderTarget;
+
////////////////////////////////////////////////////////////
/// This class defines a view (position, size, etc.) ;
/// you can consider it as a 2D camera
@@ -154,7 +156,7 @@ public :
private :
- friend class RenderWindow;
+ friend class RenderTarget;
////////////////////////////////////////////////////////////
/// Get the projection matrix of the view
diff --git a/include/SFML/Network.hpp b/include/SFML/Network.hpp
index 970f037..fe1730a 100755..100644
--- a/include/SFML/Network.hpp
+++ b/include/SFML/Network.hpp
@@ -30,6 +30,8 @@
////////////////////////////////////////////////////////////
#include <SFML/System.hpp>
+#include <SFML/Network/Ftp.hpp>
+#include <SFML/Network/Http.hpp>
#include <SFML/Network/IPAddress.hpp>
#include <SFML/Network/Packet.hpp>
#include <SFML/Network/Selector.hpp>
diff --git a/include/SFML/Network/.svn/all-wcprops b/include/SFML/Network/.svn/all-wcprops
new file mode 100644
index 0000000..a3b2d70
--- /dev/null
+++ b/include/SFML/Network/.svn/all-wcprops
@@ -0,0 +1,71 @@
+K 25
+svn:wc:ra_dav:version-url
+V 47
+/svnroot/sfml/!svn/ver/912/include/SFML/Network
+END
+Ftp.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svnroot/sfml/!svn/ver/912/include/SFML/Network/Ftp.hpp
+END
+Selector.inl
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svnroot/sfml/!svn/ver/784/include/SFML/Network/Selector.inl
+END
+SelectorBase.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 64
+/svnroot/sfml/!svn/ver/784/include/SFML/Network/SelectorBase.hpp
+END
+Sockets.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svnroot/sfml/!svn/ver/434/include/SFML/Network/Sockets.hpp
+END
+IPAddress.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/824/include/SFML/Network/IPAddress.hpp
+END
+Http.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svnroot/sfml/!svn/ver/908/include/SFML/Network/Http.hpp
+END
+SocketTCP.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/912/include/SFML/Network/SocketTCP.hpp
+END
+Selector.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svnroot/sfml/!svn/ver/784/include/SFML/Network/Selector.hpp
+END
+SocketUDP.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/912/include/SFML/Network/SocketUDP.hpp
+END
+Packet.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/841/include/SFML/Network/Packet.hpp
+END
+SocketHelper.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 64
+/svnroot/sfml/!svn/ver/434/include/SFML/Network/SocketHelper.hpp
+END
diff --git a/include/SFML/Network/.svn/entries b/include/SFML/Network/.svn/entries
new file mode 100644
index 0000000..467cd32
--- /dev/null
+++ b/include/SFML/Network/.svn/entries
@@ -0,0 +1,408 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/Network
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-10-21T18:42:24.730017Z
+912
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+Ftp.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+52fd15b56f4a42ec1ce3e9483b8e4335
+2008-10-21T18:42:24.730017Z
+912
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+18952
+
+Selector.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+ad8bac181901e307088d0b53d11c67b2
+2008-07-30T11:21:15.772571Z
+784
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3333
+
+SelectorBase.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+95b6b60886262ae3dc1902536e3d552e
+2008-07-30T11:21:15.772571Z
+784
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4114
+
+Sockets.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+3311710d5e951810ade4f0bdde415962
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1529
+
+Win32
+dir
+
+Unix
+dir
+
+IPAddress.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+c2df44763fb02f42aa5005bdef4e4b96
+2008-08-24T15:29:46.762411Z
+824
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8429
+
+Http.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+3567980319209dc2e7a61b53a45ba0ca
+2008-10-14T18:28:57.870558Z
+908
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+14781
+
+SocketTCP.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+34e8d1cb09d3409adee1c679b3fda98f
+2008-10-21T18:42:24.730017Z
+912
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8833
+
+Selector.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+6527bb69f397be635ecd2bc22177380b
+2008-07-30T11:21:15.772571Z
+784
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4194
+
+SocketUDP.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+561c3d61bba25b28183b4fbedbfbeb48
+2008-10-21T18:42:24.730017Z
+912
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8648
+
+Packet.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+4f02358396ea606d574abd3493492554
+2008-08-30T15:01:48.265908Z
+841
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7218
+
+SocketHelper.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+12a51c3b3c68aa6daed104455a9d0d1a
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2113
+
diff --git a/include/SFML/Network/.svn/format b/include/SFML/Network/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/Network/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Network/.svn/text-base/Ftp.hpp.svn-base b/include/SFML/Network/.svn/text-base/Ftp.hpp.svn-base
new file mode 100644
index 0000000..d4bb439
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/Ftp.hpp.svn-base
@@ -0,0 +1,448 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_FTP_HPP
+#define SFML_FTP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/Network/SocketTCP.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+class IPAddress;
+
+////////////////////////////////////////////////////////////
+/// This class provides methods for manipulating the FTP
+/// protocol (described in RFC 959).
+/// It provides easy access and transfers to remote
+/// directories and files on a FTP server
+////////////////////////////////////////////////////////////
+class SFML_API Ftp : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumeration of transfer modes
+ ////////////////////////////////////////////////////////////
+ enum TransferMode
+ {
+ Binary, ///< Binary mode (file is transfered as a sequence of bytes)
+ Ascii, ///< Text mode using ASCII encoding
+ Ebcdic ///< Text mode using EBCDIC encoding
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// This class wraps a FTP response, which is basically :
+ /// - a status code
+ /// - a message
+ ////////////////////////////////////////////////////////////
+ class Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate all the valid status codes returned in
+ /// a FTP response
+ ////////////////////////////////////////////////////////////
+ enum Status
+ {
+ // 1xx: the requested action is being initiated,
+ // expect another reply before proceeding with a new command
+ RestartMarkerReply = 110, ///< Restart marker reply
+ ServiceReadySoon = 120, ///< Service ready in N minutes
+ DataConnectionAlreadyOpened = 125, ///< Data connection already opened, transfer starting
+ OpeningDataConnection = 150, ///< File status ok, about to open data connection
+
+ // 2xx: the requested action has been successfully completed
+ Ok = 200, ///< Command ok
+ PointlessCommand = 202, ///< Command not implemented
+ SystemStatus = 211, ///< System status, or system help reply
+ DirectoryStatus = 212, ///< Directory status
+ FileStatus = 213, ///< File status
+ HelpMessage = 214, ///< Help message
+ SystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document
+ ServiceReady = 220, ///< Service ready for new user
+ ClosingConnection = 221, ///< Service closing control connection
+ DataConnectionOpened = 225, ///< Data connection open, no transfer in progress
+ ClosingDataConnection = 226, ///< Closing data connection, requested file action successful
+ EnteringPassiveMode = 227, ///< Entering passive mode
+ LoggedIn = 230, ///< User logged in, proceed. Logged out if appropriate
+ FileActionOk = 250, ///< Requested file action ok
+ DirectoryOk = 257, ///< PATHNAME created
+
+ // 3xx: the command has been accepted, but the requested action
+ // is dormant, pending receipt of further information
+ NeedPassword = 331, ///< User name ok, need password
+ NeedAccountToLogIn = 332, ///< Need account for login
+ NeedInformation = 350, ///< Requested file action pending further information
+
+ // 4xx: the command was not accepted and the requested action did not take place,
+ // but the error condition is temporary and the action may be requested again
+ ServiceUnavailable = 421, ///< Service not available, closing control connection
+ DataConnectionUnavailable = 425, ///< Can't open data connection
+ TransferAborted = 426, ///< Connection closed, transfer aborted
+ FileActionAborted = 450, ///< Requested file action not taken
+ LocalError = 451, ///< Requested action aborted, local error in processing
+ InsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable
+
+ // 5xx: the command was not accepted and
+ // the requested action did not take place
+ CommandUnknown = 500, ///< Syntax error, command unrecognized
+ ParametersUnknown = 501, ///< Syntax error in parameters or arguments
+ CommandNotImplemented = 502, ///< Command not implemented
+ BadCommandSequence = 503, ///< Bad sequence of commands
+ ParameterNotImplemented = 504, ///< Command not implemented for that parameter
+ NotLoggedIn = 530, ///< Not logged in
+ NeedAccountToStore = 532, ///< Need account for storing files
+ FileUnavailable = 550, ///< Requested action not taken, file unavailable
+ PageTypeUnknown = 551, ///< Requested action aborted, page type unknown
+ NotEnoughMemory = 552, ///< Requested file action aborted, exceeded storage allocation
+ FilenameNotAllowed = 553, ///< Requested action not taken, file name not allowed
+
+ // 10xx: SFML custom codes
+ InvalidResponse = 1000, ///< Response is not a valid FTP one
+ ConnectionFailed = 1001, ///< Connection with server failed
+ ConnectionClosed = 1002, ///< Connection with server closed
+ InvalidFile = 1003 ///< Invalid file to upload / download
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Code : Response status code (InvalidResponse by default)
+ /// \param Message : Response message (empty by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Response(Status Code = InvalidResponse, const std::string& Message = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Convenience function to check if the response status code
+ /// means a success
+ ///
+ /// \return True if status is success (code < 400)
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsOk() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the response status code
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Status GetStatus() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the full message contained in the response
+ ///
+ /// \return The response message
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetMessage() const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Status myStatus; ///< Status code returned from the server
+ std::string myMessage; ///< Last message received from the server
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Specialization of FTP response returning a directory
+ ////////////////////////////////////////////////////////////
+ class DirectoryResponse : public Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Resp : Source response
+ ///
+ ////////////////////////////////////////////////////////////
+ DirectoryResponse(Response Resp);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the directory returned in the response
+ ///
+ /// \return Directory name
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetDirectory() const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::string myDirectory; ///< Directory extracted from the response message
+ };
+
+
+ ////////////////////////////////////////////////////////////
+ /// Specialization of FTP response returning a filename lisiting
+ ////////////////////////////////////////////////////////////
+ class ListingResponse : public Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Resp : Source response
+ /// \param Data : Data containing the raw listing
+ ///
+ ////////////////////////////////////////////////////////////
+ ListingResponse(Response Resp, const std::vector<char>& Data);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of filenames in the listing
+ ///
+ /// \return Total number of filenames
+ ///
+ ////////////////////////////////////////////////////////////
+ std::size_t GetCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the Index-th filename in the directory
+ ///
+ /// \param Index : Index of the filename to get
+ ///
+ /// \return Index-th filename
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetFilename(std::size_t Index) const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::vector<std::string> myFilenames; ///< Filenames extracted from the data
+ };
+
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor -- close the connection with the server
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Ftp();
+
+ ////////////////////////////////////////////////////////////
+ /// Connect to the specified FTP server
+ ///
+ /// \param Server : FTP server to connect to
+ /// \param Port : Port used for connection (21 by default, standard FTP port)
+ /// \param Timeout : Maximum time to wait, in seconds (0 by default, means no timeout)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Connect(const IPAddress& Server, unsigned short Port = 21, float Timeout = 0.f);
+
+ ////////////////////////////////////////////////////////////
+ /// Log in using anonymous account
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Login();
+
+ ////////////////////////////////////////////////////////////
+ /// Log in using a username and a password
+ ///
+ /// \param UserName : User name
+ /// \param Password : Password
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Login(const std::string& UserName, const std::string& Password);
+
+ ////////////////////////////////////////////////////////////
+ /// Close the connection with FTP server
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Disconnect();
+
+ ////////////////////////////////////////////////////////////
+ /// Send a null command just to prevent from being disconnected
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response KeepAlive();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current working directory
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ DirectoryResponse GetWorkingDirectory();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the contents of the given directory
+ /// (subdirectories and files)
+ ///
+ /// \param Directory : Directory to list ("" by default, the current one)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ ListingResponse GetDirectoryListing(const std::string& Directory = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Change the current working directory
+ ///
+ /// \param Directory : New directory, relative to the current one
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response ChangeDirectory(const std::string& Directory);
+
+ ////////////////////////////////////////////////////////////
+ /// Go to the parent directory of the current one
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response ParentDirectory();
+
+ ////////////////////////////////////////////////////////////
+ /// Create a new directory
+ ///
+ /// \param Name : Name of the directory to create
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response MakeDirectory(const std::string& Name);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove an existing directory
+ ///
+ /// \param Name : Name of the directory to remove
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response DeleteDirectory(const std::string& Name);
+
+ ////////////////////////////////////////////////////////////
+ /// Rename a file
+ ///
+ /// \param File : File to rename
+ /// \param NewName : New name
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response RenameFile(const std::string& File, const std::string& NewName);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove an existing file
+ ///
+ /// \param Name : File to remove
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response DeleteFile(const std::string& Name);
+
+ ////////////////////////////////////////////////////////////
+ /// Download a file from the server
+ ///
+ /// \param DistantFile : Path of the distant file to download
+ /// \param DestPath : Where to put to file on the local computer
+ /// \param Mode : Transfer mode (binary by default)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Download(const std::string& DistantFile, const std::string& DestPath, TransferMode Mode = Binary);
+
+ ////////////////////////////////////////////////////////////
+ /// Upload a file to the server
+ ///
+ /// \param LocalFile : Path of the local file to upload
+ /// \param DestPath : Where to put to file on the server
+ /// \param Mode : Transfer mode (binary by default)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Upload(const std::string& LocalFile, const std::string& DestPath, TransferMode Mode = Binary);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Send a command to the FTP server
+ ///
+ /// \param Command : Command to send
+ /// \param Parameter : Command parameter ("" by default)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response SendCommand(const std::string& Command, const std::string& Parameter = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Receive a response from the server
+ /// (usually after a command has been sent)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response GetResponse();
+
+ ////////////////////////////////////////////////////////////
+ /// Utility class for exchanging datas with the server
+ /// on the data channel
+ ////////////////////////////////////////////////////////////
+ class DataChannel;
+
+ friend class DataChannel;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketTCP myCommandSocket; ///< Socket holding the control connection with the server
+};
+
+} // namespace sf
+
+
+#endif // SFML_FTP_HPP
diff --git a/include/SFML/Network/.svn/text-base/Http.hpp.svn-base b/include/SFML/Network/.svn/text-base/Http.hpp.svn-base
new file mode 100644
index 0000000..3e02531
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/Http.hpp.svn-base
@@ -0,0 +1,339 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_HTTP_HPP
+#define SFML_HTTP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/Network/IPAddress.hpp>
+#include <SFML/Network/SocketTCP.hpp>
+#include <map>
+#include <string>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// This class provides methods for manipulating the HTTP
+/// protocol (described in RFC 1945).
+/// It can connect to a website, get its files, send requests, etc.
+////////////////////////////////////////////////////////////
+class SFML_API Http : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// This class wraps an HTTP request, which is basically :
+ /// - a header with a method, a target URI, and a set of field/value pairs
+ /// - an optional body (for POST requests)
+ ////////////////////////////////////////////////////////////
+ class SFML_API Request
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate the available HTTP methods for a request
+ ////////////////////////////////////////////////////////////
+ enum Method
+ {
+ Get, ///< Request in get mode, standard method to retrieve a page
+ Post, ///< Request in post mode, usually to send data to a page
+ Head ///< Request a page's header only
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param RequestMethod : Method to use for the request (Get by default)
+ /// \param URI : Target URI ("/" by default -- index page)
+ /// \param Body : Content of the request's body (empty by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Request(Method RequestMethod = Get, const std::string& URI = "/", const std::string& Body = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Set the value of a field; the field is added if it doesn't exist
+ ///
+ /// \param Field : Name of the field to set (case-insensitive)
+ /// \param Value : Value of the field
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetField(const std::string& Field, const std::string& Value);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the request method.
+ /// This parameter is Http::Request::Get by default
+ ///
+ /// \param RequestMethod : Method to use for the request
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetMethod(Method RequestMethod);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the target URI of the request.
+ /// This parameter is "/" by default
+ ///
+ /// \param URI : URI to request, local to the host
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetURI(const std::string& URI);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the HTTP version of the request.
+ /// This parameter is 1.0 by default
+ ///
+ /// \param Major : Major version number
+ /// \param Minor : Minor version number
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetHttpVersion(unsigned int Major, unsigned int Minor);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the body of the request. This parameter is optional and
+ /// makes sense only for POST requests.
+ /// This parameter is empty by default
+ ///
+ /// \param Body : Content of the request body
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetBody(const std::string& Body);
+
+ private :
+
+ friend class Http;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the string representation of the request header
+ ///
+ /// \return String containing the request
+ ///
+ ////////////////////////////////////////////////////////////
+ std::string ToString() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Check if the given field has been defined
+ ///
+ /// \param Field : Name of the field to check (case-insensitive)
+ ///
+ /// \return True if the field exists
+ ///
+ ////////////////////////////////////////////////////////////
+ bool HasField(const std::string& Field) const;
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::map<std::string, std::string> FieldTable;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FieldTable myFields; ///< Fields of the header
+ Method myMethod; ///< Method to use for the request
+ std::string myURI; ///< Target URI of the request
+ unsigned int myMajorVersion; ///< Major HTTP version
+ unsigned int myMinorVersion; ///< Minor HTTP version
+ std::string myBody; ///< Body of the request
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// This class wraps an HTTP response, which is basically :
+ /// - a header with a status code and a set of field/value pairs
+ /// - a body (the content of the requested resource)
+ ////////////////////////////////////////////////////////////
+ class SFML_API Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate all the valid status codes returned in
+ /// a HTTP response
+ ////////////////////////////////////////////////////////////
+ enum Status
+ {
+ // 2xx: success
+ Ok = 200, ///< Most common code returned when operation was successful
+ Created = 201, ///< The resource has successfully been created
+ Accepted = 202, ///< The request has been accepted, but will be processed later by the server
+ NoContent = 204, ///< Sent when the server didn't send any data in return
+
+ // 3xx: redirection
+ MultipleChoices = 300, ///< The requested page can be accessed from several locations
+ MovedPermanently = 301, ///< The requested page has permanently moved to a new location
+ MovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
+ NotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed
+
+ // 4xx: client error
+ BadRequest = 400, ///< The server couldn't understand the request (syntax error)
+ Unauthorized = 401, ///< The requested page needs an authentification to be accessed
+ Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
+ NotFound = 404, ///< The requested page doesn't exist
+
+ // 5xx: server error
+ InternalServerError = 500, ///< The server encountered an unexpected error
+ NotImplemented = 501, ///< The server doesn't implement a requested feature
+ BadGateway = 502, ///< The gateway server has received an error from the source server
+ ServiceNotAvailable = 503, ///< The server is temporarily unavailable (overloaded, in maintenance, ...)
+
+ // 10xx: SFML custom codes
+ InvalidResponse = 1000, ///< Response is not a valid HTTP one
+ ConnectionFailed = 1001 ///< Connection with server failed
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Response();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the value of a field
+ ///
+ /// \param Field : Name of the field to get (case-insensitive)
+ ///
+ /// \return Value of the field, or empty string if not found
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetField(const std::string& Field) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the header's status code
+ ///
+ /// \return Header's status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Status GetStatus() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the major HTTP version number of the response
+ ///
+ /// \return Major version number
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetMajorHttpVersion() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the major HTTP version number of the response
+ ///
+ /// \return Major version number
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetMinorHttpVersion() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the body of the response. The body can contain :
+ /// - the requested page (for GET requests)
+ /// - a response from the server (for POST requests)
+ /// - nothing (for HEAD requests)
+ /// - an error message (in case of an error)
+ ///
+ /// \return The response body
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetBody() const;
+
+ private :
+
+ friend class Http;
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the header from a response string
+ ///
+ /// \param Data : Content of the response's header to parse
+ ///
+ ////////////////////////////////////////////////////////////
+ void FromString(const std::string& Data);
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::map<std::string, std::string> FieldTable;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FieldTable myFields; ///< Fields of the header
+ Status myStatus; ///< Status code
+ unsigned int myMajorVersion; ///< Major HTTP version
+ unsigned int myMinorVersion; ///< Minor HTTP version
+ std::string myBody; ///< Body of the response
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Http();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the Http instance with the target host
+ ///
+ /// \param Host : Web server to connect to
+ /// \param Port : Port to use for connection (0 by default -- use the standard port of the protocol used)
+ ///
+ ////////////////////////////////////////////////////////////
+ Http(const std::string& Host, unsigned short Port = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the target host
+ ///
+ /// \param Host : Web server to connect to
+ /// \param Port : Port to use for connection (0 by default -- use the standard port of the protocol used)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetHost(const std::string& Host, unsigned short Port = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// Send a HTTP request and return the server's response.
+ /// You must be connected to a host before sending requests.
+ /// Any missing mandatory header field will be added with an appropriate value.
+ /// Warning : this function waits for the server's response and may
+ /// not return instantly; use a thread if you don't want to block your
+ /// application.
+ ///
+ /// \param Req : Request to send
+ ///
+ /// \return Server's response
+ ///
+ ////////////////////////////////////////////////////////////
+ Response SendRequest(const Request& Req);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketTCP myConnection; ///< Connection to the host
+ IPAddress myHost; ///< Web host address
+ std::string myHostName; ///< Web host name
+ unsigned short myPort; ///< Port used for connection with host
+};
+
+} // namespace sf
+
+
+#endif // SFML_HTTP_HPP
diff --git a/include/SFML/Network/.svn/text-base/IPAddress.hpp.svn-base b/include/SFML/Network/.svn/text-base/IPAddress.hpp.svn-base
new file mode 100644
index 0000000..8373315
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/IPAddress.hpp.svn-base
@@ -0,0 +1,229 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_IPADDRESS_HPP
+#define SFML_IPADDRESS_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <istream>
+#include <ostream>
+#include <string>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// IPAddress provides easy manipulation of IP v4 addresses
+////////////////////////////////////////////////////////////
+class SFML_API IPAddress
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor -- constructs an invalid address
+ ///
+ ////////////////////////////////////////////////////////////
+ IPAddress();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the address from a string
+ ///
+ /// \param Address : IP address ("xxx.xxx.xxx.xxx") or network name
+ ///
+ ////////////////////////////////////////////////////////////
+ IPAddress(const std::string& Address);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the address from a C-style string ;
+ /// Needed for implicit conversions from literal strings to IPAddress to work
+ ///
+ /// \param Address : IP address ("xxx.xxx.xxx.xxx") or network name
+ ///
+ ////////////////////////////////////////////////////////////
+ IPAddress(const char* Address);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the address from 4 bytes
+ ///
+ /// \param Byte0 : First byte of the address
+ /// \param Byte1 : Second byte of the address
+ /// \param Byte2 : Third byte of the address
+ /// \param Byte3 : Fourth byte of the address
+ ///
+ ////////////////////////////////////////////////////////////
+ IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the address from a 32-bits integer
+ ///
+ /// \param Address : 4 bytes of the address packed into a 32-bits integer
+ ///
+ ////////////////////////////////////////////////////////////
+ IPAddress(Uint32 Address);
+
+ ////////////////////////////////////////////////////////////
+ /// Tell if the address is a valid one
+ ///
+ /// \return True if address has a valid syntax
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsValid() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get a string representation of the address
+ ///
+ /// \return String representation of the IP address ("xxx.xxx.xxx.xxx")
+ ///
+ ////////////////////////////////////////////////////////////
+ std::string ToString() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get an integer representation of the address
+ ///
+ /// \return 32-bits integer containing the 4 bytes of the address, in system endianness
+ ///
+ ////////////////////////////////////////////////////////////
+ Uint32 ToInteger() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the computer's local IP address (from the LAN point of view)
+ ///
+ /// \return Local IP address
+ ///
+ ////////////////////////////////////////////////////////////
+ static IPAddress GetLocalAddress();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the computer's public IP address (from the web point of view).
+ /// The only way to get a public address is to ask it to a
+ /// distant website ; as a consequence, this function may be
+ /// very slow -- use it as few as possible !
+ ///
+ /// \return Public IP address
+ ///
+ ////////////////////////////////////////////////////////////
+ static IPAddress GetPublicAddress();
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator ==
+ ///
+ /// \param Other : Address to compare
+ ///
+ /// \return True if *this == Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator ==(const IPAddress& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator !=
+ ///
+ /// \param Other : Address to compare
+ ///
+ /// \return True if *this != Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator !=(const IPAddress& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator <
+ ///
+ /// \param Other : Address to compare
+ ///
+ /// \return True if *this < Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator <(const IPAddress& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator >
+ ///
+ /// \param Other : Address to compare
+ ///
+ /// \return True if *this > Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator >(const IPAddress& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator <=
+ ///
+ /// \param Other : Address to compare
+ ///
+ /// \return True if *this <= Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator <=(const IPAddress& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator >=
+ ///
+ /// \param Other : Address to compare
+ ///
+ /// \return True if *this >= Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator >=(const IPAddress& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ // Static member data
+ ////////////////////////////////////////////////////////////
+ static const IPAddress LocalHost; ///< Local host address (to connect to the same computer)
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Uint32 myAddress; ///< Address stored as an unsigned 32 bits integer
+};
+
+////////////////////////////////////////////////////////////
+/// Operator >> overload to extract an address from an input stream
+///
+/// \param Stream : Input stream
+/// \param Address : Address to extract
+///
+/// \return Reference to the input stream
+///
+////////////////////////////////////////////////////////////
+SFML_API std::istream& operator >>(std::istream& Stream, IPAddress& Address);
+
+////////////////////////////////////////////////////////////
+/// Operator << overload to print an address to an output stream
+///
+/// \param Stream : Output stream
+/// \param Address : Address to print
+///
+/// \return Reference to the output stream
+///
+////////////////////////////////////////////////////////////
+SFML_API std::ostream& operator <<(std::ostream& Stream, const IPAddress& Address);
+
+} // namespace sf
+
+
+#endif // SFML_IPADDRESS_HPP
diff --git a/include/SFML/Network/.svn/text-base/Packet.hpp.svn-base b/include/SFML/Network/.svn/text-base/Packet.hpp.svn-base
new file mode 100644
index 0000000..3add17f
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/Packet.hpp.svn-base
@@ -0,0 +1,187 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_PACKET_HPP
+#define SFML_PACKET_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Packet wraps data to send / to receive through the network
+////////////////////////////////////////////////////////////
+class SFML_API Packet
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Packet();
+
+ ////////////////////////////////////////////////////////////
+ /// Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~Packet();
+
+ ////////////////////////////////////////////////////////////
+ /// Append data to the end of the packet
+ ///
+ /// \param Data : Pointer to the bytes to append
+ /// \param SizeInBytes : Number of bytes to append
+ ///
+ ////////////////////////////////////////////////////////////
+ void Append(const void* Data, std::size_t SizeInBytes);
+
+ ////////////////////////////////////////////////////////////
+ /// Clear the packet data
+ ///
+ ////////////////////////////////////////////////////////////
+ void Clear();
+
+ ////////////////////////////////////////////////////////////
+ /// Get a pointer to the data contained in the packet
+ /// Warning : the returned pointer may be invalid after you
+ /// append data to the packet
+ ///
+ /// \return Pointer to the data
+ ///
+ ////////////////////////////////////////////////////////////
+ const char* GetData() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the size of the data contained in the packet
+ ///
+ /// \return Data size, in bytes
+ ///
+ ////////////////////////////////////////////////////////////
+ std::size_t GetDataSize() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Tell if the reading position has reached the end of the packet
+ ///
+ /// \return True if all data have been read into the packet
+ ///
+ ////////////////////////////////////////////////////////////
+ bool EndOfPacket() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the validity of packet
+ ///
+ /// \return True if last data extraction from packet was successful
+ ///
+ ////////////////////////////////////////////////////////////
+ operator bool() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator >> overloads to extract data from the packet
+ ///
+ ////////////////////////////////////////////////////////////
+ Packet& operator >>(bool& Data);
+ Packet& operator >>(Int8& Data);
+ Packet& operator >>(Uint8& Data);
+ Packet& operator >>(Int16& Data);
+ Packet& operator >>(Uint16& Data);
+ Packet& operator >>(Int32& Data);
+ Packet& operator >>(Uint32& Data);
+ Packet& operator >>(float& Data);
+ Packet& operator >>(double& Data);
+ Packet& operator >>(char* Data);
+ Packet& operator >>(std::string& Data);
+ Packet& operator >>(wchar_t* Data);
+ Packet& operator >>(std::wstring& Data);
+
+ ////////////////////////////////////////////////////////////
+ /// Operator << overloads to put data into the packet
+ ///
+ ////////////////////////////////////////////////////////////
+ Packet& operator <<(bool Data);
+ Packet& operator <<(Int8 Data);
+ Packet& operator <<(Uint8 Data);
+ Packet& operator <<(Int16 Data);
+ Packet& operator <<(Uint16 Data);
+ Packet& operator <<(Int32 Data);
+ Packet& operator <<(Uint32 Data);
+ Packet& operator <<(float Data);
+ Packet& operator <<(double Data);
+ Packet& operator <<(const char* Data);
+ Packet& operator <<(const std::string& Data);
+ Packet& operator <<(const wchar_t* Data);
+ Packet& operator <<(const std::wstring& Data);
+
+private :
+
+ friend class SocketTCP;
+ friend class SocketUDP;
+
+ ////////////////////////////////////////////////////////////
+ /// Check if the packet can extract a given size of bytes
+ ///
+ /// \param Size : Size to check
+ ///
+ /// \return True if Size bytes can be read from the packet's data
+ ///
+ ////////////////////////////////////////////////////////////
+ bool CheckSize(std::size_t Size);
+
+ ////////////////////////////////////////////////////////////
+ /// Called before the packet is sent to the network
+ ///
+ /// \param DataSize : Variable to fill with the size of data to send
+ ///
+ /// \return Pointer to the array of bytes to send
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual const char* OnSend(std::size_t& DataSize);
+
+ ////////////////////////////////////////////////////////////
+ /// Called after the packet has been received from the network
+ ///
+ /// \param Data : Pointer to the array of received bytes
+ /// \param DataSize : Size of the array of bytes
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void OnReceive(const char* Data, std::size_t DataSize);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::vector<char> myData; ///< Data stored in the packet
+ std::size_t myReadPos; ///< Current reading position in the packet
+ bool myIsValid; ///< Reading state of the packet
+};
+
+} // namespace sf
+
+
+#endif // SFML_PACKET_HPP
diff --git a/include/SFML/Network/.svn/text-base/Selector.hpp.svn-base b/include/SFML/Network/.svn/text-base/Selector.hpp.svn-base
new file mode 100644
index 0000000..3ab7dfa
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/Selector.hpp.svn-base
@@ -0,0 +1,116 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SELECTOR_HPP
+#define SFML_SELECTOR_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/SocketUDP.hpp>
+#include <SFML/Network/SocketTCP.hpp>
+#include <SFML/Network/SelectorBase.hpp>
+#include <map>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Selector allow reading from multiple sockets
+/// without blocking. It's a kind of multiplexer
+////////////////////////////////////////////////////////////
+template <typename Type>
+class Selector : private SelectorBase
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Add a socket to watch
+ ///
+ /// \param Socket : Socket to add
+ ///
+ ////////////////////////////////////////////////////////////
+ void Add(Type Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove a socket
+ ///
+ /// \param Socket : Socket to remove
+ ///
+ ////////////////////////////////////////////////////////////
+ void Remove(Type Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove all sockets
+ ///
+ ////////////////////////////////////////////////////////////
+ void Clear();
+
+ ////////////////////////////////////////////////////////////
+ /// Wait and collect sockets which are ready for reading.
+ /// This functions will return either when at least one socket
+ /// is ready, or when the given time is out
+ ///
+ /// \param Timeout : Timeout, in seconds (0 by default : no timeout)
+ ///
+ /// \return Number of sockets ready to be read
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int Wait(float Timeout = 0.f);
+
+ ////////////////////////////////////////////////////////////
+ /// After a call to Wait(), get the Index-th socket which is
+ /// ready for reading. The total number of sockets ready
+ /// is the integer returned by the previous call to Wait()
+ ///
+ /// \param Index : Index of the socket to get
+ ///
+ /// \return The Index-th socket
+ ///
+ ////////////////////////////////////////////////////////////
+ Type GetSocketReady(unsigned int Index);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::map<SocketHelper::SocketType, Type> SocketTable;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketTable mySockets; ///< Table matching the SFML socket instances with their low-level handles
+};
+
+#include <SFML/Network/Selector.inl>
+
+// Let's define the two only valid types of Selector
+typedef Selector<SocketUDP> SelectorUDP;
+typedef Selector<SocketTCP> SelectorTCP;
+
+} // namespace sf
+
+
+#endif // SFML_SELECTOR_HPP
diff --git a/include/SFML/Network/.svn/text-base/Selector.inl.svn-base b/include/SFML/Network/.svn/text-base/Selector.inl.svn-base
new file mode 100644
index 0000000..326c994
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/Selector.inl.svn-base
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Add a socket to watch
+////////////////////////////////////////////////////////////
+template <typename Type>
+void Selector<Type>::Add(Type Socket)
+{
+ if (Socket.IsValid())
+ {
+ SelectorBase::Add(Socket.mySocket);
+ mySockets[Socket.mySocket] = Socket;
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Remove a socket
+////////////////////////////////////////////////////////////
+template <typename Type>
+void Selector<Type>::Remove(Type Socket)
+{
+ typename SocketTable::iterator It = mySockets.find(Socket.mySocket);
+ if (It != mySockets.end())
+ {
+ SelectorBase::Remove(Socket.mySocket);
+ mySockets.erase(It);
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Remove all sockets
+////////////////////////////////////////////////////////////
+template <typename Type>
+void Selector<Type>::Clear()
+{
+ SelectorBase::Clear();
+ mySockets.clear();
+}
+
+
+////////////////////////////////////////////////////////////
+/// Wait and collect sockets which are ready for reading.
+/// This functions will return either when at least one socket
+/// is ready, or when the given time is out
+////////////////////////////////////////////////////////////
+template <typename Type>
+unsigned int Selector<Type>::Wait(float Timeout)
+{
+ // No socket in the selector : return 0
+ if (mySockets.empty())
+ return 0;
+
+ return SelectorBase::Wait(Timeout);
+}
+
+
+////////////////////////////////////////////////////////////
+/// After a call to Wait(), get the Index-th socket which is
+/// ready for reading. The total number of sockets ready
+/// is the integer returned by the previous call to Wait()
+////////////////////////////////////////////////////////////
+template <typename Type>
+Type Selector<Type>::GetSocketReady(unsigned int Index)
+{
+ SocketHelper::SocketType Socket = SelectorBase::GetSocketReady(Index);
+
+ typename SocketTable::const_iterator It = mySockets.find(Socket);
+ if (It != mySockets.end())
+ return It->second;
+ else
+ return Type(Socket);
+}
diff --git a/include/SFML/Network/.svn/text-base/SelectorBase.hpp.svn-base b/include/SFML/Network/.svn/text-base/SelectorBase.hpp.svn-base
new file mode 100644
index 0000000..433e789
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/SelectorBase.hpp.svn-base
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SELECTORBASE_HPP
+#define SFML_SELECTORBASE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/Network/SocketHelper.hpp>
+#include <map>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Private base class for selectors.
+/// As Selector is a template class, this base is needed so that
+/// every system call get compiled in SFML (not inlined)
+////////////////////////////////////////////////////////////
+class SFML_API SelectorBase
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SelectorBase();
+
+ ////////////////////////////////////////////////////////////
+ /// Add a socket to watch
+ ///
+ /// \param Socket : Socket to add
+ ///
+ ////////////////////////////////////////////////////////////
+ void Add(SocketHelper::SocketType Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove a socket
+ ///
+ /// \param Socket : Socket to remove
+ ///
+ ////////////////////////////////////////////////////////////
+ void Remove(SocketHelper::SocketType Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove all sockets
+ ///
+ ////////////////////////////////////////////////////////////
+ void Clear();
+
+ ////////////////////////////////////////////////////////////
+ /// Wait and collect sockets which are ready for reading.
+ /// This functions will return either when at least one socket
+ /// is ready, or when the given time is out
+ ///
+ /// \param Timeout : Timeout, in seconds (0 by default : no timeout)
+ ///
+ /// \return Number of sockets ready to be read
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int Wait(float Timeout = 0.f);
+
+ ////////////////////////////////////////////////////////////
+ /// After a call to Wait(), get the Index-th socket which is
+ /// ready for reading. The total number of sockets ready
+ /// is the integer returned by the previous call to Wait()
+ ///
+ /// \param Index : Index of the socket to get
+ ///
+ /// \return The Index-th socket
+ ///
+ ////////////////////////////////////////////////////////////
+ SocketHelper::SocketType GetSocketReady(unsigned int Index);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ fd_set mySet; ///< Set of socket to watch
+ fd_set mySetReady; ///< Set of socket which are ready for reading
+ int myMaxSocket; ///< Maximum socket index
+};
+
+} // namespace sf
+
+
+#endif // SFML_SELECTORBASE_HPP
diff --git a/include/SFML/Network/.svn/text-base/SocketHelper.hpp.svn-base b/include/SFML/Network/.svn/text-base/SocketHelper.hpp.svn-base
new file mode 100644
index 0000000..36126db
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/SocketHelper.hpp.svn-base
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETHELPER_HPP
+#define SFML_SOCKETHELPER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+namespace Socket
+{
+ ////////////////////////////////////////////////////////////
+ /// Enumeration of status returned by socket functions
+ ////////////////////////////////////////////////////////////
+ enum Status
+ {
+ Done, ///< The socket has sent / received the data
+ NotReady, ///< The socket is not ready to send / receive data yet
+ Disconnected, ///< The TCP socket has been disconnected
+ Error ///< An unexpected error happened
+ };
+}
+
+} // namespace sf
+
+
+#ifdef SFML_SYSTEM_WINDOWS
+
+ #include <SFML/Network/Win32/SocketHelper.hpp>
+
+#else
+
+ #include <SFML/Network/Unix/SocketHelper.hpp>
+
+#endif
+
+
+#endif // SFML_SOCKETHELPER_HPP
diff --git a/include/SFML/Network/.svn/text-base/SocketTCP.hpp.svn-base b/include/SFML/Network/.svn/text-base/SocketTCP.hpp.svn-base
new file mode 100644
index 0000000..452b304
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/SocketTCP.hpp.svn-base
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETTCP_HPP
+#define SFML_SOCKETTCP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/SocketHelper.hpp>
+#include <vector>
+
+
+namespace sf
+{
+class Packet;
+class IPAddress;
+template <typename> class Selector;
+
+////////////////////////////////////////////////////////////
+/// SocketTCP wraps a socket using TCP protocol to
+/// send data safely (but a bit slower)
+////////////////////////////////////////////////////////////
+class SFML_API SocketTCP
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SocketTCP();
+
+ ////////////////////////////////////////////////////////////
+ /// Change the blocking state of the socket.
+ /// The default behaviour of a socket is blocking
+ ///
+ /// \param Blocking : Pass true to set the socket as blocking, or false for non-blocking
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetBlocking(bool Blocking);
+
+ ////////////////////////////////////////////////////////////
+ /// Connect to another computer on a specified port
+ ///
+ /// \param Port : Port to use for transfers (warning : ports < 1024 are reserved)
+ /// \param HostAddress : IP Address of the host to connect to
+ /// \param Timeout : Maximum time to wait, in seconds (0 by default : no timeout) (this parameter is ignored for non-blocking sockets)
+ ///
+ /// \return True if operation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Connect(unsigned short Port, const IPAddress& HostAddress, float Timeout = 0.f);
+
+ ////////////////////////////////////////////////////////////
+ /// Listen to a specified port for incoming data or connections
+ ///
+ /// \param Port : Port to listen to
+ ///
+ /// \return True if operation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Listen(unsigned short Port);
+
+ ////////////////////////////////////////////////////////////
+ /// Wait for a connection (must be listening to a port).
+ /// This function will block if the socket is blocking
+ ///
+ /// \param Connected : Socket containing the connection with the connected client
+ /// \param Address : Pointer to an address to fill with client infos (NULL by default)
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Accept(SocketTCP& Connected, IPAddress* Address = NULL);
+
+ ////////////////////////////////////////////////////////////
+ /// Send an array of bytes to the host (must be connected first)
+ ///
+ /// \param Data : Pointer to the bytes to send
+ /// \param Size : Number of bytes to send
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Send(const char* Data, std::size_t Size);
+
+ ////////////////////////////////////////////////////////////
+ /// Receive an array of bytes from the host (must be connected first).
+ /// This function will block if the socket is blocking
+ ///
+ /// \param Data : Pointer to a byte array to fill (make sure it is big enough)
+ /// \param MaxSize : Maximum number of bytes to read
+ /// \param SizeReceived : Number of bytes received
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived);
+
+ ////////////////////////////////////////////////////////////
+ /// Send a packet of data to the host (must be connected first)
+ ///
+ /// \param PacketToSend : Packet to send
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Send(Packet& PacketToSend);
+
+ ////////////////////////////////////////////////////////////
+ /// Receive a packet from the host (must be connected first).
+ /// This function will block if the socket is blocking
+ ///
+ /// \param PacketToReceive : Packet to fill with received data
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Receive(Packet& PacketToReceive);
+
+ ////////////////////////////////////////////////////////////
+ /// Close the socket
+ ///
+ /// \return True if operation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Close();
+
+ ////////////////////////////////////////////////////////////
+ /// Check if the socket is in a valid state ; this function
+ /// can be called any time to check if the socket is OK
+ ///
+ /// \return True if the socket is valid
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsValid() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator ==
+ ///
+ /// \param Other : Socket to compare
+ ///
+ /// \return True if *this == Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator ==(const SocketTCP& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator !=
+ ///
+ /// \param Other : Socket to compare
+ ///
+ /// \return True if *this != Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator !=(const SocketTCP& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator <.
+ /// Provided for compatibility with standard containers, as
+ /// comparing two sockets doesn't make much sense...
+ ///
+ /// \param Other : Socket to compare
+ ///
+ /// \return True if *this < Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator <(const SocketTCP& Other) const;
+
+private :
+
+ friend class Selector<SocketTCP>;
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the socket from a socket descriptor
+ /// (for internal use only)
+ ///
+ /// \param Descriptor : Socket descriptor
+ ///
+ ////////////////////////////////////////////////////////////
+ SocketTCP(SocketHelper::SocketType Descriptor);
+
+ ////////////////////////////////////////////////////////////
+ /// Create the socket
+ ///
+ /// \param Descriptor : System socket descriptor to use (0 by default -- create a new socket)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Create(SocketHelper::SocketType Descriptor = 0);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketHelper::SocketType mySocket; ///< Socket descriptor
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
+ Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETTCP_HPP
diff --git a/include/SFML/Network/.svn/text-base/SocketUDP.hpp.svn-base b/include/SFML/Network/.svn/text-base/SocketUDP.hpp.svn-base
new file mode 100644
index 0000000..ba43762
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/SocketUDP.hpp.svn-base
@@ -0,0 +1,224 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETUDP_HPP
+#define SFML_SOCKETUDP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Network/SocketHelper.hpp>
+#include <vector>
+
+
+namespace sf
+{
+class Packet;
+class IPAddress;
+template <typename> class Selector;
+
+////////////////////////////////////////////////////////////
+/// SocketUDP wraps a socket using UDP protocol to
+/// send data fastly (but with less safety)
+////////////////////////////////////////////////////////////
+class SFML_API SocketUDP
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ SocketUDP();
+
+ ////////////////////////////////////////////////////////////
+ /// Change the blocking state of the socket.
+ /// The default behaviour of a socket is blocking
+ ///
+ /// \param Blocking : Pass true to set the socket as blocking, or false for non-blocking
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetBlocking(bool Blocking);
+
+ ////////////////////////////////////////////////////////////
+ /// Bind the socket to a specific port
+ ///
+ /// \param Port : Port to bind the socket to
+ ///
+ /// \return True if operation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Bind(unsigned short Port);
+
+ ////////////////////////////////////////////////////////////
+ /// Unbind the socket from its previous port, if any
+ ///
+ /// \return True if operation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Unbind();
+
+ ////////////////////////////////////////////////////////////
+ /// Send an array of bytes
+ ///
+ /// \param Data : Pointer to the bytes to send
+ /// \param Size : Number of bytes to send
+ /// \param Address : Address of the computer to send the packet to
+ /// \param Port : Port to send the data to
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Send(const char* Data, std::size_t Size, const IPAddress& Address, unsigned short Port);
+
+ ////////////////////////////////////////////////////////////
+ /// Receive an array of bytes.
+ /// This function will block if the socket is blocking
+ ///
+ /// \param Data : Pointer to a byte array to fill (make sure it is big enough)
+ /// \param MaxSize : Maximum number of bytes to read
+ /// \param SizeReceived : Number of bytes received
+ /// \param Address : Address of the computer which sent the data
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived, IPAddress& Address);
+
+ ////////////////////////////////////////////////////////////
+ /// Send a packet of data
+ ///
+ /// \param PacketToSend : Packet to send
+ /// \param Address : Address of the computer to send the packet to
+ /// \param Port : Port to send the data to
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Send(Packet& PacketToSend, const IPAddress& Address, unsigned short Port);
+
+ ////////////////////////////////////////////////////////////
+ /// Receive a packet.
+ /// This function will block if the socket is blocking
+ ///
+ /// \param PacketToReceive : Packet to fill with received data
+ /// \param Address : Address of the computer which sent the packet
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Socket::Status Receive(Packet& PacketToReceive, IPAddress& Address);
+
+ ////////////////////////////////////////////////////////////
+ /// Close the socket
+ ///
+ /// \return True if operation has been successful
+ ///
+ ////////////////////////////////////////////////////////////
+ bool Close();
+
+ ////////////////////////////////////////////////////////////
+ /// Check if the socket is in a valid state ; this function
+ /// can be called any time to check if the socket is OK
+ ///
+ /// \return True if the socket is valid
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsValid() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the port the socket is currently bound to
+ ///
+ /// \return Current port (0 means the socket is not bound)
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned short GetPort() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator ==
+ ///
+ /// \param Other : Socket to compare
+ ///
+ /// \return True if *this == Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator ==(const SocketUDP& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator !=
+ ///
+ /// \param Other : Socket to compare
+ ///
+ /// \return True if *this != Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator !=(const SocketUDP& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator <.
+ /// Provided for compatibility with standard containers, as
+ /// comparing two sockets doesn't make much sense...
+ ///
+ /// \param Other : Socket to compare
+ ///
+ /// \return True if *this < Other
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator <(const SocketUDP& Other) const;
+
+private :
+
+ friend class Selector<SocketUDP>;
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the socket from a socket descriptor
+ /// (for internal use only)
+ ///
+ /// \param Descriptor : Socket descriptor
+ ///
+ ////////////////////////////////////////////////////////////
+ SocketUDP(SocketHelper::SocketType Descriptor);
+
+ ////////////////////////////////////////////////////////////
+ /// Create the socket
+ ///
+ /// \param Descriptor : System socket descriptor to use (0 by default -- create a new socket)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Create(SocketHelper::SocketType Descriptor = 0);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketHelper::SocketType mySocket; ///< Socket identifier
+ unsigned short myPort; ///< Port to which the socket is bound
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
+ Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETUDP_HPP
diff --git a/include/SFML/Network/.svn/text-base/Sockets.hpp.svn-base b/include/SFML/Network/.svn/text-base/Sockets.hpp.svn-base
new file mode 100644
index 0000000..b611e85
--- /dev/null
+++ b/include/SFML/Network/.svn/text-base/Sockets.hpp.svn-base
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETS_HPP
+#define SFML_SOCKETS_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+#ifdef SFML_SYSTEM_WINDOWS
+
+ #include <SFML/Network/Win32/Sockets.hpp>
+
+#else
+
+ #include <SFML/Network/Unix/Sockets.hpp>
+
+#endif
+
+
+#endif // SFML_SOCKETS_HPP
diff --git a/include/SFML/Network/Ftp.hpp b/include/SFML/Network/Ftp.hpp
new file mode 100644
index 0000000..d4bb439
--- /dev/null
+++ b/include/SFML/Network/Ftp.hpp
@@ -0,0 +1,448 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_FTP_HPP
+#define SFML_FTP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/Network/SocketTCP.hpp>
+#include <string>
+#include <vector>
+
+
+namespace sf
+{
+class IPAddress;
+
+////////////////////////////////////////////////////////////
+/// This class provides methods for manipulating the FTP
+/// protocol (described in RFC 959).
+/// It provides easy access and transfers to remote
+/// directories and files on a FTP server
+////////////////////////////////////////////////////////////
+class SFML_API Ftp : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumeration of transfer modes
+ ////////////////////////////////////////////////////////////
+ enum TransferMode
+ {
+ Binary, ///< Binary mode (file is transfered as a sequence of bytes)
+ Ascii, ///< Text mode using ASCII encoding
+ Ebcdic ///< Text mode using EBCDIC encoding
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// This class wraps a FTP response, which is basically :
+ /// - a status code
+ /// - a message
+ ////////////////////////////////////////////////////////////
+ class Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate all the valid status codes returned in
+ /// a FTP response
+ ////////////////////////////////////////////////////////////
+ enum Status
+ {
+ // 1xx: the requested action is being initiated,
+ // expect another reply before proceeding with a new command
+ RestartMarkerReply = 110, ///< Restart marker reply
+ ServiceReadySoon = 120, ///< Service ready in N minutes
+ DataConnectionAlreadyOpened = 125, ///< Data connection already opened, transfer starting
+ OpeningDataConnection = 150, ///< File status ok, about to open data connection
+
+ // 2xx: the requested action has been successfully completed
+ Ok = 200, ///< Command ok
+ PointlessCommand = 202, ///< Command not implemented
+ SystemStatus = 211, ///< System status, or system help reply
+ DirectoryStatus = 212, ///< Directory status
+ FileStatus = 213, ///< File status
+ HelpMessage = 214, ///< Help message
+ SystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document
+ ServiceReady = 220, ///< Service ready for new user
+ ClosingConnection = 221, ///< Service closing control connection
+ DataConnectionOpened = 225, ///< Data connection open, no transfer in progress
+ ClosingDataConnection = 226, ///< Closing data connection, requested file action successful
+ EnteringPassiveMode = 227, ///< Entering passive mode
+ LoggedIn = 230, ///< User logged in, proceed. Logged out if appropriate
+ FileActionOk = 250, ///< Requested file action ok
+ DirectoryOk = 257, ///< PATHNAME created
+
+ // 3xx: the command has been accepted, but the requested action
+ // is dormant, pending receipt of further information
+ NeedPassword = 331, ///< User name ok, need password
+ NeedAccountToLogIn = 332, ///< Need account for login
+ NeedInformation = 350, ///< Requested file action pending further information
+
+ // 4xx: the command was not accepted and the requested action did not take place,
+ // but the error condition is temporary and the action may be requested again
+ ServiceUnavailable = 421, ///< Service not available, closing control connection
+ DataConnectionUnavailable = 425, ///< Can't open data connection
+ TransferAborted = 426, ///< Connection closed, transfer aborted
+ FileActionAborted = 450, ///< Requested file action not taken
+ LocalError = 451, ///< Requested action aborted, local error in processing
+ InsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable
+
+ // 5xx: the command was not accepted and
+ // the requested action did not take place
+ CommandUnknown = 500, ///< Syntax error, command unrecognized
+ ParametersUnknown = 501, ///< Syntax error in parameters or arguments
+ CommandNotImplemented = 502, ///< Command not implemented
+ BadCommandSequence = 503, ///< Bad sequence of commands
+ ParameterNotImplemented = 504, ///< Command not implemented for that parameter
+ NotLoggedIn = 530, ///< Not logged in
+ NeedAccountToStore = 532, ///< Need account for storing files
+ FileUnavailable = 550, ///< Requested action not taken, file unavailable
+ PageTypeUnknown = 551, ///< Requested action aborted, page type unknown
+ NotEnoughMemory = 552, ///< Requested file action aborted, exceeded storage allocation
+ FilenameNotAllowed = 553, ///< Requested action not taken, file name not allowed
+
+ // 10xx: SFML custom codes
+ InvalidResponse = 1000, ///< Response is not a valid FTP one
+ ConnectionFailed = 1001, ///< Connection with server failed
+ ConnectionClosed = 1002, ///< Connection with server closed
+ InvalidFile = 1003 ///< Invalid file to upload / download
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Code : Response status code (InvalidResponse by default)
+ /// \param Message : Response message (empty by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Response(Status Code = InvalidResponse, const std::string& Message = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Convenience function to check if the response status code
+ /// means a success
+ ///
+ /// \return True if status is success (code < 400)
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsOk() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the response status code
+ ///
+ /// \return Status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Status GetStatus() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the full message contained in the response
+ ///
+ /// \return The response message
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetMessage() const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Status myStatus; ///< Status code returned from the server
+ std::string myMessage; ///< Last message received from the server
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Specialization of FTP response returning a directory
+ ////////////////////////////////////////////////////////////
+ class DirectoryResponse : public Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Resp : Source response
+ ///
+ ////////////////////////////////////////////////////////////
+ DirectoryResponse(Response Resp);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the directory returned in the response
+ ///
+ /// \return Directory name
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetDirectory() const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::string myDirectory; ///< Directory extracted from the response message
+ };
+
+
+ ////////////////////////////////////////////////////////////
+ /// Specialization of FTP response returning a filename lisiting
+ ////////////////////////////////////////////////////////////
+ class ListingResponse : public Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Resp : Source response
+ /// \param Data : Data containing the raw listing
+ ///
+ ////////////////////////////////////////////////////////////
+ ListingResponse(Response Resp, const std::vector<char>& Data);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of filenames in the listing
+ ///
+ /// \return Total number of filenames
+ ///
+ ////////////////////////////////////////////////////////////
+ std::size_t GetCount() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the Index-th filename in the directory
+ ///
+ /// \param Index : Index of the filename to get
+ ///
+ /// \return Index-th filename
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetFilename(std::size_t Index) const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ std::vector<std::string> myFilenames; ///< Filenames extracted from the data
+ };
+
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor -- close the connection with the server
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Ftp();
+
+ ////////////////////////////////////////////////////////////
+ /// Connect to the specified FTP server
+ ///
+ /// \param Server : FTP server to connect to
+ /// \param Port : Port used for connection (21 by default, standard FTP port)
+ /// \param Timeout : Maximum time to wait, in seconds (0 by default, means no timeout)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Connect(const IPAddress& Server, unsigned short Port = 21, float Timeout = 0.f);
+
+ ////////////////////////////////////////////////////////////
+ /// Log in using anonymous account
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Login();
+
+ ////////////////////////////////////////////////////////////
+ /// Log in using a username and a password
+ ///
+ /// \param UserName : User name
+ /// \param Password : Password
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Login(const std::string& UserName, const std::string& Password);
+
+ ////////////////////////////////////////////////////////////
+ /// Close the connection with FTP server
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Disconnect();
+
+ ////////////////////////////////////////////////////////////
+ /// Send a null command just to prevent from being disconnected
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response KeepAlive();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current working directory
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ DirectoryResponse GetWorkingDirectory();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the contents of the given directory
+ /// (subdirectories and files)
+ ///
+ /// \param Directory : Directory to list ("" by default, the current one)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ ListingResponse GetDirectoryListing(const std::string& Directory = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Change the current working directory
+ ///
+ /// \param Directory : New directory, relative to the current one
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response ChangeDirectory(const std::string& Directory);
+
+ ////////////////////////////////////////////////////////////
+ /// Go to the parent directory of the current one
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response ParentDirectory();
+
+ ////////////////////////////////////////////////////////////
+ /// Create a new directory
+ ///
+ /// \param Name : Name of the directory to create
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response MakeDirectory(const std::string& Name);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove an existing directory
+ ///
+ /// \param Name : Name of the directory to remove
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response DeleteDirectory(const std::string& Name);
+
+ ////////////////////////////////////////////////////////////
+ /// Rename a file
+ ///
+ /// \param File : File to rename
+ /// \param NewName : New name
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response RenameFile(const std::string& File, const std::string& NewName);
+
+ ////////////////////////////////////////////////////////////
+ /// Remove an existing file
+ ///
+ /// \param Name : File to remove
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response DeleteFile(const std::string& Name);
+
+ ////////////////////////////////////////////////////////////
+ /// Download a file from the server
+ ///
+ /// \param DistantFile : Path of the distant file to download
+ /// \param DestPath : Where to put to file on the local computer
+ /// \param Mode : Transfer mode (binary by default)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Download(const std::string& DistantFile, const std::string& DestPath, TransferMode Mode = Binary);
+
+ ////////////////////////////////////////////////////////////
+ /// Upload a file to the server
+ ///
+ /// \param LocalFile : Path of the local file to upload
+ /// \param DestPath : Where to put to file on the server
+ /// \param Mode : Transfer mode (binary by default)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response Upload(const std::string& LocalFile, const std::string& DestPath, TransferMode Mode = Binary);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Send a command to the FTP server
+ ///
+ /// \param Command : Command to send
+ /// \param Parameter : Command parameter ("" by default)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response SendCommand(const std::string& Command, const std::string& Parameter = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Receive a response from the server
+ /// (usually after a command has been sent)
+ ///
+ /// \return Server response to the request
+ ///
+ ////////////////////////////////////////////////////////////
+ Response GetResponse();
+
+ ////////////////////////////////////////////////////////////
+ /// Utility class for exchanging datas with the server
+ /// on the data channel
+ ////////////////////////////////////////////////////////////
+ class DataChannel;
+
+ friend class DataChannel;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketTCP myCommandSocket; ///< Socket holding the control connection with the server
+};
+
+} // namespace sf
+
+
+#endif // SFML_FTP_HPP
diff --git a/include/SFML/Network/Http.hpp b/include/SFML/Network/Http.hpp
new file mode 100644
index 0000000..3e02531
--- /dev/null
+++ b/include/SFML/Network/Http.hpp
@@ -0,0 +1,339 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_HTTP_HPP
+#define SFML_HTTP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/Network/IPAddress.hpp>
+#include <SFML/Network/SocketTCP.hpp>
+#include <map>
+#include <string>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// This class provides methods for manipulating the HTTP
+/// protocol (described in RFC 1945).
+/// It can connect to a website, get its files, send requests, etc.
+////////////////////////////////////////////////////////////
+class SFML_API Http : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// This class wraps an HTTP request, which is basically :
+ /// - a header with a method, a target URI, and a set of field/value pairs
+ /// - an optional body (for POST requests)
+ ////////////////////////////////////////////////////////////
+ class SFML_API Request
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate the available HTTP methods for a request
+ ////////////////////////////////////////////////////////////
+ enum Method
+ {
+ Get, ///< Request in get mode, standard method to retrieve a page
+ Post, ///< Request in post mode, usually to send data to a page
+ Head ///< Request a page's header only
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param RequestMethod : Method to use for the request (Get by default)
+ /// \param URI : Target URI ("/" by default -- index page)
+ /// \param Body : Content of the request's body (empty by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Request(Method RequestMethod = Get, const std::string& URI = "/", const std::string& Body = "");
+
+ ////////////////////////////////////////////////////////////
+ /// Set the value of a field; the field is added if it doesn't exist
+ ///
+ /// \param Field : Name of the field to set (case-insensitive)
+ /// \param Value : Value of the field
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetField(const std::string& Field, const std::string& Value);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the request method.
+ /// This parameter is Http::Request::Get by default
+ ///
+ /// \param RequestMethod : Method to use for the request
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetMethod(Method RequestMethod);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the target URI of the request.
+ /// This parameter is "/" by default
+ ///
+ /// \param URI : URI to request, local to the host
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetURI(const std::string& URI);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the HTTP version of the request.
+ /// This parameter is 1.0 by default
+ ///
+ /// \param Major : Major version number
+ /// \param Minor : Minor version number
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetHttpVersion(unsigned int Major, unsigned int Minor);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the body of the request. This parameter is optional and
+ /// makes sense only for POST requests.
+ /// This parameter is empty by default
+ ///
+ /// \param Body : Content of the request body
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetBody(const std::string& Body);
+
+ private :
+
+ friend class Http;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the string representation of the request header
+ ///
+ /// \return String containing the request
+ ///
+ ////////////////////////////////////////////////////////////
+ std::string ToString() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Check if the given field has been defined
+ ///
+ /// \param Field : Name of the field to check (case-insensitive)
+ ///
+ /// \return True if the field exists
+ ///
+ ////////////////////////////////////////////////////////////
+ bool HasField(const std::string& Field) const;
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::map<std::string, std::string> FieldTable;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FieldTable myFields; ///< Fields of the header
+ Method myMethod; ///< Method to use for the request
+ std::string myURI; ///< Target URI of the request
+ unsigned int myMajorVersion; ///< Major HTTP version
+ unsigned int myMinorVersion; ///< Minor HTTP version
+ std::string myBody; ///< Body of the request
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// This class wraps an HTTP response, which is basically :
+ /// - a header with a status code and a set of field/value pairs
+ /// - a body (the content of the requested resource)
+ ////////////////////////////////////////////////////////////
+ class SFML_API Response
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Enumerate all the valid status codes returned in
+ /// a HTTP response
+ ////////////////////////////////////////////////////////////
+ enum Status
+ {
+ // 2xx: success
+ Ok = 200, ///< Most common code returned when operation was successful
+ Created = 201, ///< The resource has successfully been created
+ Accepted = 202, ///< The request has been accepted, but will be processed later by the server
+ NoContent = 204, ///< Sent when the server didn't send any data in return
+
+ // 3xx: redirection
+ MultipleChoices = 300, ///< The requested page can be accessed from several locations
+ MovedPermanently = 301, ///< The requested page has permanently moved to a new location
+ MovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
+ NotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed
+
+ // 4xx: client error
+ BadRequest = 400, ///< The server couldn't understand the request (syntax error)
+ Unauthorized = 401, ///< The requested page needs an authentification to be accessed
+ Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
+ NotFound = 404, ///< The requested page doesn't exist
+
+ // 5xx: server error
+ InternalServerError = 500, ///< The server encountered an unexpected error
+ NotImplemented = 501, ///< The server doesn't implement a requested feature
+ BadGateway = 502, ///< The gateway server has received an error from the source server
+ ServiceNotAvailable = 503, ///< The server is temporarily unavailable (overloaded, in maintenance, ...)
+
+ // 10xx: SFML custom codes
+ InvalidResponse = 1000, ///< Response is not a valid HTTP one
+ ConnectionFailed = 1001 ///< Connection with server failed
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Response();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the value of a field
+ ///
+ /// \param Field : Name of the field to get (case-insensitive)
+ ///
+ /// \return Value of the field, or empty string if not found
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetField(const std::string& Field) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the header's status code
+ ///
+ /// \return Header's status code
+ ///
+ ////////////////////////////////////////////////////////////
+ Status GetStatus() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the major HTTP version number of the response
+ ///
+ /// \return Major version number
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetMajorHttpVersion() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the major HTTP version number of the response
+ ///
+ /// \return Major version number
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetMinorHttpVersion() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the body of the response. The body can contain :
+ /// - the requested page (for GET requests)
+ /// - a response from the server (for POST requests)
+ /// - nothing (for HEAD requests)
+ /// - an error message (in case of an error)
+ ///
+ /// \return The response body
+ ///
+ ////////////////////////////////////////////////////////////
+ const std::string& GetBody() const;
+
+ private :
+
+ friend class Http;
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the header from a response string
+ ///
+ /// \param Data : Content of the response's header to parse
+ ///
+ ////////////////////////////////////////////////////////////
+ void FromString(const std::string& Data);
+
+ ////////////////////////////////////////////////////////////
+ // Types
+ ////////////////////////////////////////////////////////////
+ typedef std::map<std::string, std::string> FieldTable;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ FieldTable myFields; ///< Fields of the header
+ Status myStatus; ///< Status code
+ unsigned int myMajorVersion; ///< Major HTTP version
+ unsigned int myMinorVersion; ///< Minor HTTP version
+ std::string myBody; ///< Body of the response
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Http();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the Http instance with the target host
+ ///
+ /// \param Host : Web server to connect to
+ /// \param Port : Port to use for connection (0 by default -- use the standard port of the protocol used)
+ ///
+ ////////////////////////////////////////////////////////////
+ Http(const std::string& Host, unsigned short Port = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// Set the target host
+ ///
+ /// \param Host : Web server to connect to
+ /// \param Port : Port to use for connection (0 by default -- use the standard port of the protocol used)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetHost(const std::string& Host, unsigned short Port = 0);
+
+ ////////////////////////////////////////////////////////////
+ /// Send a HTTP request and return the server's response.
+ /// You must be connected to a host before sending requests.
+ /// Any missing mandatory header field will be added with an appropriate value.
+ /// Warning : this function waits for the server's response and may
+ /// not return instantly; use a thread if you don't want to block your
+ /// application.
+ ///
+ /// \param Req : Request to send
+ ///
+ /// \return Server's response
+ ///
+ ////////////////////////////////////////////////////////////
+ Response SendRequest(const Request& Req);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ SocketTCP myConnection; ///< Connection to the host
+ IPAddress myHost; ///< Web host address
+ std::string myHostName; ///< Web host name
+ unsigned short myPort; ///< Port used for connection with host
+};
+
+} // namespace sf
+
+
+#endif // SFML_HTTP_HPP
diff --git a/include/SFML/Network/IPAddress.hpp b/include/SFML/Network/IPAddress.hpp
index 5721623..8373315 100755..100644
--- a/include/SFML/Network/IPAddress.hpp
+++ b/include/SFML/Network/IPAddress.hpp
@@ -78,6 +78,14 @@ public :
IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3);
////////////////////////////////////////////////////////////
+ /// Construct the address from a 32-bits integer
+ ///
+ /// \param Address : 4 bytes of the address packed into a 32-bits integer
+ ///
+ ////////////////////////////////////////////////////////////
+ IPAddress(Uint32 Address);
+
+ ////////////////////////////////////////////////////////////
/// Tell if the address is a valid one
///
/// \return True if address has a valid syntax
@@ -94,6 +102,14 @@ public :
std::string ToString() const;
////////////////////////////////////////////////////////////
+ /// Get an integer representation of the address
+ ///
+ /// \return 32-bits integer containing the 4 bytes of the address, in system endianness
+ ///
+ ////////////////////////////////////////////////////////////
+ Uint32 ToInteger() const;
+
+ ////////////////////////////////////////////////////////////
/// Get the computer's local IP address (from the LAN point of view)
///
/// \return Local IP address
diff --git a/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp
index 738dfce..3add17f 100755..100644
--- a/include/SFML/Network/Packet.hpp
+++ b/include/SFML/Network/Packet.hpp
@@ -85,12 +85,20 @@ public :
/// \return Data size, in bytes
///
////////////////////////////////////////////////////////////
- Uint32 GetDataSize() const;
+ std::size_t GetDataSize() const;
////////////////////////////////////////////////////////////
- /// Tell if the packet is valid for reading
+ /// Tell if the reading position has reached the end of the packet
///
- /// \return True if data can be extracted from the packet
+ /// \return True if all data have been read into the packet
+ ///
+ ////////////////////////////////////////////////////////////
+ bool EndOfPacket() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the validity of packet
+ ///
+ /// \return True if last data extraction from packet was successful
///
////////////////////////////////////////////////////////////
operator bool() const;
@@ -99,6 +107,7 @@ public :
/// Operator >> overloads to extract data from the packet
///
////////////////////////////////////////////////////////////
+ Packet& operator >>(bool& Data);
Packet& operator >>(Int8& Data);
Packet& operator >>(Uint8& Data);
Packet& operator >>(Int16& Data);
@@ -116,6 +125,7 @@ public :
/// Operator << overloads to put data into the packet
///
////////////////////////////////////////////////////////////
+ Packet& operator <<(bool Data);
Packet& operator <<(Int8 Data);
Packet& operator <<(Uint8 Data);
Packet& operator <<(Int16 Data);
@@ -147,14 +157,21 @@ private :
////////////////////////////////////////////////////////////
/// Called before the packet is sent to the network
///
+ /// \param DataSize : Variable to fill with the size of data to send
+ ///
+ /// \return Pointer to the array of bytes to send
+ ///
////////////////////////////////////////////////////////////
- virtual void OnSend();
+ virtual const char* OnSend(std::size_t& DataSize);
////////////////////////////////////////////////////////////
/// Called after the packet has been received from the network
///
+ /// \param Data : Pointer to the array of received bytes
+ /// \param DataSize : Size of the array of bytes
+ ///
////////////////////////////////////////////////////////////
- virtual void OnReceive();
+ virtual void OnReceive(const char* Data, std::size_t DataSize);
////////////////////////////////////////////////////////////
// Member data
diff --git a/include/SFML/Network/Selector.hpp b/include/SFML/Network/Selector.hpp
index 7d1c320..3ab7dfa 100755..100644
--- a/include/SFML/Network/Selector.hpp
+++ b/include/SFML/Network/Selector.hpp
@@ -89,7 +89,7 @@ public :
/// \return The Index-th socket
///
////////////////////////////////////////////////////////////
- Type GetSocketReady(unsigned int Index) const;
+ Type GetSocketReady(unsigned int Index);
private :
diff --git a/include/SFML/Network/Selector.inl b/include/SFML/Network/Selector.inl
index 9eacb6f..326c994 100755..100644
--- a/include/SFML/Network/Selector.inl
+++ b/include/SFML/Network/Selector.inl
@@ -85,7 +85,7 @@ unsigned int Selector<Type>::Wait(float Timeout)
/// is the integer returned by the previous call to Wait()
////////////////////////////////////////////////////////////
template <typename Type>
-Type Selector<Type>::GetSocketReady(unsigned int Index) const
+Type Selector<Type>::GetSocketReady(unsigned int Index)
{
SocketHelper::SocketType Socket = SelectorBase::GetSocketReady(Index);
diff --git a/include/SFML/Network/SelectorBase.hpp b/include/SFML/Network/SelectorBase.hpp
index 103c103..433e789 100755..100644
--- a/include/SFML/Network/SelectorBase.hpp
+++ b/include/SFML/Network/SelectorBase.hpp
@@ -94,7 +94,7 @@ public :
/// \return The Index-th socket
///
////////////////////////////////////////////////////////////
- SocketHelper::SocketType GetSocketReady(unsigned int Index) const;
+ SocketHelper::SocketType GetSocketReady(unsigned int Index);
private :
diff --git a/include/SFML/Network/SocketHelper.hpp b/include/SFML/Network/SocketHelper.hpp
index 36126db..36126db 100755..100644
--- a/include/SFML/Network/SocketHelper.hpp
+++ b/include/SFML/Network/SocketHelper.hpp
diff --git a/include/SFML/Network/SocketTCP.hpp b/include/SFML/Network/SocketTCP.hpp
index 06bcf9e..452b304 100755..100644
--- a/include/SFML/Network/SocketTCP.hpp
+++ b/include/SFML/Network/SocketTCP.hpp
@@ -29,12 +29,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Network/SocketHelper.hpp>
-#include <SFML/Network/Packet.hpp>
-#include <cstddef>
+#include <vector>
namespace sf
{
+class Packet;
class IPAddress;
template <typename> class Selector;
@@ -66,11 +66,12 @@ public :
///
/// \param Port : Port to use for transfers (warning : ports < 1024 are reserved)
/// \param HostAddress : IP Address of the host to connect to
+ /// \param Timeout : Maximum time to wait, in seconds (0 by default : no timeout) (this parameter is ignored for non-blocking sockets)
///
/// \return True if operation has been successful
///
////////////////////////////////////////////////////////////
- bool Connect(unsigned short Port, const IPAddress& HostAddress);
+ Socket::Status Connect(unsigned short Port, const IPAddress& HostAddress, float Timeout = 0.f);
////////////////////////////////////////////////////////////
/// Listen to a specified port for incoming data or connections
@@ -204,15 +205,18 @@ private :
////////////////////////////////////////////////////////////
/// Create the socket
///
+ /// \param Descriptor : System socket descriptor to use (0 by default -- create a new socket)
+ ///
////////////////////////////////////////////////////////////
- void Create();
+ void Create(SocketHelper::SocketType Descriptor = 0);
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
SocketHelper::SocketType mySocket; ///< Socket descriptor
- sf::Packet myPendingPacket; ///< Current pending packet, if any (in non-blocking mode)
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
};
} // namespace sf
diff --git a/include/SFML/Network/SocketUDP.hpp b/include/SFML/Network/SocketUDP.hpp
index 62229b4..ba43762 100755..100644
--- a/include/SFML/Network/SocketUDP.hpp
+++ b/include/SFML/Network/SocketUDP.hpp
@@ -29,12 +29,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Network/SocketHelper.hpp>
-#include <SFML/Network/Packet.hpp>
-#include <cstddef>
+#include <vector>
namespace sf
{
+class Packet;
class IPAddress;
template <typename> class Selector;
@@ -203,16 +203,19 @@ private :
////////////////////////////////////////////////////////////
/// Create the socket
///
+ /// \param Descriptor : System socket descriptor to use (0 by default -- create a new socket)
+ ///
////////////////////////////////////////////////////////////
- void Create();
+ void Create(SocketHelper::SocketType Descriptor = 0);
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
SocketHelper::SocketType mySocket; ///< Socket identifier
unsigned short myPort; ///< Port to which the socket is bound
- sf::Packet myPendingPacket; ///< Current pending packet, if any (in non-blocking mode)
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
};
} // namespace sf
diff --git a/include/SFML/Network/Sockets.hpp b/include/SFML/Network/Sockets.hpp
index b611e85..b611e85 100755..100644
--- a/include/SFML/Network/Sockets.hpp
+++ b/include/SFML/Network/Sockets.hpp
diff --git a/include/SFML/Network/Unix/.svn/all-wcprops b/include/SFML/Network/Unix/.svn/all-wcprops
new file mode 100644
index 0000000..f76fe19
--- /dev/null
+++ b/include/SFML/Network/Unix/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svnroot/sfml/!svn/ver/749/include/SFML/Network/Unix
+END
+SocketHelper.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 69
+/svnroot/sfml/!svn/ver/749/include/SFML/Network/Unix/SocketHelper.hpp
+END
diff --git a/include/SFML/Network/Unix/.svn/entries b/include/SFML/Network/Unix/.svn/entries
new file mode 100644
index 0000000..729d880
--- /dev/null
+++ b/include/SFML/Network/Unix/.svn/entries
@@ -0,0 +1,62 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/Network/Unix
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-07-05T13:12:12.731009Z
+749
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+SocketHelper.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+bbdd460368f5bbb6eec8bb31ac30429a
+2008-07-05T13:12:12.731009Z
+749
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3392
+
diff --git a/include/SFML/Network/Unix/.svn/format b/include/SFML/Network/Unix/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/Network/Unix/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Network/Unix/.svn/text-base/SocketHelper.hpp.svn-base b/include/SFML/Network/Unix/.svn/text-base/SocketHelper.hpp.svn-base
new file mode 100644
index 0000000..1068cd8
--- /dev/null
+++ b/include/SFML/Network/Unix/.svn/text-base/SocketHelper.hpp.svn-base
@@ -0,0 +1,96 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETHELPERUNIX_HPP
+#define SFML_SOCKETHELPERUNIX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <unistd.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// This class defines helper functions to do all the
+/// non-portable socket stuff. This class is meant for internal
+/// use only
+////////////////////////////////////////////////////////////
+class SFML_API SocketHelper
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ // Define some socket types
+ ////////////////////////////////////////////////////////////
+ typedef int SocketType;
+ typedef socklen_t LengthType;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the value of the invalid socket
+ ///
+ /// \return Unique value of the invalid socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static SocketType InvalidSocket();
+
+ ////////////////////////////////////////////////////////////
+ /// Close / destroy a socket
+ ///
+ /// \param Socket : Socket to close
+ ///
+ /// \return True on success
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool Close(SocketType Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Set a socket as blocking or non-blocking
+ ///
+ /// \param Socket : Socket to modify
+ /// \param Block : New blocking state of the socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetBlocking(SocketType Socket, bool Block);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the last socket error status
+ ///
+ /// \return Status corresponding to the last socket error
+ ///
+ ////////////////////////////////////////////////////////////
+ static Socket::Status GetErrorStatus();
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETHELPERUNIX_HPP
diff --git a/include/SFML/Network/Unix/SocketHelper.hpp b/include/SFML/Network/Unix/SocketHelper.hpp
index 8a3b391..1068cd8 100755..100644
--- a/include/SFML/Network/Unix/SocketHelper.hpp
+++ b/include/SFML/Network/Unix/SocketHelper.hpp
@@ -1,95 +1,96 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_SOCKETHELPERUNIX_HPP
-#define SFML_SOCKETHELPERUNIX_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <unistd.h>
-
-
-namespace sf
-{
-////////////////////////////////////////////////////////////
-/// This class defines helper functions to do all the
-/// non-portable socket stuff. This class is meant for internal
-/// use only
-////////////////////////////////////////////////////////////
-class SFML_API SocketHelper
-{
-public :
-
- ////////////////////////////////////////////////////////////
- // Define some socket types
- ////////////////////////////////////////////////////////////
- typedef int SocketType;
- typedef socklen_t LengthType;
-
- ////////////////////////////////////////////////////////////
- /// Return the value of the invalid socket
- ///
- /// \return Unique value of the invalid socket
- ///
- ////////////////////////////////////////////////////////////
- static SocketType InvalidSocket();
-
- ////////////////////////////////////////////////////////////
- /// Close / destroy a socket
- ///
- /// \param Socket : Socket to close
- ///
- /// \return True on success
- ///
- ////////////////////////////////////////////////////////////
- static bool Close(SocketType Socket);
-
- ////////////////////////////////////////////////////////////
- /// Set a socket as blocking or non-blocking
- ///
- /// \param Socket : Socket to modify
- /// \param Block : New blocking state of the socket
- ///
- ////////////////////////////////////////////////////////////
- static void SetBlocking(SocketType Socket, bool Block);
-
- ////////////////////////////////////////////////////////////
- /// Get the last socket error status
- ///
- /// \return Status corresponding to the last socket error
- ///
- ////////////////////////////////////////////////////////////
- static Socket::Status GetErrorStatus();
-};
-
-} // namespace sf
-
-
-#endif // SFML_SOCKETHELPERUNIX_HPP
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETHELPERUNIX_HPP
+#define SFML_SOCKETHELPERUNIX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <unistd.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// This class defines helper functions to do all the
+/// non-portable socket stuff. This class is meant for internal
+/// use only
+////////////////////////////////////////////////////////////
+class SFML_API SocketHelper
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ // Define some socket types
+ ////////////////////////////////////////////////////////////
+ typedef int SocketType;
+ typedef socklen_t LengthType;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the value of the invalid socket
+ ///
+ /// \return Unique value of the invalid socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static SocketType InvalidSocket();
+
+ ////////////////////////////////////////////////////////////
+ /// Close / destroy a socket
+ ///
+ /// \param Socket : Socket to close
+ ///
+ /// \return True on success
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool Close(SocketType Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Set a socket as blocking or non-blocking
+ ///
+ /// \param Socket : Socket to modify
+ /// \param Block : New blocking state of the socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetBlocking(SocketType Socket, bool Block);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the last socket error status
+ ///
+ /// \return Status corresponding to the last socket error
+ ///
+ ////////////////////////////////////////////////////////////
+ static Socket::Status GetErrorStatus();
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETHELPERUNIX_HPP
diff --git a/include/SFML/Network/Win32/.svn/all-wcprops b/include/SFML/Network/Win32/.svn/all-wcprops
new file mode 100644
index 0000000..8626588
--- /dev/null
+++ b/include/SFML/Network/Win32/.svn/all-wcprops
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svnroot/sfml/!svn/ver/434/include/SFML/Network/Win32
+END
+SocketHelper.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/svnroot/sfml/!svn/ver/434/include/SFML/Network/Win32/SocketHelper.hpp
+END
diff --git a/include/SFML/Network/Win32/.svn/entries b/include/SFML/Network/Win32/.svn/entries
new file mode 100644
index 0000000..a01813d
--- /dev/null
+++ b/include/SFML/Network/Win32/.svn/entries
@@ -0,0 +1,62 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/Network/Win32
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+SocketHelper.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+189b7e68dbf625a38637bc56ccff94c6
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3252
+
diff --git a/include/SFML/Network/Win32/.svn/format b/include/SFML/Network/Win32/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/Network/Win32/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Network/Win32/.svn/text-base/SocketHelper.hpp.svn-base b/include/SFML/Network/Win32/.svn/text-base/SocketHelper.hpp.svn-base
new file mode 100644
index 0000000..d7851b4
--- /dev/null
+++ b/include/SFML/Network/Win32/.svn/text-base/SocketHelper.hpp.svn-base
@@ -0,0 +1,90 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SOCKETHELPERWIN32_HPP
+#define SFML_SOCKETHELPERWIN32_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <winsock2.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// This class defines helper functions to do all the
+/// non-portable socket stuff. This class is meant for internal
+/// use only
+////////////////////////////////////////////////////////////
+class SFML_API SocketHelper
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ // Define some socket types
+ ////////////////////////////////////////////////////////////
+ typedef SOCKET SocketType;
+ typedef int LengthType;
+
+ ////////////////////////////////////////////////////////////
+ /// Return the value of the invalid socket
+ ///
+ /// \return Unique value of the invalid socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static SocketType InvalidSocket();
+
+ ////////////////////////////////////////////////////////////
+ /// Close / destroy a socket
+ ///
+ /// \param Socket : Socket to close
+ ///
+ /// \return True on success
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool Close(SocketType Socket);
+
+ ////////////////////////////////////////////////////////////
+ /// Set a socket as blocking or non-blocking
+ ///
+ /// \param Socket : Socket to modify
+ /// \param Block : New blocking state of the socket
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetBlocking(SocketType Socket, bool Block);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the last socket error status
+ ///
+ /// \return Status corresponding to the last socket error
+ ///
+ ////////////////////////////////////////////////////////////
+ static Socket::Status GetErrorStatus();
+};
+
+} // namespace sf
+
+
+#endif // SFML_SOCKETHELPERWIN32_HPP
diff --git a/include/SFML/Network/Win32/SocketHelper.hpp b/include/SFML/Network/Win32/SocketHelper.hpp
index d7851b4..d7851b4 100755..100644
--- a/include/SFML/Network/Win32/SocketHelper.hpp
+++ b/include/SFML/Network/Win32/SocketHelper.hpp
diff --git a/include/SFML/System.hpp b/include/SFML/System.hpp
index 01aff60..6350210 100755..100644
--- a/include/SFML/System.hpp
+++ b/include/SFML/System.hpp
@@ -36,6 +36,7 @@
#include <SFML/System/Randomizer.hpp>
#include <SFML/System/Sleep.hpp>
#include <SFML/System/Thread.hpp>
+#include <SFML/System/Unicode.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/System/Vector3.hpp>
diff --git a/include/SFML/System/.svn/all-wcprops b/include/SFML/System/.svn/all-wcprops
new file mode 100644
index 0000000..caeb9ae
--- /dev/null
+++ b/include/SFML/System/.svn/all-wcprops
@@ -0,0 +1,101 @@
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/svnroot/sfml/!svn/ver/859/include/SFML/System
+END
+Clock.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Clock.hpp
+END
+Mutex.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Mutex.hpp
+END
+Thread.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Thread.hpp
+END
+Sleep.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Sleep.hpp
+END
+ResourcePtr.inl
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svnroot/sfml/!svn/ver/804/include/SFML/System/ResourcePtr.inl
+END
+NonCopyable.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svnroot/sfml/!svn/ver/859/include/SFML/System/NonCopyable.hpp
+END
+Randomizer.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Randomizer.hpp
+END
+Vector2.inl
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/643/include/SFML/System/Vector2.inl
+END
+Vector3.inl
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/643/include/SFML/System/Vector3.inl
+END
+Unicode.inl
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/795/include/SFML/System/Unicode.inl
+END
+Resource.inl
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svnroot/sfml/!svn/ver/805/include/SFML/System/Resource.inl
+END
+Vector2.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/643/include/SFML/System/Vector2.hpp
+END
+Vector3.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/643/include/SFML/System/Vector3.hpp
+END
+Unicode.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/798/include/SFML/System/Unicode.hpp
+END
+Resource.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svnroot/sfml/!svn/ver/804/include/SFML/System/Resource.hpp
+END
+Lock.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Lock.hpp
+END
diff --git a/include/SFML/System/.svn/entries b/include/SFML/System/.svn/entries
new file mode 100644
index 0000000..3b3329a
--- /dev/null
+++ b/include/SFML/System/.svn/entries
@@ -0,0 +1,578 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/System
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-09-07T16:48:20.213384Z
+859
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+Clock.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+6e3816df74592bea5e5f250cabe407ef
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2500
+
+Unix
+dir
+
+Mutex.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+61deff34a04e7388d87bd7b88ef5d6dd
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1517
+
+Thread.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+6811e28f27f1169e9fe3ba8cdd106f1d
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1522
+
+Sleep.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+3d5166844b9d966bebc6c2327b96f156
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1718
+
+ResourcePtr.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+8da9778bcc8d278772541dfde323be18
+2008-08-09T14:50:25.623007Z
+804
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4499
+
+NonCopyable.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+dcb94962915ac2a99146aa9ae4507493
+2008-09-07T16:48:20.213384Z
+859
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2569
+
+Randomizer.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+f973f9a0a92333d09da10d5d63d0dc1d
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3340
+
+Win32
+dir
+
+Vector2.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+790bdba7894d30b339b4e84415aa7c25
+2008-04-23T11:17:59.491864Z
+643
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5470
+
+Vector3.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+526e8452ca394b22fd702dcfcbef30b2
+2008-04-23T11:17:59.491864Z
+643
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5652
+
+Unicode.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+3d3b69946970661c8b4a88ca32ecbeea
+2008-08-03T04:57:09.628953Z
+795
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16176
+
+Resource.inl
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+198a268f1a59be1545f883056e26f934
+2008-08-10T06:00:57.031028Z
+805
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2932
+
+Vector2.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+6a6f67c0440e561ecc6ff9af35422a21
+2008-04-23T11:17:59.491864Z
+643
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6794
+
+Vector3.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+dec9a9618d886f98d13aa45857dc2c99
+2008-04-23T11:17:59.491864Z
+643
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6874
+
+Unicode.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+dc5e003a8b37f985caff70933073cb0d
+2008-08-04T17:27:29.138748Z
+798
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+14149
+
+Resource.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+8e0d1be179af2b0312373f545ea21218
+2008-08-09T14:50:25.623007Z
+804
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7488
+
+Lock.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+df568210c44b6426c620082ff59ab7b1
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2392
+
diff --git a/include/SFML/System/.svn/format b/include/SFML/System/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/System/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Graphics/VideoResource.hpp b/include/SFML/System/.svn/text-base/Clock.hpp.svn-base
index 9e4c6a3..4b3cf9a 100755..100644
--- a/include/SFML/Graphics/VideoResource.hpp
+++ b/include/SFML/System/.svn/text-base/Clock.hpp.svn-base
@@ -22,8 +22,8 @@
//
////////////////////////////////////////////////////////////
-#ifndef SFML_VIDEORESOURCE_HPP
-#define SFML_VIDEORESOURCE_HPP
+#ifndef SFML_CLOCK_HPP
+#define SFML_CLOCK_HPP
////////////////////////////////////////////////////////////
// Headers
@@ -34,42 +34,41 @@
namespace sf
{
////////////////////////////////////////////////////////////
-/// Abstract base class for every class that owns a
-/// hardware resource -- allow them to initialize / shutdown
-/// even when rendering context is not created
+/// Clock is an utility class for manipulating time
////////////////////////////////////////////////////////////
-class SFML_API VideoResource
+class SFML_API Clock
{
public :
////////////////////////////////////////////////////////////
- /// Destroy all video resources that need a valid rendering context
+ /// Default constructor
///
////////////////////////////////////////////////////////////
- virtual void DestroyVideoResources() = 0;
-
-protected :
+ Clock();
////////////////////////////////////////////////////////////
- /// Default constructor
+ /// Get the time elapsed since last reset
+ ///
+ /// \return Time elapsed, in seconds
///
////////////////////////////////////////////////////////////
- VideoResource();
+ float GetElapsedTime() const;
////////////////////////////////////////////////////////////
- /// Copy constructor
+ /// Restart the timer
///
////////////////////////////////////////////////////////////
- VideoResource(const VideoResource&);
+ void Reset();
+
+private :
////////////////////////////////////////////////////////////
- /// Destructor
- ///
+ // Member data
////////////////////////////////////////////////////////////
- virtual ~VideoResource();
+ double myStartTime; ///< Time of last reset
};
} // namespace sf
-#endif // SFML_VIDEORESOURCE_HPP
+#endif // SFML_CLOCK_HPP
diff --git a/include/SFML/System/.svn/text-base/Lock.hpp.svn-base b/include/SFML/System/.svn/text-base/Lock.hpp.svn-base
new file mode 100644
index 0000000..f1176fa
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Lock.hpp.svn-base
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_LOCK_HPP
+#define SFML_LOCK_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+
+
+namespace sf
+{
+class Mutex;
+
+////////////////////////////////////////////////////////////
+/// Lock is an exception-safe automatic wrapper for
+/// locking and unlocking mutexes
+////////////////////////////////////////////////////////////
+class SFML_API Lock : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the lock with a target mutex (lock it)
+ ///
+ /// @param Mutex : Mutex to lock
+ ///
+ ////////////////////////////////////////////////////////////
+ Lock(Mutex& Mutex);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor (unlocks the mutex)
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Lock();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ Mutex& myMutex; ///< Mutex to lock / unlock
+};
+
+} // namespace sf
+
+
+#endif // SFML_LOCK_HPP
diff --git a/include/SFML/System/.svn/text-base/Mutex.hpp.svn-base b/include/SFML/System/.svn/text-base/Mutex.hpp.svn-base
new file mode 100644
index 0000000..7e096ae
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Mutex.hpp.svn-base
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MUTEX_HPP
+#define SFML_MUTEX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+#ifdef SFML_SYSTEM_WINDOWS
+
+ #include <SFML/System/Win32/Mutex.hpp>
+
+#else
+
+ #include <SFML/System/Unix/Mutex.hpp>
+
+#endif
+
+
+#endif // SFML_MUTEX_HPP
diff --git a/include/SFML/System/.svn/text-base/NonCopyable.hpp.svn-base b/include/SFML/System/.svn/text-base/NonCopyable.hpp.svn-base
new file mode 100644
index 0000000..338653d
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/NonCopyable.hpp.svn-base
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_NONCOPYABLE_HPP
+#define SFML_NONCOPYABLE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Utility base class to easily declare non-copyable classes.
+/// Just inherit from NonCopyable to get a non-copyable class
+////////////////////////////////////////////////////////////
+struct SFML_API NonCopyable
+{
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// The default constructor won't be generated, so provide it
+ ///
+ ////////////////////////////////////////////////////////////
+ NonCopyable() {}
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor : declare it private and don't implement
+ /// it to prevent from calling it
+ ///
+ ////////////////////////////////////////////////////////////
+ NonCopyable(const NonCopyable&);
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator : declare it private and don't implement
+ /// it to prevent from calling it
+ ///
+ ////////////////////////////////////////////////////////////
+ NonCopyable& operator =(const NonCopyable&);
+};
+
+} // namespace sf
+
+
+#endif // SFML_NONCOPYABLE_HPP
diff --git a/include/SFML/System/.svn/text-base/Randomizer.hpp.svn-base b/include/SFML/System/.svn/text-base/Randomizer.hpp.svn-base
new file mode 100644
index 0000000..dd453c1
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Randomizer.hpp.svn-base
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RANDOMIZER_HPP
+#define SFML_RANDOMIZER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Randomizer is an utility class for generating pseudo-random
+/// numbers
+////////////////////////////////////////////////////////////
+class SFML_API Randomizer
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Set the seed for the generator. Using a known seed
+ /// allows you to reproduce the same sequence of random number
+ ///
+ /// \param Seed : Number to use as the seed
+ ///
+ ////////////////////////////////////////////////////////////
+ static void SetSeed(unsigned int Seed);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the seed used to generate random numbers the generator.
+ ///
+ /// \return Current seed
+ ///
+ ////////////////////////////////////////////////////////////
+ static unsigned int GetSeed();
+
+ ////////////////////////////////////////////////////////////
+ /// Get a random float number in a given range
+ ///
+ /// \return Start : Start of the range
+ /// \return End : End of the range
+ ///
+ /// \return Random number in [Begin, End]
+ ///
+ ////////////////////////////////////////////////////////////
+ static float Random(float Begin, float End);
+
+ ////////////////////////////////////////////////////////////
+ /// Get a random integer number in a given range
+ ///
+ /// \return Start : Start of the range
+ /// \return End : End of the range
+ ///
+ /// \return Random number in [Begin, End]
+ ///
+ ////////////////////////////////////////////////////////////
+ static int Random(int Begin, int End);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Static member variables
+ ////////////////////////////////////////////////////////////
+ static unsigned int ourSeed;
+};
+
+} // namespace sf
+
+
+#endif // SFML_RANDOMIZER_HPP
diff --git a/include/SFML/System/.svn/text-base/Resource.hpp.svn-base b/include/SFML/System/.svn/text-base/Resource.hpp.svn-base
new file mode 100644
index 0000000..8f5088d
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Resource.hpp.svn-base
@@ -0,0 +1,216 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RESOURCE_HPP
+#define SFML_RESOURCE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <set>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+// These two classes are defined in the same header because
+// they depend on each other. And as they're template classes,
+// they must be entirely defined in header files, which
+// prevents from proper separate compiling
+////////////////////////////////////////////////////////////
+
+template <typename> class ResourcePtr;
+
+////////////////////////////////////////////////////////////
+/// Base class for every resource that needs to notify
+/// dependent classes about its destruction
+////////////////////////////////////////////////////////////
+template <typename T>
+class Resource
+{
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Resource();
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Resource to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ Resource(const Resource<T>& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Resource();
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator
+ ///
+ /// \param Other : Resource to copy
+ ///
+ /// \return Reference to this
+ ///
+ ////////////////////////////////////////////////////////////
+ Resource<T>& operator =(const Resource<T>& Other);
+
+private :
+
+ friend class ResourcePtr<T>;
+
+ ////////////////////////////////////////////////////////////
+ /// Connect a ResourcePtr to this resource
+ ///
+ /// \param Observer : Observer to add
+ ///
+ ////////////////////////////////////////////////////////////
+ void Connect(ResourcePtr<T>& Observer) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Disconnect a ResourcePtr from this resource
+ ///
+ /// \param Observer : Observer to remove
+ ///
+ ////////////////////////////////////////////////////////////
+ void Disconnect(ResourcePtr<T>& Observer) const;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ mutable std::set<ResourcePtr<T>*> myObservers;
+};
+
+
+////////////////////////////////////////////////////////////
+/// Safe pointer to a T resource (inheriting from sf::Resource<T>),
+/// its pointer is automatically reseted when the resource is destroyed
+////////////////////////////////////////////////////////////
+template <typename T>
+class ResourcePtr
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct from a raw resource
+ ///
+ /// \param Resource : Internal resource
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr(const T* Resource);
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Instance to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr(const ResourcePtr<T>& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ResourcePtr();
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator from another ResourcePtr
+ ///
+ /// \param Other : Resource pointer to assign
+ ///
+ /// \return Reference to this
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr<T>& operator =(const ResourcePtr<T>& Other);
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator from a raw resource
+ ///
+ /// \param Resource : Resource to assign
+ ///
+ /// \return Reference to this
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr<T>& operator =(const T* Resource);
+
+ ////////////////////////////////////////////////////////////
+ /// Cast operator to implicitely convert the resource pointer to
+ /// its raw pointer type.
+ /// This might be dangerous in the general case, but in this context
+ /// it is safe enough to define this operator
+ ///
+ /// \return Pointer to the actual resource
+ ///
+ ////////////////////////////////////////////////////////////
+ operator const T*() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator * overload to return a reference to the actual resource
+ ///
+ /// \return Reference to the internal resource
+ ///
+ ////////////////////////////////////////////////////////////
+ const T& operator *() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator -> overload to return a pointer to the actual resource
+ ///
+ /// \return Pointer to the internal resource
+ ///
+ ////////////////////////////////////////////////////////////
+ const T* operator ->() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Function called when the observed resource is about to be
+ /// destroyed
+ ///
+ ////////////////////////////////////////////////////////////
+ void OnResourceDestroyed();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ const T* myResource; /// Pointer to the actual resource
+};
+
+#include <SFML/System/Resource.inl>
+#include <SFML/System/ResourcePtr.inl>
+
+} // namespace sf
+
+
+#endif // SFML_RESOURCE_HPP
diff --git a/include/SFML/System/.svn/text-base/Resource.inl.svn-base b/include/SFML/System/.svn/text-base/Resource.inl.svn-base
new file mode 100644
index 0000000..c4276a1
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Resource.inl.svn-base
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>::Resource()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+/// Copy constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>::Resource(const Resource<T>&)
+{
+ // Nothing to do, we don't want to copy observers
+}
+
+
+////////////////////////////////////////////////////////////
+/// Destructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>::~Resource()
+{
+ // Notify all observers
+ for (typename std::set<ResourcePtr<T>*>::iterator i = myObservers.begin(); i != myObservers.end(); ++i)
+ {
+ (*i)->OnResourceDestroyed();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Assignment operator
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>& Resource<T>::operator =(const Resource<T>&)
+{
+ // Nothing to do, we don't want to copy observers
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Connect a ResourcePtr to this resource
+////////////////////////////////////////////////////////////
+template <typename T>
+void Resource<T>::Connect(ResourcePtr<T>& Observer) const
+{
+ myObservers.insert(&Observer);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Disconnect a ResourcePtr from this resource
+////////////////////////////////////////////////////////////
+template <typename T>
+void Resource<T>::Disconnect(ResourcePtr<T>& Observer) const
+{
+ myObservers.erase(&Observer);
+}
diff --git a/include/SFML/System/.svn/text-base/ResourcePtr.inl.svn-base b/include/SFML/System/.svn/text-base/ResourcePtr.inl.svn-base
new file mode 100644
index 0000000..dbfcd0d
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/ResourcePtr.inl.svn-base
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::ResourcePtr() :
+myResource(NULL)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Construct from a raw resource
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::ResourcePtr(const T* Resource) :
+myResource(Resource)
+{
+ if (myResource)
+ myResource->Connect(*this);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Copy constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::ResourcePtr(const ResourcePtr<T>& Copy) :
+myResource(Copy.myResource)
+{
+ if (myResource)
+ myResource->Connect(*this);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Destructor
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::~ResourcePtr()
+{
+ if (myResource)
+ myResource->Disconnect(*this);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Assignment operator from another ResourcePtr
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>& ResourcePtr<T>::operator =(const ResourcePtr<T>& Other)
+{
+ if (myResource)
+ myResource->Disconnect(*this);
+
+ myResource = Other.myResource;
+
+ if (myResource)
+ myResource->Connect(*this);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Assignment operator from a raw resource
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>& ResourcePtr<T>::operator =(const T* Resource)
+{
+ if (myResource)
+ myResource->Disconnect(*this);
+
+ myResource = Resource;
+
+ if (myResource)
+ myResource->Connect(*this);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Cast operator to implicitely convert the resource pointer to
+/// its raw pointer type.
+/// This might be dangerous in the general case, but in this context
+/// it is safe enough to define this operator
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::operator const T*() const
+{
+ return myResource;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload to return a reference to the actual resource
+////////////////////////////////////////////////////////////
+template <typename T>
+const T& ResourcePtr<T>::operator *() const
+{
+ return *myResource;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator -> overload to return a pointer to the actual resource
+////////////////////////////////////////////////////////////
+template <typename T>
+const T* ResourcePtr<T>::operator ->() const
+{
+ return myResource;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Function called when the observed resource is about to be
+/// destroyed
+////////////////////////////////////////////////////////////
+template <typename T>
+void ResourcePtr<T>::OnResourceDestroyed()
+{
+ myResource = NULL;
+}
diff --git a/include/SFML/System/.svn/text-base/Sleep.hpp.svn-base b/include/SFML/System/.svn/text-base/Sleep.hpp.svn-base
new file mode 100644
index 0000000..8cc23f5
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Sleep.hpp.svn-base
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_SLEEP_HPP
+#define SFML_SLEEP_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+ ////////////////////////////////////////////////////////////
+ /// Make the current thread sleep for a given time
+ ///
+ /// \param Duration : Time to sleep, in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ void SFML_API Sleep(float Duration);
+
+} // namespace sf
+
+
+#endif // SFML_SLEEP_HPP
diff --git a/include/SFML/System/.svn/text-base/Thread.hpp.svn-base b/include/SFML/System/.svn/text-base/Thread.hpp.svn-base
new file mode 100644
index 0000000..016dab7
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Thread.hpp.svn-base
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREAD_HPP
+#define SFML_THREAD_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+#ifdef SFML_SYSTEM_WINDOWS
+
+ #include <SFML/System/Win32/Thread.hpp>
+
+#else
+
+ #include <SFML/System/Unix/Thread.hpp>
+
+#endif
+
+
+#endif // SFML_THREAD_HPP
diff --git a/include/SFML/System/.svn/text-base/Unicode.hpp.svn-base b/include/SFML/System/.svn/text-base/Unicode.hpp.svn-base
new file mode 100644
index 0000000..f7208e8
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Unicode.hpp.svn-base
@@ -0,0 +1,290 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_UNICODE_HPP
+#define SFML_UNICODE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <iterator>
+#include <locale>
+#include <string>
+#include <stdlib.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Provides utility functions to convert from and to
+/// any unicode and ASCII encoding
+////////////////////////////////////////////////////////////
+class SFML_API Unicode
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Define a string type for each encoding
+ /// Warning : in UTF8 and UTF16 strings, one element doesn't
+ /// necessarily maps to one character ; only an UTF32 element
+ /// is wide enough to hold all possible unicode values
+ ////////////////////////////////////////////////////////////
+ typedef std::basic_string<Uint8> UTF8String;
+ typedef std::basic_string<Uint16> UTF16String;
+ typedef std::basic_string<Uint32> UTF32String;
+
+ ////////////////////////////////////////////////////////////
+ /// This class is an abstract definition of a unicode text,
+ /// it can be converted from and to any kind of string
+ /// and encoding
+ ////////////////////////////////////////////////////////////
+ class SFML_API Text
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor (empty text)
+ ///
+ ////////////////////////////////////////////////////////////
+ Text();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the unicode text from any type of string
+ ///
+ /// \param Str : String to convert
+ ///
+ ////////////////////////////////////////////////////////////
+ Text(const char* Str);
+ Text(const wchar_t* Str);
+ Text(const Uint8* Str);
+ Text(const Uint16* Str);
+ Text(const Uint32* Str);
+ Text(const std::string& Str);
+ Text(const std::wstring& Str);
+ Text(const Unicode::UTF8String& Str);
+ Text(const Unicode::UTF16String& Str);
+ Text(const Unicode::UTF32String& Str);
+
+ ////////////////////////////////////////////////////////////
+ /// Operator to cast the text to any type of string
+ ///
+ /// \return Converted string
+ ///
+ ////////////////////////////////////////////////////////////
+ operator std::string () const;
+ operator std::wstring () const;
+ operator Unicode::UTF8String () const;
+ operator Unicode::UTF16String () const;
+ operator const Unicode::UTF32String&() const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Data member
+ ////////////////////////////////////////////////////////////
+ sf::Unicode::UTF32String myUTF32String; ///< UTF-32 unicode text
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-32 characters range
+ /// to an ANSI characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ /// \param Locale : Locale to use for conversion (uses the current one by default)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF32ToANSI(In Begin, In End, Out Output, char Replacement = '?', const std::locale& Locale = GetDefaultLocale());
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an ANSI characters range
+ /// to an UTF-32 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Locale : Locale to use for conversion (uses the current one by default)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ANSIToUTF32(In Begin, In End, Out Output, const std::locale& Locale = GetDefaultLocale());
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-8 characters range
+ /// to an UTF-16 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-8 characters range
+ /// to an UTF-32 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-16 characters range
+ /// to an UTF-8 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF16ToUTF8(In Begin, In End, Out Output, Uint8 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-16 characters range
+ /// to an UTF-32 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF16ToUTF32(In Begin, In End, Out Output, Uint32 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-32 characters range
+ /// to an UTF-8 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF32ToUTF8(In Begin, In End, Out Output, Uint8 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-32 characters range
+ /// to an UTF-16 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF32ToUTF16(In Begin, In End, Out Output, Uint16 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of characters composing an UTF-8 string
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ ///
+ /// \return Count of the characters in the string
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t GetUTF8Length(In Begin, In End);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of characters composing an UTF-16 string
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ ///
+ /// \return Count of the characters in the string
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t GetUTF16Length(In Begin, In End);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of characters composing an UTF-32 string
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ ///
+ /// \return Count of the characters in the string
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t GetUTF32Length(In Begin, In End);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Get the default system locale
+ ///
+ /// \return Reference to the default system locale
+ ///
+ ////////////////////////////////////////////////////////////
+ static const std::locale& GetDefaultLocale();
+
+ ////////////////////////////////////////////////////////////
+ // Static data member
+ ////////////////////////////////////////////////////////////
+ static const char UTF8TrailingBytes[256]; ///< Lookup table to find the length of an UTF-8 sequence
+ static const Uint32 UTF8Offsets[6]; ///< Magic values to subtract during UTF-8 conversions
+ static const Uint8 UTF8FirstBytes[7]; ///< First bytes for UTF-8 sequences
+};
+
+#include <SFML/System/Unicode.inl>
+
+} // namespace sf
+
+
+#endif // SFML_UNICODE_HPP
diff --git a/include/SFML/System/.svn/text-base/Unicode.inl.svn-base b/include/SFML/System/.svn/text-base/Unicode.inl.svn-base
new file mode 100644
index 0000000..2dbb3a2
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Unicode.inl.svn-base
@@ -0,0 +1,474 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-32 characters range
+/// to an ANSI characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF32ToANSI(In Begin, In End, Out Output, char Replacement, const std::locale& Locale)
+{
+ #ifdef __MINGW32__
+
+ // MinGW has a almost no support for unicode stuff
+ // As a consequence, the MinGW version of this function can only use the default locale
+ // and ignores the one passed as parameter
+ while (Begin < End)
+ {
+ char Char = 0;
+ if (wctomb(&Char, static_cast<wchar_t>(*Begin++)) >= 0)
+ *Output++ = Char;
+ else if (Replacement)
+ *Output++ = Replacement;
+ }
+
+ #else
+
+ // Get the facet of the locale which deals with character conversion
+ const std::ctype<wchar_t>& Facet = std::use_facet< std::ctype<wchar_t> >(Locale);
+
+ // Use the facet to convert each character of the input string
+ while (Begin < End)
+ *Output++ = Facet.narrow(static_cast<wchar_t>(*Begin++), Replacement);
+
+ #endif
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an ANSI characters range
+/// to an UTF-32 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::ANSIToUTF32(In Begin, In End, Out Output, const std::locale& Locale)
+{
+ #ifdef __MINGW32__
+
+ // MinGW has a almost no support for unicode stuff
+ // As a consequence, the MinGW version of this function can only use the default locale
+ // and ignores the one passed as parameter
+ while (Begin < End)
+ {
+ wchar_t Char = 0;
+ mbtowc(&Char, &*Begin, 1);
+ Begin++;
+ *Output++ = static_cast<Uint32>(Char);
+ }
+
+ #else
+
+ // Get the facet of the locale which deals with character conversion
+ const std::ctype<wchar_t>& Facet = std::use_facet< std::ctype<wchar_t> >(Locale);
+
+ // Use the facet to convert each character of the input string
+ while (Begin < End)
+ *Output++ = static_cast<Uint32>(Facet.widen(*Begin++));
+
+ #endif
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-8 characters range
+/// to an UTF-16 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = 0;
+ int TrailingBytes = UTF8TrailingBytes[*Begin];
+ if (Begin + TrailingBytes < End)
+ {
+ // First decode the UTF-8 character
+ switch (TrailingBytes)
+ {
+ case 5 : c += *Begin++; c <<= 6;
+ case 4 : c += *Begin++; c <<= 6;
+ case 3 : c += *Begin++; c <<= 6;
+ case 2 : c += *Begin++; c <<= 6;
+ case 1 : c += *Begin++; c <<= 6;
+ case 0 : c += *Begin++;
+ }
+ c -= UTF8Offsets[TrailingBytes];
+
+ // Then encode it in UTF-16
+ if (c < 0xFFFF)
+ {
+ // Character can be converted directly to 16 bits, just need to check it's in the valid range
+ if ((c >= 0xD800) && (c <= 0xDFFF))
+ {
+ // Invalid character (this range is reserved)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to 16 bits
+ *Output++ = static_cast<Uint16>(c);
+ }
+ }
+ else if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Character will be converted to 2 UTF-16 elements
+ c -= 0x0010000;
+ *Output++ = static_cast<Uint16>((c >> 10) + 0xD800);
+ *Output++ = static_cast<Uint16>((c & 0x3FFUL) + 0xDC00);
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-8 characters range
+/// to an UTF-32 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = 0;
+ int TrailingBytes = UTF8TrailingBytes[*Begin];
+ if (Begin + TrailingBytes < End)
+ {
+ // First decode the UTF-8 character
+ switch (TrailingBytes)
+ {
+ case 5 : c += *Begin++; c <<= 6;
+ case 4 : c += *Begin++; c <<= 6;
+ case 3 : c += *Begin++; c <<= 6;
+ case 2 : c += *Begin++; c <<= 6;
+ case 1 : c += *Begin++; c <<= 6;
+ case 0 : c += *Begin++;
+ }
+ c -= UTF8Offsets[TrailingBytes];
+
+ // Then write it if valid
+ if ((c < 0xD800) || (c > 0xDFFF))
+ {
+ // Valid UTF-32 character
+ *Output++ = c;
+ }
+ else
+ {
+ // Invalid UTF-32 character
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-16 characters range
+/// to an UTF-8 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF16ToUTF8(In Begin, In End, Out Output, Uint8 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = *Begin++;
+
+ // If it's a surrogate pair, first convert to a single UTF-32 character
+ if ((c >= 0xD800) && (c <= 0xDBFF))
+ {
+ if (Begin < End)
+ {
+ // The second element is valid : convert the two elements to a UTF-32 character
+ Uint32 d = *Begin++;
+ if ((d >= 0xDC00) && (d <= 0xDFFF))
+ c = static_cast<Uint32>(((c - 0xD800) << 10) + (d - 0xDC00) + 0x0010000);
+ }
+ else
+ {
+ // Invalid second element
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ }
+
+ // Then convert to UTF-8
+ if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character
+
+ // Get number of bytes to write
+ int BytesToWrite = 1;
+ if (c < 0x80) BytesToWrite = 1;
+ else if (c < 0x800) BytesToWrite = 2;
+ else if (c < 0x10000) BytesToWrite = 3;
+ else if (c <= 0x0010FFFF) BytesToWrite = 4;
+
+ // Extract bytes to write
+ Uint8 Bytes[4];
+ switch (BytesToWrite)
+ {
+ case 4 : Bytes[3] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 3 : Bytes[2] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 2 : Bytes[1] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 1 : Bytes[0] = static_cast<Uint8> (c | UTF8FirstBytes[BytesToWrite]);
+ }
+
+ // Add them to the output
+ const Uint8* CurByte = Bytes;
+ switch (BytesToWrite)
+ {
+ case 4 : *Output++ = *CurByte++;
+ case 3 : *Output++ = *CurByte++;
+ case 2 : *Output++ = *CurByte++;
+ case 1 : *Output++ = *CurByte++;
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-16 characters range
+/// to an UTF-32 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF16ToUTF32(In Begin, In End, Out Output, Uint32 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint16 c = *Begin++;
+ if ((c >= 0xD800) && (c <= 0xDBFF))
+ {
+ // We have a surrogate pair, ie. a character composed of two elements
+ if (Begin < End)
+ {
+ Uint16 d = *Begin++;
+ if ((d >= 0xDC00) && (d <= 0xDFFF))
+ {
+ // The second element is valid : convert the two elements to a UTF-32 character
+ *Output++ = static_cast<Uint32>(((c - 0xD800) << 10) + (d - 0xDC00) + 0x0010000);
+ }
+ else
+ {
+ // Invalid second element
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ }
+ }
+ else if ((c >= 0xDC00) && (c <= 0xDFFF))
+ {
+ // Invalid character
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to UTF-32
+ *Output++ = static_cast<Uint32>(c);
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-32 characters range
+/// to an UTF-8 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF32ToUTF8(In Begin, In End, Out Output, Uint8 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = *Begin++;
+ if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character
+
+ // Get number of bytes to write
+ int BytesToWrite = 1;
+ if (c < 0x80) BytesToWrite = 1;
+ else if (c < 0x800) BytesToWrite = 2;
+ else if (c < 0x10000) BytesToWrite = 3;
+ else if (c <= 0x0010FFFF) BytesToWrite = 4;
+
+ // Extract bytes to write
+ Uint8 Bytes[4];
+ switch (BytesToWrite)
+ {
+ case 4 : Bytes[3] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 3 : Bytes[2] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 2 : Bytes[1] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 1 : Bytes[0] = static_cast<Uint8> (c | UTF8FirstBytes[BytesToWrite]);
+ }
+
+ // Add them to the output
+ const Uint8* CurByte = Bytes;
+ switch (BytesToWrite)
+ {
+ case 4 : *Output++ = *CurByte++;
+ case 3 : *Output++ = *CurByte++;
+ case 2 : *Output++ = *CurByte++;
+ case 1 : *Output++ = *CurByte++;
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-32 characters range
+/// to an UTF-16 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF32ToUTF16(In Begin, In End, Out Output, Uint16 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = *Begin++;
+ if (c < 0xFFFF)
+ {
+ // Character can be converted directly to 16 bits, just need to check it's in the valid range
+ if ((c >= 0xD800) && (c <= 0xDFFF))
+ {
+ // Invalid character (this range is reserved)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to 16 bits
+ *Output++ = static_cast<Uint16>(c);
+ }
+ }
+ else if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Character will be converted to 2 UTF-16 elements
+ c -= 0x0010000;
+ *Output++ = static_cast<Uint16>((c >> 10) + 0xD800);
+ *Output++ = static_cast<Uint16>((c & 0x3FFUL) + 0xDC00);
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the number of characters composing an UTF-8 string
+////////////////////////////////////////////////////////////
+template <typename In>
+inline std::size_t Unicode::GetUTF8Length(In Begin, In End)
+{
+ std::size_t Length = 0;
+ while (Begin < End)
+ {
+ int NbBytes = UTF8TrailingBytes[*Begin];
+ if (Begin + NbBytes < End)
+ ++Length;
+
+ Begin += NbBytes + 1;
+ }
+
+ return Length;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the number of characters composing an UTF-16 string
+////////////////////////////////////////////////////////////
+template <typename In>
+inline std::size_t Unicode::GetUTF16Length(In Begin, In End)
+{
+ std::size_t Length = 0;
+ while (Begin < End)
+ {
+ if ((*Begin >= 0xD800) && (*Begin <= 0xDBFF))
+ {
+ ++Begin;
+ if ((Begin < End) && ((*Begin >= 0xDC00) && (*Begin <= 0xDFFF)))
+ {
+ ++Length;
+ }
+ }
+ else
+ {
+ ++Length;
+ }
+
+ ++Begin;
+ }
+
+ return Length;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the number of characters composing an UTF-32 string
+////////////////////////////////////////////////////////////
+template <typename In>
+inline std::size_t Unicode::GetUTF32Length(In Begin, In End)
+{
+ return End - Begin;
+}
diff --git a/include/SFML/System/.svn/text-base/Vector2.hpp.svn-base b/include/SFML/System/.svn/text-base/Vector2.hpp.svn-base
new file mode 100644
index 0000000..f6a18ab
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Vector2.hpp.svn-base
@@ -0,0 +1,215 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_VECTOR2_HPP
+#define SFML_VECTOR2_HPP
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Vector2 is an utility class for manipulating 2 dimensional
+/// vectors. Template parameter defines the type of coordinates
+/// (integer, float, ...)
+////////////////////////////////////////////////////////////
+template <typename T>
+class Vector2
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector2();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the vector from its coordinates
+ ///
+ /// \param X : X coordinate
+ /// \param Y : Y coordinate
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector2(T X, T Y);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ T x; ///< X coordinate of the vector
+ T y; ///< Y coordinate of the vector
+};
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; returns the opposite of a vector
+///
+/// \param V : Vector to negate
+///
+/// \return -V
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator -(const Vector2<T>& V);
+
+////////////////////////////////////////////////////////////
+/// Operator += overload ; add two vectors and assign to the first op
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 + V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator +=(Vector2<T>& V1, const Vector2<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator -= overload ; subtract two vectors and assign to the first op
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 - V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator -=(Vector2<T>& V1, const Vector2<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator + overload ; adds two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 + V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator +(const Vector2<T>& V1, const Vector2<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; subtracts two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 - V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator -(const Vector2<T>& V1, const Vector2<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V * X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator *(const Vector2<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a scalar value by a vector
+///
+/// \param X : Scalar value
+/// \param V : Vector
+///
+/// \return X * V
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator *(T X, const Vector2<T>& V);
+
+////////////////////////////////////////////////////////////
+/// Operator *= overload ; multiply-assign a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V * X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator *=(Vector2<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator / overload ; divide a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V / X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator /(const Vector2<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator /= overload ; divide-assign a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V / X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator /=(Vector2<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator == overload ; compares the equality of two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return True if V1 is equal to V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator ==(const Vector2<T>& V1, const Vector2<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator != overload ; compares the difference of two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return True if V1 is different than V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator !=(const Vector2<T>& V1, const Vector2<T>& V2);
+
+#include <SFML/System/Vector2.inl>
+
+// Define the most common types
+typedef Vector2<int> Vector2i;
+typedef Vector2<float> Vector2f;
+
+} // namespace sf
+
+
+#endif // SFML_VECTOR2_HPP
diff --git a/include/SFML/System/.svn/text-base/Vector2.inl.svn-base b/include/SFML/System/.svn/text-base/Vector2.inl.svn-base
new file mode 100644
index 0000000..05f686c
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Vector2.inl.svn-base
@@ -0,0 +1,179 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>::Vector2() :
+x(0),
+y(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Construct the color from its coordinates
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>::Vector2(T X, T Y) :
+x(X),
+y(Y)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; returns the opposite of a vector
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator -(const Vector2<T>& V)
+{
+ return Vector2<T>(-V.x, -V.y);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator += overload ; add two vectors and assign to the first op
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator +=(Vector2<T>& V1, const Vector2<T>& V2)
+{
+ V1.x += V2.x;
+ V1.y += V2.y;
+
+ return V1;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator -= overload ; subtract two vectors and assign to the first op
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator -=(Vector2<T>& V1, const Vector2<T>& V2)
+{
+ V1.x -= V2.x;
+ V1.y -= V2.y;
+
+ return V1;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator + overload ; adds two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator +(const Vector2<T>& V1, const Vector2<T>& V2)
+{
+ return Vector2<T>(V1.x + V2.x, V1.y + V2.y);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; subtracts two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator -(const Vector2<T>& V1, const Vector2<T>& V2)
+{
+ return Vector2<T>(V1.x - V2.x, V1.y - V2.y);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator *(const Vector2<T>& V, T X)
+{
+ return Vector2<T>(V.x * X, V.y * X);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a scalar value by a vector
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator *(T X, const Vector2<T>& V)
+{
+ return Vector2<T>(V.x * X, V.y * X);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator *= overload ; multiply-assign a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator *=(Vector2<T>& V, T X)
+{
+ V.x *= X;
+ V.y *= X;
+
+ return V;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator / overload ; divide a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T> operator /(const Vector2<T>& V, T X)
+{
+ return Vector2<T>(V.x / X, V.y / X);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator /= overload ; divide-assign a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector2<T>& operator /=(Vector2<T>& V, T X)
+{
+ V.x /= X;
+ V.y /= X;
+
+ return V;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator == overload ; compares the equality of two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator ==(const Vector2<T>& V1, const Vector2<T>& V2)
+{
+ return (V1.x == V2.x) && (V1.y == V2.y);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator != overload ; compares the difference of two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator !=(const Vector2<T>& V1, const Vector2<T>& V2)
+{
+ return (V1.x != V2.x) || (V1.y != V2.y);
+}
diff --git a/include/SFML/System/.svn/text-base/Vector3.hpp.svn-base b/include/SFML/System/.svn/text-base/Vector3.hpp.svn-base
new file mode 100644
index 0000000..0174c3f
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Vector3.hpp.svn-base
@@ -0,0 +1,217 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_VECTOR3_HPP
+#define SFML_VECTOR3_HPP
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Vector3 is an utility class for manipulating 3 dimensional
+/// vectors. Template parameter defines the type of coordinates
+/// (integer, float, ...)
+////////////////////////////////////////////////////////////
+template <typename T>
+class Vector3
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the vector from its coordinates
+ ///
+ /// \param X : X coordinate
+ /// \param Y : Y coordinate
+ /// \param Z : Z coordinate
+ ///
+ ////////////////////////////////////////////////////////////
+ Vector3(T X, T Y, T Z);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ T x; ///< X coordinate of the vector
+ T y; ///< Y coordinate of the vector
+ T z; ///< Z coordinate of the vector
+};
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; returns the opposite of a vector
+///
+/// \param V : Vector to negate
+///
+/// \return -V
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator -(const Vector3<T>& V);
+
+////////////////////////////////////////////////////////////
+/// Operator += overload ; add two vectors and assign to the first op
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 + V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator +=(Vector3<T>& V1, const Vector3<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator -= overload ; subtract two vectors and assign to the first op
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 - V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator -=(Vector3<T>& V1, const Vector3<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator + overload ; adds two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 + V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator +(const Vector3<T>& V1, const Vector3<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; subtracts two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return V1 - V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator -(const Vector3<T>& V1, const Vector3<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V * X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator *(const Vector3<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a scalar value by a vector
+///
+/// \param X : Scalar value
+/// \param V : Vector
+///
+/// \return X * V
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator *(T X, const Vector3<T>& V);
+
+////////////////////////////////////////////////////////////
+/// Operator *= overload ; multiply-assign a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V * X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator *=(Vector3<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator / overload ; divide a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V / X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator /(const Vector3<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator /= overload ; divide-assign a vector by a scalar value
+///
+/// \param V : Vector
+/// \param X : Scalar value
+///
+/// \return V / X
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator /=(Vector3<T>& V, T X);
+
+////////////////////////////////////////////////////////////
+/// Operator == overload ; compares the equality of two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return True if V1 is equal to V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator ==(const Vector3<T>& V1, const Vector3<T>& V2);
+
+////////////////////////////////////////////////////////////
+/// Operator != overload ; compares the difference of two vectors
+///
+/// \param V1 : First vector
+/// \param V2 : Second vector
+///
+/// \return True if V1 is different than V2
+///
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator !=(const Vector3<T>& V1, const Vector3<T>& V2);
+
+#include <SFML/System/Vector3.inl>
+
+// Define the most common types
+typedef Vector3<int> Vector3i;
+typedef Vector3<float> Vector3f;
+
+} // namespace sf
+
+
+#endif // SFML_VECTOR3_HPP
diff --git a/include/SFML/System/.svn/text-base/Vector3.inl.svn-base b/include/SFML/System/.svn/text-base/Vector3.inl.svn-base
new file mode 100644
index 0000000..234a01c
--- /dev/null
+++ b/include/SFML/System/.svn/text-base/Vector3.inl.svn-base
@@ -0,0 +1,185 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>::Vector3() :
+x(0),
+y(0),
+z(0)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Construct the color from its coordinates
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>::Vector3(T X, T Y, T Z) :
+x(X),
+y(Y),
+z(Z)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; returns the opposite of a vector
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator -(const Vector3<T>& V)
+{
+ return Vector3<T>(-V.x, -V.y, -V.z);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator += overload ; add two vectors and assign to the first op
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator +=(Vector3<T>& V1, const Vector3<T>& V2)
+{
+ V1.x += V2.x;
+ V1.y += V2.y;
+ V1.z += V2.z;
+
+ return V1;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator -= overload ; subtract two vectors and assign to the first op
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator -=(Vector3<T>& V1, const Vector3<T>& V2)
+{
+ V1.x -= V2.x;
+ V1.y -= V2.y;
+ V1.z -= V2.z;
+
+ return V1;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator + overload ; adds two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator +(const Vector3<T>& V1, const Vector3<T>& V2)
+{
+ return Vector3<T>(V1.x + V2.x, V1.y + V2.y, V1.z + V2.z);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator - overload ; subtracts two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator -(const Vector3<T>& V1, const Vector3<T>& V2)
+{
+ return Vector3<T>(V1.x - V2.x, V1.y - V2.y, V1.z - V2.z);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator *(const Vector3<T>& V, T X)
+{
+ return Vector3<T>(V.x * X, V.y * X, V.z * X);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload ; multiply a scalar value by a vector
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator *(T X, const Vector3<T>& V)
+{
+ return Vector3<T>(V.x * X, V.y * X, V.z * X);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator *= overload ; multiply-assign a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator *=(Vector3<T>& V, T X)
+{
+ V.x *= X;
+ V.y *= X;
+ V.z *= X;
+
+ return V;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator / overload ; divide a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T> operator /(const Vector3<T>& V, T X)
+{
+ return Vector3<T>(V.x / X, V.y / X, V.z / X);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator /= overload ; divide-assign a vector by a scalar value
+////////////////////////////////////////////////////////////
+template <typename T>
+Vector3<T>& operator /=(Vector3<T>& V, T X)
+{
+ V.x /= X;
+ V.y /= X;
+ V.z /= X;
+
+ return V;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator == overload ; compares the equality of two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator ==(const Vector3<T>& V1, const Vector3<T>& V2)
+{
+ return (V1.x == V2.x) && (V1.y == V2.y) && (V1.z == V2.z);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator != overload ; compares the difference of two vectors
+////////////////////////////////////////////////////////////
+template <typename T>
+bool operator !=(const Vector3<T>& V1, const Vector3<T>& V2)
+{
+ return (V1.x != V2.x) || (V1.y != V2.y) || (V1.z != V2.z);
+}
diff --git a/include/SFML/System/Clock.hpp b/include/SFML/System/Clock.hpp
index 4b3cf9a..4b3cf9a 100755..100644
--- a/include/SFML/System/Clock.hpp
+++ b/include/SFML/System/Clock.hpp
diff --git a/include/SFML/System/Lock.hpp b/include/SFML/System/Lock.hpp
index f1176fa..f1176fa 100755..100644
--- a/include/SFML/System/Lock.hpp
+++ b/include/SFML/System/Lock.hpp
diff --git a/include/SFML/System/Mutex.hpp b/include/SFML/System/Mutex.hpp
index 7e096ae..7e096ae 100755..100644
--- a/include/SFML/System/Mutex.hpp
+++ b/include/SFML/System/Mutex.hpp
diff --git a/include/SFML/System/NonCopyable.hpp b/include/SFML/System/NonCopyable.hpp
index 7910444..338653d 100755..100644
--- a/include/SFML/System/NonCopyable.hpp
+++ b/include/SFML/System/NonCopyable.hpp
@@ -31,7 +31,6 @@
#include <SFML/Config.hpp>
-
namespace sf
{
////////////////////////////////////////////////////////////
diff --git a/include/SFML/System/Randomizer.hpp b/include/SFML/System/Randomizer.hpp
index dd453c1..dd453c1 100755..100644
--- a/include/SFML/System/Randomizer.hpp
+++ b/include/SFML/System/Randomizer.hpp
diff --git a/include/SFML/System/Resource.hpp b/include/SFML/System/Resource.hpp
new file mode 100644
index 0000000..8f5088d
--- /dev/null
+++ b/include/SFML/System/Resource.hpp
@@ -0,0 +1,216 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_RESOURCE_HPP
+#define SFML_RESOURCE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <set>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+// These two classes are defined in the same header because
+// they depend on each other. And as they're template classes,
+// they must be entirely defined in header files, which
+// prevents from proper separate compiling
+////////////////////////////////////////////////////////////
+
+template <typename> class ResourcePtr;
+
+////////////////////////////////////////////////////////////
+/// Base class for every resource that needs to notify
+/// dependent classes about its destruction
+////////////////////////////////////////////////////////////
+template <typename T>
+class Resource
+{
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Resource();
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Resource to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ Resource(const Resource<T>& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Resource();
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator
+ ///
+ /// \param Other : Resource to copy
+ ///
+ /// \return Reference to this
+ ///
+ ////////////////////////////////////////////////////////////
+ Resource<T>& operator =(const Resource<T>& Other);
+
+private :
+
+ friend class ResourcePtr<T>;
+
+ ////////////////////////////////////////////////////////////
+ /// Connect a ResourcePtr to this resource
+ ///
+ /// \param Observer : Observer to add
+ ///
+ ////////////////////////////////////////////////////////////
+ void Connect(ResourcePtr<T>& Observer) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Disconnect a ResourcePtr from this resource
+ ///
+ /// \param Observer : Observer to remove
+ ///
+ ////////////////////////////////////////////////////////////
+ void Disconnect(ResourcePtr<T>& Observer) const;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ mutable std::set<ResourcePtr<T>*> myObservers;
+};
+
+
+////////////////////////////////////////////////////////////
+/// Safe pointer to a T resource (inheriting from sf::Resource<T>),
+/// its pointer is automatically reseted when the resource is destroyed
+////////////////////////////////////////////////////////////
+template <typename T>
+class ResourcePtr
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct from a raw resource
+ ///
+ /// \param Resource : Internal resource
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr(const T* Resource);
+
+ ////////////////////////////////////////////////////////////
+ /// Copy constructor
+ ///
+ /// \param Copy : Instance to copy
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr(const ResourcePtr<T>& Copy);
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~ResourcePtr();
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator from another ResourcePtr
+ ///
+ /// \param Other : Resource pointer to assign
+ ///
+ /// \return Reference to this
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr<T>& operator =(const ResourcePtr<T>& Other);
+
+ ////////////////////////////////////////////////////////////
+ /// Assignment operator from a raw resource
+ ///
+ /// \param Resource : Resource to assign
+ ///
+ /// \return Reference to this
+ ///
+ ////////////////////////////////////////////////////////////
+ ResourcePtr<T>& operator =(const T* Resource);
+
+ ////////////////////////////////////////////////////////////
+ /// Cast operator to implicitely convert the resource pointer to
+ /// its raw pointer type.
+ /// This might be dangerous in the general case, but in this context
+ /// it is safe enough to define this operator
+ ///
+ /// \return Pointer to the actual resource
+ ///
+ ////////////////////////////////////////////////////////////
+ operator const T*() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator * overload to return a reference to the actual resource
+ ///
+ /// \return Reference to the internal resource
+ ///
+ ////////////////////////////////////////////////////////////
+ const T& operator *() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Operator -> overload to return a pointer to the actual resource
+ ///
+ /// \return Pointer to the internal resource
+ ///
+ ////////////////////////////////////////////////////////////
+ const T* operator ->() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Function called when the observed resource is about to be
+ /// destroyed
+ ///
+ ////////////////////////////////////////////////////////////
+ void OnResourceDestroyed();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ const T* myResource; /// Pointer to the actual resource
+};
+
+#include <SFML/System/Resource.inl>
+#include <SFML/System/ResourcePtr.inl>
+
+} // namespace sf
+
+
+#endif // SFML_RESOURCE_HPP
diff --git a/include/SFML/System/Resource.inl b/include/SFML/System/Resource.inl
new file mode 100644
index 0000000..c4276a1
--- /dev/null
+++ b/include/SFML/System/Resource.inl
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>::Resource()
+{
+ // Nothing to do
+}
+
+
+////////////////////////////////////////////////////////////
+/// Copy constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>::Resource(const Resource<T>&)
+{
+ // Nothing to do, we don't want to copy observers
+}
+
+
+////////////////////////////////////////////////////////////
+/// Destructor
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>::~Resource()
+{
+ // Notify all observers
+ for (typename std::set<ResourcePtr<T>*>::iterator i = myObservers.begin(); i != myObservers.end(); ++i)
+ {
+ (*i)->OnResourceDestroyed();
+ }
+}
+
+
+////////////////////////////////////////////////////////////
+/// Assignment operator
+////////////////////////////////////////////////////////////
+template <typename T>
+Resource<T>& Resource<T>::operator =(const Resource<T>&)
+{
+ // Nothing to do, we don't want to copy observers
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Connect a ResourcePtr to this resource
+////////////////////////////////////////////////////////////
+template <typename T>
+void Resource<T>::Connect(ResourcePtr<T>& Observer) const
+{
+ myObservers.insert(&Observer);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Disconnect a ResourcePtr from this resource
+////////////////////////////////////////////////////////////
+template <typename T>
+void Resource<T>::Disconnect(ResourcePtr<T>& Observer) const
+{
+ myObservers.erase(&Observer);
+}
diff --git a/include/SFML/System/ResourcePtr.inl b/include/SFML/System/ResourcePtr.inl
new file mode 100644
index 0000000..dbfcd0d
--- /dev/null
+++ b/include/SFML/System/ResourcePtr.inl
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Default constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::ResourcePtr() :
+myResource(NULL)
+{
+
+}
+
+
+////////////////////////////////////////////////////////////
+/// Construct from a raw resource
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::ResourcePtr(const T* Resource) :
+myResource(Resource)
+{
+ if (myResource)
+ myResource->Connect(*this);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Copy constructor
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::ResourcePtr(const ResourcePtr<T>& Copy) :
+myResource(Copy.myResource)
+{
+ if (myResource)
+ myResource->Connect(*this);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Destructor
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::~ResourcePtr()
+{
+ if (myResource)
+ myResource->Disconnect(*this);
+}
+
+
+////////////////////////////////////////////////////////////
+/// Assignment operator from another ResourcePtr
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>& ResourcePtr<T>::operator =(const ResourcePtr<T>& Other)
+{
+ if (myResource)
+ myResource->Disconnect(*this);
+
+ myResource = Other.myResource;
+
+ if (myResource)
+ myResource->Connect(*this);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Assignment operator from a raw resource
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>& ResourcePtr<T>::operator =(const T* Resource)
+{
+ if (myResource)
+ myResource->Disconnect(*this);
+
+ myResource = Resource;
+
+ if (myResource)
+ myResource->Connect(*this);
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Cast operator to implicitely convert the resource pointer to
+/// its raw pointer type.
+/// This might be dangerous in the general case, but in this context
+/// it is safe enough to define this operator
+////////////////////////////////////////////////////////////
+template <typename T>
+ResourcePtr<T>::operator const T*() const
+{
+ return myResource;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator * overload to return a reference to the actual resource
+////////////////////////////////////////////////////////////
+template <typename T>
+const T& ResourcePtr<T>::operator *() const
+{
+ return *myResource;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Operator -> overload to return a pointer to the actual resource
+////////////////////////////////////////////////////////////
+template <typename T>
+const T* ResourcePtr<T>::operator ->() const
+{
+ return myResource;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Function called when the observed resource is about to be
+/// destroyed
+////////////////////////////////////////////////////////////
+template <typename T>
+void ResourcePtr<T>::OnResourceDestroyed()
+{
+ myResource = NULL;
+}
diff --git a/include/SFML/System/Sleep.hpp b/include/SFML/System/Sleep.hpp
index 8cc23f5..8cc23f5 100755..100644
--- a/include/SFML/System/Sleep.hpp
+++ b/include/SFML/System/Sleep.hpp
diff --git a/include/SFML/System/Thread.hpp b/include/SFML/System/Thread.hpp
index 016dab7..016dab7 100755..100644
--- a/include/SFML/System/Thread.hpp
+++ b/include/SFML/System/Thread.hpp
diff --git a/include/SFML/System/Unicode.hpp b/include/SFML/System/Unicode.hpp
new file mode 100644
index 0000000..f7208e8
--- /dev/null
+++ b/include/SFML/System/Unicode.hpp
@@ -0,0 +1,290 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_UNICODE_HPP
+#define SFML_UNICODE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <iterator>
+#include <locale>
+#include <string>
+#include <stdlib.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Provides utility functions to convert from and to
+/// any unicode and ASCII encoding
+////////////////////////////////////////////////////////////
+class SFML_API Unicode
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Define a string type for each encoding
+ /// Warning : in UTF8 and UTF16 strings, one element doesn't
+ /// necessarily maps to one character ; only an UTF32 element
+ /// is wide enough to hold all possible unicode values
+ ////////////////////////////////////////////////////////////
+ typedef std::basic_string<Uint8> UTF8String;
+ typedef std::basic_string<Uint16> UTF16String;
+ typedef std::basic_string<Uint32> UTF32String;
+
+ ////////////////////////////////////////////////////////////
+ /// This class is an abstract definition of a unicode text,
+ /// it can be converted from and to any kind of string
+ /// and encoding
+ ////////////////////////////////////////////////////////////
+ class SFML_API Text
+ {
+ public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor (empty text)
+ ///
+ ////////////////////////////////////////////////////////////
+ Text();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the unicode text from any type of string
+ ///
+ /// \param Str : String to convert
+ ///
+ ////////////////////////////////////////////////////////////
+ Text(const char* Str);
+ Text(const wchar_t* Str);
+ Text(const Uint8* Str);
+ Text(const Uint16* Str);
+ Text(const Uint32* Str);
+ Text(const std::string& Str);
+ Text(const std::wstring& Str);
+ Text(const Unicode::UTF8String& Str);
+ Text(const Unicode::UTF16String& Str);
+ Text(const Unicode::UTF32String& Str);
+
+ ////////////////////////////////////////////////////////////
+ /// Operator to cast the text to any type of string
+ ///
+ /// \return Converted string
+ ///
+ ////////////////////////////////////////////////////////////
+ operator std::string () const;
+ operator std::wstring () const;
+ operator Unicode::UTF8String () const;
+ operator Unicode::UTF16String () const;
+ operator const Unicode::UTF32String&() const;
+
+ private :
+
+ ////////////////////////////////////////////////////////////
+ // Data member
+ ////////////////////////////////////////////////////////////
+ sf::Unicode::UTF32String myUTF32String; ///< UTF-32 unicode text
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-32 characters range
+ /// to an ANSI characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ /// \param Locale : Locale to use for conversion (uses the current one by default)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF32ToANSI(In Begin, In End, Out Output, char Replacement = '?', const std::locale& Locale = GetDefaultLocale());
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an ANSI characters range
+ /// to an UTF-32 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Locale : Locale to use for conversion (uses the current one by default)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out ANSIToUTF32(In Begin, In End, Out Output, const std::locale& Locale = GetDefaultLocale());
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-8 characters range
+ /// to an UTF-16 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-8 characters range
+ /// to an UTF-32 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-16 characters range
+ /// to an UTF-8 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF16ToUTF8(In Begin, In End, Out Output, Uint8 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-16 characters range
+ /// to an UTF-32 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF16ToUTF32(In Begin, In End, Out Output, Uint32 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-32 characters range
+ /// to an UTF-8 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF32ToUTF8(In Begin, In End, Out Output, Uint8 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Generic function to convert an UTF-32 characters range
+ /// to an UTF-16 characters range, using the given locale
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ /// \param Output : Iterator pointing to the beginning of the output sequence
+ /// \param Replacement : Replacement character for characters not convertible to output encoding ('?' by default -- use 0 to use no replacement character)
+ ///
+ /// \return Iterator to the end of the output sequence which has been written
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In, typename Out>
+ static Out UTF32ToUTF16(In Begin, In End, Out Output, Uint16 Replacement = '?');
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of characters composing an UTF-8 string
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ ///
+ /// \return Count of the characters in the string
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t GetUTF8Length(In Begin, In End);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of characters composing an UTF-16 string
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ ///
+ /// \return Count of the characters in the string
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t GetUTF16Length(In Begin, In End);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the number of characters composing an UTF-32 string
+ ///
+ /// \param Begin : Iterator pointing to the beginning of the input sequence
+ /// \param End : Iterator pointing to the end of the input sequence
+ ///
+ /// \return Count of the characters in the string
+ ///
+ ////////////////////////////////////////////////////////////
+ template <typename In>
+ static std::size_t GetUTF32Length(In Begin, In End);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Get the default system locale
+ ///
+ /// \return Reference to the default system locale
+ ///
+ ////////////////////////////////////////////////////////////
+ static const std::locale& GetDefaultLocale();
+
+ ////////////////////////////////////////////////////////////
+ // Static data member
+ ////////////////////////////////////////////////////////////
+ static const char UTF8TrailingBytes[256]; ///< Lookup table to find the length of an UTF-8 sequence
+ static const Uint32 UTF8Offsets[6]; ///< Magic values to subtract during UTF-8 conversions
+ static const Uint8 UTF8FirstBytes[7]; ///< First bytes for UTF-8 sequences
+};
+
+#include <SFML/System/Unicode.inl>
+
+} // namespace sf
+
+
+#endif // SFML_UNICODE_HPP
diff --git a/include/SFML/System/Unicode.inl b/include/SFML/System/Unicode.inl
new file mode 100644
index 0000000..2dbb3a2
--- /dev/null
+++ b/include/SFML/System/Unicode.inl
@@ -0,0 +1,474 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-32 characters range
+/// to an ANSI characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF32ToANSI(In Begin, In End, Out Output, char Replacement, const std::locale& Locale)
+{
+ #ifdef __MINGW32__
+
+ // MinGW has a almost no support for unicode stuff
+ // As a consequence, the MinGW version of this function can only use the default locale
+ // and ignores the one passed as parameter
+ while (Begin < End)
+ {
+ char Char = 0;
+ if (wctomb(&Char, static_cast<wchar_t>(*Begin++)) >= 0)
+ *Output++ = Char;
+ else if (Replacement)
+ *Output++ = Replacement;
+ }
+
+ #else
+
+ // Get the facet of the locale which deals with character conversion
+ const std::ctype<wchar_t>& Facet = std::use_facet< std::ctype<wchar_t> >(Locale);
+
+ // Use the facet to convert each character of the input string
+ while (Begin < End)
+ *Output++ = Facet.narrow(static_cast<wchar_t>(*Begin++), Replacement);
+
+ #endif
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an ANSI characters range
+/// to an UTF-32 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::ANSIToUTF32(In Begin, In End, Out Output, const std::locale& Locale)
+{
+ #ifdef __MINGW32__
+
+ // MinGW has a almost no support for unicode stuff
+ // As a consequence, the MinGW version of this function can only use the default locale
+ // and ignores the one passed as parameter
+ while (Begin < End)
+ {
+ wchar_t Char = 0;
+ mbtowc(&Char, &*Begin, 1);
+ Begin++;
+ *Output++ = static_cast<Uint32>(Char);
+ }
+
+ #else
+
+ // Get the facet of the locale which deals with character conversion
+ const std::ctype<wchar_t>& Facet = std::use_facet< std::ctype<wchar_t> >(Locale);
+
+ // Use the facet to convert each character of the input string
+ while (Begin < End)
+ *Output++ = static_cast<Uint32>(Facet.widen(*Begin++));
+
+ #endif
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-8 characters range
+/// to an UTF-16 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = 0;
+ int TrailingBytes = UTF8TrailingBytes[*Begin];
+ if (Begin + TrailingBytes < End)
+ {
+ // First decode the UTF-8 character
+ switch (TrailingBytes)
+ {
+ case 5 : c += *Begin++; c <<= 6;
+ case 4 : c += *Begin++; c <<= 6;
+ case 3 : c += *Begin++; c <<= 6;
+ case 2 : c += *Begin++; c <<= 6;
+ case 1 : c += *Begin++; c <<= 6;
+ case 0 : c += *Begin++;
+ }
+ c -= UTF8Offsets[TrailingBytes];
+
+ // Then encode it in UTF-16
+ if (c < 0xFFFF)
+ {
+ // Character can be converted directly to 16 bits, just need to check it's in the valid range
+ if ((c >= 0xD800) && (c <= 0xDFFF))
+ {
+ // Invalid character (this range is reserved)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to 16 bits
+ *Output++ = static_cast<Uint16>(c);
+ }
+ }
+ else if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Character will be converted to 2 UTF-16 elements
+ c -= 0x0010000;
+ *Output++ = static_cast<Uint16>((c >> 10) + 0xD800);
+ *Output++ = static_cast<Uint16>((c & 0x3FFUL) + 0xDC00);
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-8 characters range
+/// to an UTF-32 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = 0;
+ int TrailingBytes = UTF8TrailingBytes[*Begin];
+ if (Begin + TrailingBytes < End)
+ {
+ // First decode the UTF-8 character
+ switch (TrailingBytes)
+ {
+ case 5 : c += *Begin++; c <<= 6;
+ case 4 : c += *Begin++; c <<= 6;
+ case 3 : c += *Begin++; c <<= 6;
+ case 2 : c += *Begin++; c <<= 6;
+ case 1 : c += *Begin++; c <<= 6;
+ case 0 : c += *Begin++;
+ }
+ c -= UTF8Offsets[TrailingBytes];
+
+ // Then write it if valid
+ if ((c < 0xD800) || (c > 0xDFFF))
+ {
+ // Valid UTF-32 character
+ *Output++ = c;
+ }
+ else
+ {
+ // Invalid UTF-32 character
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-16 characters range
+/// to an UTF-8 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF16ToUTF8(In Begin, In End, Out Output, Uint8 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = *Begin++;
+
+ // If it's a surrogate pair, first convert to a single UTF-32 character
+ if ((c >= 0xD800) && (c <= 0xDBFF))
+ {
+ if (Begin < End)
+ {
+ // The second element is valid : convert the two elements to a UTF-32 character
+ Uint32 d = *Begin++;
+ if ((d >= 0xDC00) && (d <= 0xDFFF))
+ c = static_cast<Uint32>(((c - 0xD800) << 10) + (d - 0xDC00) + 0x0010000);
+ }
+ else
+ {
+ // Invalid second element
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ }
+
+ // Then convert to UTF-8
+ if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character
+
+ // Get number of bytes to write
+ int BytesToWrite = 1;
+ if (c < 0x80) BytesToWrite = 1;
+ else if (c < 0x800) BytesToWrite = 2;
+ else if (c < 0x10000) BytesToWrite = 3;
+ else if (c <= 0x0010FFFF) BytesToWrite = 4;
+
+ // Extract bytes to write
+ Uint8 Bytes[4];
+ switch (BytesToWrite)
+ {
+ case 4 : Bytes[3] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 3 : Bytes[2] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 2 : Bytes[1] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 1 : Bytes[0] = static_cast<Uint8> (c | UTF8FirstBytes[BytesToWrite]);
+ }
+
+ // Add them to the output
+ const Uint8* CurByte = Bytes;
+ switch (BytesToWrite)
+ {
+ case 4 : *Output++ = *CurByte++;
+ case 3 : *Output++ = *CurByte++;
+ case 2 : *Output++ = *CurByte++;
+ case 1 : *Output++ = *CurByte++;
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-16 characters range
+/// to an UTF-32 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF16ToUTF32(In Begin, In End, Out Output, Uint32 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint16 c = *Begin++;
+ if ((c >= 0xD800) && (c <= 0xDBFF))
+ {
+ // We have a surrogate pair, ie. a character composed of two elements
+ if (Begin < End)
+ {
+ Uint16 d = *Begin++;
+ if ((d >= 0xDC00) && (d <= 0xDFFF))
+ {
+ // The second element is valid : convert the two elements to a UTF-32 character
+ *Output++ = static_cast<Uint32>(((c - 0xD800) << 10) + (d - 0xDC00) + 0x0010000);
+ }
+ else
+ {
+ // Invalid second element
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ }
+ }
+ else if ((c >= 0xDC00) && (c <= 0xDFFF))
+ {
+ // Invalid character
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to UTF-32
+ *Output++ = static_cast<Uint32>(c);
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-32 characters range
+/// to an UTF-8 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF32ToUTF8(In Begin, In End, Out Output, Uint8 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = *Begin++;
+ if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character
+
+ // Get number of bytes to write
+ int BytesToWrite = 1;
+ if (c < 0x80) BytesToWrite = 1;
+ else if (c < 0x800) BytesToWrite = 2;
+ else if (c < 0x10000) BytesToWrite = 3;
+ else if (c <= 0x0010FFFF) BytesToWrite = 4;
+
+ // Extract bytes to write
+ Uint8 Bytes[4];
+ switch (BytesToWrite)
+ {
+ case 4 : Bytes[3] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 3 : Bytes[2] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 2 : Bytes[1] = static_cast<Uint8>((c | 0x80) & 0xBF); c >>= 6;
+ case 1 : Bytes[0] = static_cast<Uint8> (c | UTF8FirstBytes[BytesToWrite]);
+ }
+
+ // Add them to the output
+ const Uint8* CurByte = Bytes;
+ switch (BytesToWrite)
+ {
+ case 4 : *Output++ = *CurByte++;
+ case 3 : *Output++ = *CurByte++;
+ case 2 : *Output++ = *CurByte++;
+ case 1 : *Output++ = *CurByte++;
+ }
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Generic function to convert an UTF-32 characters range
+/// to an UTF-16 characters range, using the given locale
+////////////////////////////////////////////////////////////
+template <typename In, typename Out>
+inline Out Unicode::UTF32ToUTF16(In Begin, In End, Out Output, Uint16 Replacement)
+{
+ while (Begin < End)
+ {
+ Uint32 c = *Begin++;
+ if (c < 0xFFFF)
+ {
+ // Character can be converted directly to 16 bits, just need to check it's in the valid range
+ if ((c >= 0xD800) && (c <= 0xDFFF))
+ {
+ // Invalid character (this range is reserved)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Valid character directly convertible to 16 bits
+ *Output++ = static_cast<Uint16>(c);
+ }
+ }
+ else if (c > 0x0010FFFF)
+ {
+ // Invalid character (greater than the maximum unicode value)
+ if (Replacement)
+ *Output++ = Replacement;
+ }
+ else
+ {
+ // Character will be converted to 2 UTF-16 elements
+ c -= 0x0010000;
+ *Output++ = static_cast<Uint16>((c >> 10) + 0xD800);
+ *Output++ = static_cast<Uint16>((c & 0x3FFUL) + 0xDC00);
+ }
+ }
+
+ return Output;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the number of characters composing an UTF-8 string
+////////////////////////////////////////////////////////////
+template <typename In>
+inline std::size_t Unicode::GetUTF8Length(In Begin, In End)
+{
+ std::size_t Length = 0;
+ while (Begin < End)
+ {
+ int NbBytes = UTF8TrailingBytes[*Begin];
+ if (Begin + NbBytes < End)
+ ++Length;
+
+ Begin += NbBytes + 1;
+ }
+
+ return Length;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the number of characters composing an UTF-16 string
+////////////////////////////////////////////////////////////
+template <typename In>
+inline std::size_t Unicode::GetUTF16Length(In Begin, In End)
+{
+ std::size_t Length = 0;
+ while (Begin < End)
+ {
+ if ((*Begin >= 0xD800) && (*Begin <= 0xDBFF))
+ {
+ ++Begin;
+ if ((Begin < End) && ((*Begin >= 0xDC00) && (*Begin <= 0xDFFF)))
+ {
+ ++Length;
+ }
+ }
+ else
+ {
+ ++Length;
+ }
+
+ ++Begin;
+ }
+
+ return Length;
+}
+
+
+////////////////////////////////////////////////////////////
+/// Get the number of characters composing an UTF-32 string
+////////////////////////////////////////////////////////////
+template <typename In>
+inline std::size_t Unicode::GetUTF32Length(In Begin, In End)
+{
+ return End - Begin;
+}
diff --git a/include/SFML/System/Unix/.svn/all-wcprops b/include/SFML/System/Unix/.svn/all-wcprops
new file mode 100644
index 0000000..2d27a3a
--- /dev/null
+++ b/include/SFML/System/Unix/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 51
+/svnroot/sfml/!svn/ver/198/include/SFML/System/Unix
+END
+Mutex.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svnroot/sfml/!svn/ver/198/include/SFML/System/Unix/Mutex.hpp
+END
+Thread.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svnroot/sfml/!svn/ver/198/include/SFML/System/Unix/Thread.hpp
+END
diff --git a/include/SFML/System/Unix/.svn/entries b/include/SFML/System/Unix/.svn/entries
new file mode 100644
index 0000000..3f19fdb
--- /dev/null
+++ b/include/SFML/System/Unix/.svn/entries
@@ -0,0 +1,96 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/System/Unix
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2007-08-21T17:42:51.205559Z
+198
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+Mutex.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+ac464103f81a9e76cea6d9f6598939dc
+2007-08-21T17:42:51.205559Z
+198
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2817
+
+Thread.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+c806f0f9d024d8704cff64de49137568
+2007-08-21T17:42:51.205559Z
+198
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4435
+
diff --git a/include/SFML/System/Unix/.svn/format b/include/SFML/System/Unix/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/System/Unix/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/System/Unix/.svn/text-base/Mutex.hpp.svn-base b/include/SFML/System/Unix/.svn/text-base/Mutex.hpp.svn-base
new file mode 100644
index 0000000..f8f24b6
--- /dev/null
+++ b/include/SFML/System/Unix/.svn/text-base/Mutex.hpp.svn-base
@@ -0,0 +1,82 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MUTEXUNIX_HPP
+#define SFML_MUTEXUNIX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <pthread.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Mutex defines a mutex (MUTual EXclusion) object,
+/// that allows a thread to lock critical instructions
+/// to avoid simultaneous access with other threads.
+/// See Lock for an efficient way of using it.
+////////////////////////////////////////////////////////////
+class SFML_API Mutex : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Mutex();
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Mutex();
+
+ ////////////////////////////////////////////////////////////
+ /// Lock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void Lock();
+
+ ////////////////////////////////////////////////////////////
+ /// Unlock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void Unlock();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ pthread_mutex_t myMutex; ///< pthread instance of the mutex
+};
+
+} // namespace sf
+
+
+#endif // SFML_MUTEXUNIX_HPP
diff --git a/include/SFML/System/Unix/.svn/text-base/Thread.hpp.svn-base b/include/SFML/System/Unix/.svn/text-base/Thread.hpp.svn-base
new file mode 100644
index 0000000..b26d38f
--- /dev/null
+++ b/include/SFML/System/Unix/.svn/text-base/Thread.hpp.svn-base
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREADUNIX_HPP
+#define SFML_THREADUNIX_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <pthread.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Thread defines a thread.
+/// There is two ways to use Thread :
+/// - Inherit from it and override the Run() virtual function
+/// - Construct a sfThread instance and pass it a function
+/// pointer to call
+////////////////////////////////////////////////////////////
+class SFML_API Thread : NonCopyable
+{
+public :
+
+ typedef void (*FuncType)(void*);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the thread from a function pointer
+ ///
+ /// \param Function : Entry point of the thread
+ /// \param UserData : Data to pass to the thread function (NULL by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Thread(FuncType Function, void* UserData = NULL);
+
+ ////////////////////////////////////////////////////////////
+ /// Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~Thread();
+
+ ////////////////////////////////////////////////////////////
+ /// Create and run the thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void Launch();
+
+ ////////////////////////////////////////////////////////////
+ /// Wait until the thread finishes
+ ///
+ ////////////////////////////////////////////////////////////
+ void Wait();
+
+ ////////////////////////////////////////////////////////////
+ /// Terminate the thread
+ /// Terminating a thread with this function is not safe,
+ /// you should rather try to make the thread function
+ /// terminate by itself
+ ///
+ ////////////////////////////////////////////////////////////
+ void Terminate();
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Thread();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Function called as the thread entry point
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Run();
+
+ ////////////////////////////////////////////////////////////
+ /// Actual thread entry point, dispatches to instances
+ ///
+ /// \param UserData : Data to pass to the thread function
+ ///
+ /// \return Error code
+ ///
+ ////////////////////////////////////////////////////////////
+ static void* ThreadFunc(void* UserData);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ pthread_t myThread; ///< Unix thread instance
+ bool myIsActive; ///< Thread state (active or inactive)
+ FuncType myFunction; ///< Function to call as the thread entry point
+ void* myUserData; ///< Data to pass to the thread function
+};
+
+} // namespace sf
+
+
+#endif // SFML_THREADUNIX_HPP
diff --git a/include/SFML/System/Unix/Mutex.hpp b/include/SFML/System/Unix/Mutex.hpp
index f8f24b6..f8f24b6 100755..100644
--- a/include/SFML/System/Unix/Mutex.hpp
+++ b/include/SFML/System/Unix/Mutex.hpp
diff --git a/include/SFML/System/Unix/Thread.hpp b/include/SFML/System/Unix/Thread.hpp
index b26d38f..b26d38f 100755..100644
--- a/include/SFML/System/Unix/Thread.hpp
+++ b/include/SFML/System/Unix/Thread.hpp
diff --git a/include/SFML/System/Vector2.hpp b/include/SFML/System/Vector2.hpp
index f6a18ab..f6a18ab 100755..100644
--- a/include/SFML/System/Vector2.hpp
+++ b/include/SFML/System/Vector2.hpp
diff --git a/include/SFML/System/Vector2.inl b/include/SFML/System/Vector2.inl
index 05f686c..05f686c 100755..100644
--- a/include/SFML/System/Vector2.inl
+++ b/include/SFML/System/Vector2.inl
diff --git a/include/SFML/System/Vector3.hpp b/include/SFML/System/Vector3.hpp
index 0174c3f..0174c3f 100755..100644
--- a/include/SFML/System/Vector3.hpp
+++ b/include/SFML/System/Vector3.hpp
diff --git a/include/SFML/System/Vector3.inl b/include/SFML/System/Vector3.inl
index 234a01c..234a01c 100755..100644
--- a/include/SFML/System/Vector3.inl
+++ b/include/SFML/System/Vector3.inl
diff --git a/include/SFML/System/Win32/.svn/all-wcprops b/include/SFML/System/Win32/.svn/all-wcprops
new file mode 100644
index 0000000..6e8de8d
--- /dev/null
+++ b/include/SFML/System/Win32/.svn/all-wcprops
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Win32
+END
+Mutex.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Win32/Mutex.hpp
+END
+Thread.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svnroot/sfml/!svn/ver/434/include/SFML/System/Win32/Thread.hpp
+END
diff --git a/include/SFML/System/Win32/.svn/entries b/include/SFML/System/Win32/.svn/entries
new file mode 100644
index 0000000..276b90d
--- /dev/null
+++ b/include/SFML/System/Win32/.svn/entries
@@ -0,0 +1,96 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/System/Win32
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+Mutex.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+c0a4978644d5fd4138c54b41dd97a7ef
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2910
+
+Thread.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+cedf1790e09cb2447c9040ba474ab9b8
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4415
+
diff --git a/include/SFML/System/Win32/.svn/format b/include/SFML/System/Win32/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/System/Win32/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/System/Win32/.svn/text-base/Mutex.hpp.svn-base b/include/SFML/System/Win32/.svn/text-base/Mutex.hpp.svn-base
new file mode 100644
index 0000000..6d84cc5
--- /dev/null
+++ b/include/SFML/System/Win32/.svn/text-base/Mutex.hpp.svn-base
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_MUTEXWIN32_HPP
+#define SFML_MUTEXWIN32_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <windows.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Mutex defines a mutex (MUTual EXclusion) object,
+/// that allows a thread to lock critical instructions
+/// to avoid simultaneous access with other threads.
+/// The Win32 version uses critical sections, as it is
+/// faster than mutexes.<br/>
+/// See Lock for an efficient way of using it.
+////////////////////////////////////////////////////////////
+class SFML_API Mutex : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Mutex();
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Mutex();
+
+ ////////////////////////////////////////////////////////////
+ /// Lock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void Lock();
+
+ ////////////////////////////////////////////////////////////
+ /// Unlock the mutex
+ ///
+ ////////////////////////////////////////////////////////////
+ void Unlock();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ CRITICAL_SECTION myHandle; ///< Win32 handle of the mutex
+};
+
+} // namespace sf
+
+
+#endif // SFML_MUTEXWIN32_HPP
diff --git a/include/SFML/System/Win32/.svn/text-base/Thread.hpp.svn-base b/include/SFML/System/Win32/.svn/text-base/Thread.hpp.svn-base
new file mode 100644
index 0000000..c1a0ac9
--- /dev/null
+++ b/include/SFML/System/Win32/.svn/text-base/Thread.hpp.svn-base
@@ -0,0 +1,123 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_THREADWIN32_HPP
+#define SFML_THREADWIN32_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/System/NonCopyable.hpp>
+#include <windows.h>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Thread defines an easy way to manipulate a thread.
+/// There are two ways to use Thread :
+/// - Inherit from it and override the Run() virtual function
+/// - Construct a Thread instance and pass it a function
+/// pointer to call
+////////////////////////////////////////////////////////////
+class SFML_API Thread : NonCopyable
+{
+public :
+
+ typedef void (*FuncType)(void*);
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the thread from a function pointer
+ ///
+ /// \param Function : Entry point of the thread
+ /// \param UserData : Data to pass to the thread function (NULL by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ Thread(FuncType Function, void* UserData = NULL);
+
+ ////////////////////////////////////////////////////////////
+ /// Virtual destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~Thread();
+
+ ////////////////////////////////////////////////////////////
+ /// Create and run the thread
+ ///
+ ////////////////////////////////////////////////////////////
+ void Launch();
+
+ ////////////////////////////////////////////////////////////
+ /// Wait until the thread finishes
+ ///
+ ////////////////////////////////////////////////////////////
+ void Wait();
+
+ ////////////////////////////////////////////////////////////
+ /// Terminate the thread
+ /// Terminating a thread with this function is not safe,
+ /// you should rather try to make the thread function
+ /// terminate by itself
+ ///
+ ////////////////////////////////////////////////////////////
+ void Terminate();
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Thread();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Function called as the thread entry point
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void Run();
+
+ ////////////////////////////////////////////////////////////
+ /// Actual thread entry point, dispatches to instances
+ ///
+ /// \param UserData : Data to pass to the thread function
+ ///
+ /// \return Error code
+ ///
+ ////////////////////////////////////////////////////////////
+ static unsigned int __stdcall ThreadFunc(void* UserData);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ HANDLE myHandle; ///< Win32 thread handle
+ FuncType myFunction; ///< Function to call as the thread entry point
+ void* myUserData; ///< Data to pass to the thread function
+};
+
+} // namespace sf
+
+
+#endif // SFML_THREADWIN32_HPP
diff --git a/include/SFML/System/Win32/Mutex.hpp b/include/SFML/System/Win32/Mutex.hpp
index 6d84cc5..6d84cc5 100755..100644
--- a/include/SFML/System/Win32/Mutex.hpp
+++ b/include/SFML/System/Win32/Mutex.hpp
diff --git a/include/SFML/System/Win32/Thread.hpp b/include/SFML/System/Win32/Thread.hpp
index c1a0ac9..c1a0ac9 100755..100644
--- a/include/SFML/System/Win32/Thread.hpp
+++ b/include/SFML/System/Win32/Thread.hpp
diff --git a/include/SFML/Window.hpp b/include/SFML/Window.hpp
index 2b5ed49..a73ff1b 100755..100644
--- a/include/SFML/Window.hpp
+++ b/include/SFML/Window.hpp
@@ -30,6 +30,7 @@
////////////////////////////////////////////////////////////
#include <SFML/System.hpp>
+#include <SFML/Window/Context.hpp>
#include <SFML/Window/Event.hpp>
#include <SFML/Window/Input.hpp>
#include <SFML/Window/VideoMode.hpp>
diff --git a/include/SFML/Window/.svn/all-wcprops b/include/SFML/Window/.svn/all-wcprops
new file mode 100644
index 0000000..3acb4eb
--- /dev/null
+++ b/include/SFML/Window/.svn/all-wcprops
@@ -0,0 +1,65 @@
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/svnroot/sfml/!svn/ver/901/include/SFML/Window
+END
+VideoMode.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svnroot/sfml/!svn/ver/434/include/SFML/Window/VideoMode.hpp
+END
+WindowListener.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svnroot/sfml/!svn/ver/434/include/SFML/Window/WindowListener.hpp
+END
+Input.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svnroot/sfml/!svn/ver/824/include/SFML/Window/Input.hpp
+END
+Event.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svnroot/sfml/!svn/ver/812/include/SFML/Window/Event.hpp
+END
+WindowHandle.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svnroot/sfml/!svn/ver/520/include/SFML/Window/WindowHandle.hpp
+END
+Context.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svnroot/sfml/!svn/ver/901/include/SFML/Window/Context.hpp
+END
+OpenGL.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/652/include/SFML/Window/OpenGL.hpp
+END
+Window.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svnroot/sfml/!svn/ver/859/include/SFML/Window/Window.hpp
+END
+WindowSettings.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svnroot/sfml/!svn/ver/679/include/SFML/Window/WindowSettings.hpp
+END
+WindowStyle.hpp
+K 25
+svn:wc:ra_dav:version-url
+V 62
+/svnroot/sfml/!svn/ver/496/include/SFML/Window/WindowStyle.hpp
+END
diff --git a/include/SFML/Window/.svn/entries b/include/SFML/Window/.svn/entries
new file mode 100644
index 0000000..b0dc51b
--- /dev/null
+++ b/include/SFML/Window/.svn/entries
@@ -0,0 +1,368 @@
+9
+
+dir
+915
+https://sfml.svn.sourceforge.net/svnroot/sfml/include/SFML/Window
+https://sfml.svn.sourceforge.net/svnroot/sfml
+
+
+
+2008-10-09T19:07:22.925297Z
+901
+laurentgom
+
+
+svn:special svn:externals svn:needs-lock
+
+
+
+
+
+
+
+
+
+
+
+4e206d99-4929-0410-ac5d-dfc041789085
+
+VideoMode.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+b0019e248f50535875c76844f886916d
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5118
+
+WindowListener.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+d4ed84c715ce4fe981e3ee12cedac4cc
+2008-01-23T16:10:18.126022Z
+434
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2269
+
+Input.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+306eb9e6dc1e3292de913563b74408f1
+2008-08-24T15:29:46.762411Z
+824
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5177
+
+Event.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+9e826ebb4f3a271ac1fc6d651914713a
+2008-08-20T15:23:28.983027Z
+812
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7762
+
+WindowHandle.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+a958ed58ba6f9c539ddfbf9f4b69b6dc
+2008-03-19T16:02:24.006249Z
+520
+ceylo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1965
+
+Context.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+7d006fa7f23517eca9859e356fb95463
+2008-10-09T19:07:22.925297Z
+901
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3470
+
+OpenGL.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+b77a7ea1e483207bff244543bcac0a08
+2008-05-15T16:49:04.685797Z
+652
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1678
+
+Window.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+498001836062a7b1f066c227c34c31b9
+2008-09-07T16:48:20.213384Z
+859
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+13158
+
+WindowSettings.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+6995a70ea0d94e9989bb34727d78f019
+2008-05-19T09:21:14.650459Z
+679
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2446
+
+WindowStyle.hpp
+file
+
+
+
+
+2008-11-01T16:23:32.000000Z
+965012553527b7664de9894d86a12124
+2008-03-14T11:17:36.597700Z
+496
+laurentgom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1896
+
diff --git a/include/SFML/Window/.svn/format b/include/SFML/Window/.svn/format
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/include/SFML/Window/.svn/format
@@ -0,0 +1 @@
+9
diff --git a/include/SFML/Window/.svn/text-base/Context.hpp.svn-base b/include/SFML/Window/.svn/text-base/Context.hpp.svn-base
new file mode 100644
index 0000000..2335afb
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/Context.hpp.svn-base
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_CONTEXT_HPP
+#define SFML_CONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/NonCopyable.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+ class WindowImpl;
+}
+
+////////////////////////////////////////////////////////////
+/// Class wrapping an OpenGL context.
+/// All SFML windows already have their own context, so
+/// this class is more a helper for specific issues involving
+/// OpenGL and multi-threading.
+/// It's meant to be used internally.
+////////////////////////////////////////////////////////////
+class SFML_API Context : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor, create the context
+ ///
+ ////////////////////////////////////////////////////////////
+ Context();
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor, destroy the context
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Context();
+
+ ////////////////////////////////////////////////////////////
+ /// Activate or deactivate the context
+ ///
+ /// \param Active : True to activate the context, false to deactivate it
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetActive(bool Active);
+
+ ////////////////////////////////////////////////////////////
+ /// Check if there's a context bound to the current thread
+ ///
+ /// \return True if there's a context bound to the current thread
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool IsContextActive();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the global context
+ ///
+ /// \return Reference to the global context
+ ///
+ ////////////////////////////////////////////////////////////
+ static Context& GetGlobal();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ priv::WindowImpl* myDummyWindow; ///< Dummy window holding the context
+};
+
+} // namespace sf
+
+
+#endif // SFML_CONTEXT_HPP
diff --git a/include/SFML/Window/.svn/text-base/Event.hpp.svn-base b/include/SFML/Window/.svn/text-base/Event.hpp.svn-base
new file mode 100644
index 0000000..dd9814e
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/Event.hpp.svn-base
@@ -0,0 +1,313 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_EVENT_HPP
+#define SFML_EVENT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Definition of key codes for keyboard events
+////////////////////////////////////////////////////////////
+namespace Key
+{
+ enum Code
+ {
+ A = 'a',
+ B = 'b',
+ C = 'c',
+ D = 'd',
+ E = 'e',
+ F = 'f',
+ G = 'g',
+ H = 'h',
+ I = 'i',
+ J = 'j',
+ K = 'k',
+ L = 'l',
+ M = 'm',
+ N = 'n',
+ O = 'o',
+ P = 'p',
+ Q = 'q',
+ R = 'r',
+ S = 's',
+ T = 't',
+ U = 'u',
+ V = 'v',
+ W = 'w',
+ X = 'x',
+ Y = 'y',
+ Z = 'z',
+ Num0 = '0',
+ Num1 = '1',
+ Num2 = '2',
+ Num3 = '3',
+ Num4 = '4',
+ Num5 = '5',
+ Num6 = '6',
+ Num7 = '7',
+ Num8 = '8',
+ Num9 = '9',
+ Escape = 256,
+ LControl,
+ LShift,
+ LAlt,
+ LSystem, ///< OS specific key (left side) : windows (Win and Linux), apple (MacOS), ...
+ RControl,
+ RShift,
+ RAlt,
+ RSystem, ///< OS specific key (right side) : windows (Win and Linux), apple (MacOS), ...
+ Menu,
+ LBracket, ///< [
+ RBracket, ///< ]
+ SemiColon, ///< ;
+ Comma, ///< ,
+ Period, ///< .
+ Quote, ///< '
+ Slash, ///< /
+ BackSlash,
+ Tilde, ///< ~
+ Equal, ///< =
+ Dash, ///< -
+ Space,
+ Return,
+ Back,
+ Tab,
+ PageUp,
+ PageDown,
+ End,
+ Home,
+ Insert,
+ Delete,
+ Add, ///< +
+ Subtract, ///< -
+ Multiply, ///< *
+ Divide, ///< /
+ Left, ///< Left arrow
+ Right, ///< Right arrow
+ Up, ///< Up arrow
+ Down, ///< Down arrow
+ Numpad0,
+ Numpad1,
+ Numpad2,
+ Numpad3,
+ Numpad4,
+ Numpad5,
+ Numpad6,
+ Numpad7,
+ Numpad8,
+ Numpad9,
+ F1,
+ F2,
+ F3,
+ F4,
+ F5,
+ F6,
+ F7,
+ F8,
+ F9,
+ F10,
+ F11,
+ F12,
+ F13,
+ F14,
+ F15,
+ Pause,
+
+ Count // For internal use
+ };
+}
+
+
+////////////////////////////////////////////////////////////
+/// Definition of button codes for mouse events
+////////////////////////////////////////////////////////////
+namespace Mouse
+{
+ enum Button
+ {
+ Left,
+ Right,
+ Middle,
+ XButton1,
+ XButton2,
+
+ Count // For internal use
+ };
+}
+
+
+////////////////////////////////////////////////////////////
+/// Definition of joystick axis for joystick events
+////////////////////////////////////////////////////////////
+namespace Joy
+{
+ enum Axis
+ {
+ AxisX,
+ AxisY,
+ AxisZ,
+ AxisR,
+ AxisU,
+ AxisV,
+ AxisPOV,
+
+ Count // For internal use
+ };
+}
+
+
+////////////////////////////////////////////////////////////
+/// Event defines a system event and its parameters
+////////////////////////////////////////////////////////////
+class Event
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Keyboard event parameters
+ ////////////////////////////////////////////////////////////
+ struct KeyEvent
+ {
+ Key::Code Code;
+ bool Alt;
+ bool Control;
+ bool Shift;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Text event parameters
+ ////////////////////////////////////////////////////////////
+ struct TextEvent
+ {
+ Uint32 Unicode;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Mouse move event parameters
+ ////////////////////////////////////////////////////////////
+ struct MouseMoveEvent
+ {
+ int X;
+ int Y;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Mouse buttons events parameters
+ ////////////////////////////////////////////////////////////
+ struct MouseButtonEvent
+ {
+ Mouse::Button Button;
+ int X;
+ int Y;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Mouse wheel events parameters
+ ////////////////////////////////////////////////////////////
+ struct MouseWheelEvent
+ {
+ int Delta;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Joystick axis move event parameters
+ ////////////////////////////////////////////////////////////
+ struct JoyMoveEvent
+ {
+ unsigned int JoystickId;
+ Joy::Axis Axis;
+ float Position;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Joystick buttons events parameters
+ ////////////////////////////////////////////////////////////
+ struct JoyButtonEvent
+ {
+ unsigned int JoystickId;
+ unsigned int Button;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Size events parameters
+ ////////////////////////////////////////////////////////////
+ struct SizeEvent
+ {
+ unsigned int Width;
+ unsigned int Height;
+ };
+
+ ////////////////////////////////////////////////////////////
+ /// Enumeration of the different types of events
+ ////////////////////////////////////////////////////////////
+ enum EventType
+ {
+ Closed,
+ Resized,
+ LostFocus,
+ GainedFocus,
+ TextEntered,
+ KeyPressed,
+ KeyReleased,
+ MouseWheelMoved,
+ MouseButtonPressed,
+ MouseButtonReleased,
+ MouseMoved,
+ MouseEntered,
+ MouseLeft,
+ JoyButtonPressed,
+ JoyButtonReleased,
+ JoyMoved
+ };
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ EventType Type; ///< Type of the event
+
+ union
+ {
+ KeyEvent Key;
+ TextEvent Text;
+ MouseMoveEvent MouseMove;
+ MouseButtonEvent MouseButton;
+ MouseWheelEvent MouseWheel;
+ JoyMoveEvent JoyMove;
+ JoyButtonEvent JoyButton;
+ SizeEvent Size;
+ };
+};
+
+} // namespace sf
+
+
+#endif // SFML_EVENT_HPP
diff --git a/include/SFML/Window/.svn/text-base/Input.hpp.svn-base b/include/SFML/Window/.svn/text-base/Input.hpp.svn-base
new file mode 100644
index 0000000..4156db2
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/Input.hpp.svn-base
@@ -0,0 +1,134 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_INPUT_HPP
+#define SFML_INPUT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/WindowListener.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Input handles real-time input from keyboard and mouse.
+/// Use it instead of events to handle continuous moves and more
+/// game-friendly inputs
+////////////////////////////////////////////////////////////
+class SFML_API Input : public WindowListener, NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Input();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the state of a key
+ ///
+ /// \param KeyCode : Key to check
+ ///
+ /// \return True if key is down, false if key is up
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsKeyDown(Key::Code KeyCode) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the state of a mouse button
+ ///
+ /// \param Button : Button to check
+ ///
+ /// \return True if button is down, false if button is up
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsMouseButtonDown(Mouse::Button Button) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the state of a joystick button
+ ///
+ /// \param JoyId : Identifier of the joystick to check (0 or 1)
+ /// \param Button : Button to check
+ ///
+ /// \return True if button is down, false if button is up
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsJoystickButtonDown(unsigned int JoyId, unsigned int Button) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the mouse X position
+ ///
+ /// \return Current mouse left position, relative to owner window
+ ///
+ ////////////////////////////////////////////////////////////
+ int GetMouseX() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the mouse Y position
+ ///
+ /// \return Current mouse top position, relative to owner window
+ ///
+ ////////////////////////////////////////////////////////////
+ int GetMouseY() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get a joystick axis position
+ ///
+ /// \param JoyId : Identifier of the joystick to check (0 or 1)
+ /// \param Axis : Axis to get
+ ///
+ /// \return Current axis position, in the range [-100, 100] (except for POV, which is [0, 360])
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetJoystickAxis(unsigned int JoyId, Joy::Axis Axis) const;
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// /see WindowListener::OnEvent
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void OnEvent(const Event& EventReceived);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ bool myKeys[Key::Count]; ///< Array containing the state of all keyboard keys
+ bool myMouseButtons[Mouse::Count]; ///< Array containing the state of all mouse buttons
+ bool myJoystickButtons[2][16]; ///< Array containing the state of all joysticks buttons
+ int myMouseX; ///< Mouse position on X
+ int myMouseY; ///< Mouse position on Y
+ float myJoystickAxis[2][Joy::Count]; ///< Joysticks position on each axis
+};
+
+} // namespace sf
+
+
+#endif // SFML_INPUT_HPP
diff --git a/include/SFML/Window/.svn/text-base/OpenGL.hpp.svn-base b/include/SFML/Window/.svn/text-base/OpenGL.hpp.svn-base
new file mode 100644
index 0000000..56e2623
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/OpenGL.hpp.svn-base
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_OPENGL_HPP
+#define SFML_OPENGL_HPP
+
+
+////////////////////////////////////////////////////////////
+/// This file just includes the OpenGL (GL and GLU) headers,
+/// which have actually different paths on each system
+////////////////////////////////////////////////////////////
+#if defined(SFML_SYSTEM_WINDOWS) || defined(SFML_SYSTEM_LINUX)
+
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+
+#elif defined(SFML_SYSTEM_MACOS)
+
+ #include <OpenGL/gl.h>
+ #include <OpenGL/glu.h>
+
+#endif
+
+
+#endif // SFML_OPENGL_HPP
diff --git a/include/SFML/Window/.svn/text-base/VideoMode.hpp.svn-base b/include/SFML/Window/.svn/text-base/VideoMode.hpp.svn-base
new file mode 100644
index 0000000..955f016
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/VideoMode.hpp.svn-base
@@ -0,0 +1,136 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_VIDEOMODE_HPP
+#define SFML_VIDEOMODE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <cstdlib>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// VideoMode defines a video mode (width, height, bpp, frequency)
+/// and provides static functions for getting modes supported
+/// by the display device
+////////////////////////////////////////////////////////////
+class SFML_API VideoMode
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ VideoMode();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the video mode with its attributes
+ ///
+ /// \param ModeWidth : Width in pixels
+ /// \param ModeHeight : Height in pixels
+ /// \param ModeBpp : Pixel depths in bits per pixel (32 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ VideoMode(unsigned int ModeWidth, unsigned int ModeHeight, unsigned int ModeBpp = 32);
+
+ ////////////////////////////////////////////////////////////
+ /// Get the current desktop video mode
+ ///
+ /// \return Current desktop video mode
+ ///
+ ////////////////////////////////////////////////////////////
+ static VideoMode GetDesktopMode();
+
+ ////////////////////////////////////////////////////////////
+ /// Get a valid video mode
+ /// Index must be in range [0, GetModesCount()[
+ /// Modes are sorted from best to worst
+ ///
+ /// \param Index : Index of video mode to get
+ ///
+ /// \return Corresponding video mode (invalid mode if index is out of range)
+ ///
+ ////////////////////////////////////////////////////////////
+ static VideoMode GetMode(std::size_t Index);
+
+ ////////////////////////////////////////////////////////////
+ /// Get valid video modes count
+ ///
+ /// \return Number of valid video modes available
+ ///
+ ////////////////////////////////////////////////////////////
+ static std::size_t GetModesCount();
+
+ ////////////////////////////////////////////////////////////
+ /// Tell whether or not the video mode is supported
+ ///
+ /// \return True if video mode is supported, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsValid() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator overload -- tell if two video modes are equal
+ ///
+ /// \param Other : Video mode to compare
+ ///
+ /// \return True if modes are equal
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator ==(const VideoMode& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Comparison operator overload -- tell if two video modes are different
+ ///
+ /// \param Other : Video mode to compare
+ ///
+ /// \return True if modes are different
+ ///
+ ////////////////////////////////////////////////////////////
+ bool operator !=(const VideoMode& Other) const;
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int Width; ///< Video mode width, in pixels
+ unsigned int Height; ///< Video mode height, in pixels
+ unsigned int BitsPerPixel; ///< Video mode pixel depth, in bits per pixels
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Get and sort valid video modes
+ ////////////////////////////////////////////////////////////
+ static void InitializeModes();
+};
+
+} // namespace sf
+
+
+#endif // SFML_VIDEOMODE_HPP
diff --git a/include/SFML/Window/.svn/text-base/Window.hpp.svn-base b/include/SFML/Window/.svn/text-base/Window.hpp.svn-base
new file mode 100644
index 0000000..1506b3f
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/Window.hpp.svn-base
@@ -0,0 +1,326 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOW_HPP
+#define SFML_WINDOW_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Window/Event.hpp>
+#include <SFML/Window/Input.hpp>
+#include <SFML/Window/VideoMode.hpp>
+#include <SFML/Window/WindowHandle.hpp>
+#include <SFML/Window/WindowListener.hpp>
+#include <SFML/Window/WindowSettings.hpp>
+#include <SFML/Window/WindowStyle.hpp>
+#include <SFML/System/Clock.hpp>
+#include <SFML/System/NonCopyable.hpp>
+#include <queue>
+#include <string>
+
+
+namespace sf
+{
+namespace priv
+{
+ class WindowImpl;
+}
+
+////////////////////////////////////////////////////////////
+/// Window is a rendering window ; it can create a new window
+/// or connect to an existing one
+////////////////////////////////////////////////////////////
+class SFML_API Window : public WindowListener, NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ ////////////////////////////////////////////////////////////
+ Window();
+
+ ////////////////////////////////////////////////////////////
+ /// Construct a new window
+ ///
+ /// \param Mode : Video mode to use
+ /// \param Title : Title of the window
+ /// \param WindowStyle : Window style (Resize | Close by default)
+ /// \param Params : Creation parameters (see default constructor for default values)
+ ///
+ ////////////////////////////////////////////////////////////
+ Window(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
+
+ ////////////////////////////////////////////////////////////
+ /// Construct the window from an existing control
+ ///
+ /// \param Handle : Platform-specific handle of the control
+ /// \param Params : Creation parameters (see default constructor for default values)
+ ///
+ ////////////////////////////////////////////////////////////
+ Window(WindowHandle Handle, const WindowSettings& Params = WindowSettings());
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~Window();
+
+ ////////////////////////////////////////////////////////////
+ /// Create (or recreate) the window
+ ///
+ /// \param Mode : Video mode to use
+ /// \param Title : Title of the window
+ /// \param WindowStyle : Window style (Resize | Close by default)
+ /// \param Params : Creation parameters (see default constructor for default values)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Create(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
+
+ ////////////////////////////////////////////////////////////
+ /// Create (or recreate) the window from an existing control
+ ///
+ /// \param Handle : Platform-specific handle of the control
+ /// \param Params : Creation parameters (see default constructor for default values)
+ ///
+ ////////////////////////////////////////////////////////////
+ void Create(WindowHandle Handle, const WindowSettings& Params = WindowSettings());
+
+ ////////////////////////////////////////////////////////////
+ /// Close (destroy) the window.
+ /// The sf::Window instance remains valid and you can call
+ /// Create to recreate the window
+ ///
+ ////////////////////////////////////////////////////////////
+ void Close();
+
+ ////////////////////////////////////////////////////////////
+ /// Tell whether or not the window is opened (ie. has been created).
+ /// Note that a hidden window (Show(false))
+ /// will still return true
+ ///
+ /// \return True if the window is opened
+ ///
+ ////////////////////////////////////////////////////////////
+ bool IsOpened() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the width of the rendering region of the window
+ ///
+ /// \return Width in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetWidth() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the height of the rendering region of the window
+ ///
+ /// \return Height in pixels
+ ///
+ ////////////////////////////////////////////////////////////
+ unsigned int GetHeight() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the creation settings of the window
+ ///
+ /// \return Structure containing the creation settings
+ ///
+ ////////////////////////////////////////////////////////////
+ const WindowSettings& GetSettings() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Get the event on top of events stack, if any, and pop it
+ ///
+ /// \param EventReceived : Event to fill, if any
+ ///
+ /// \return True if an event was returned, false if events stack was empty
+ ///
+ ////////////////////////////////////////////////////////////
+ bool GetEvent(Event& EventReceived);
+
+ ////////////////////////////////////////////////////////////
+ /// Enable / disable vertical synchronization
+ ///
+ /// \param Enabled : True to enable v-sync, false to deactivate
+ ///
+ ////////////////////////////////////////////////////////////
+ void UseVerticalSync(bool Enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// Show or hide the mouse cursor
+ ///
+ /// \param Show : True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ void ShowMouseCursor(bool Show);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the position of the mouse cursor
+ ///
+ /// \param Left : Left coordinate of the cursor, relative to the window
+ /// \param Top : Top coordinate of the cursor, relative to the window
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetCursorPosition(unsigned int Left, unsigned int Top);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the position of the window on screen.
+ /// Only works for top-level windows
+ ///
+ /// \param Left : Left position
+ /// \param Top : Top position
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetPosition(int Left, int Top);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the size of the rendering region of the window
+ ///
+ /// \param Width : New width
+ /// \param Height : New height
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetSize(unsigned int Width, unsigned int Height);
+
+ ////////////////////////////////////////////////////////////
+ /// Show or hide the window
+ ///
+ /// \param State : True to show, false to hide
+ ///
+ ////////////////////////////////////////////////////////////
+ void Show(bool State);
+
+ ////////////////////////////////////////////////////////////
+ /// Enable or disable automatic key-repeat.
+ /// Automatic key-repeat is enabled by default
+ ///
+ /// \param Enabled : True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ void EnableKeyRepeat(bool Enabled);
+
+ ////////////////////////////////////////////////////////////
+ /// Change the window's icon
+ ///
+ /// \param Width : Icon's width, in pixels
+ /// \param Height : Icon's height, in pixels
+ /// \param Pixels : Pointer to the pixels in memory, format must be RGBA 32 bits
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetIcon(unsigned int Width, unsigned int Height, const Uint8* Pixels);
+
+ ////////////////////////////////////////////////////////////
+ /// Activate of deactivate the window as the current target
+ /// for rendering
+ ///
+ /// \param Active : True to activate, false to deactivate (true by default)
+ ///
+ /// \return True if operation was successful, false otherwise
+ ///
+ ////////////////////////////////////////////////////////////
+ bool SetActive(bool Active = true) const;
+
+ ////////////////////////////////////////////////////////////
+ /// Display the window on screen
+ ///
+ ////////////////////////////////////////////////////////////
+ void Display();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the input manager of the window
+ ///
+ /// \return Reference to the input
+ ///
+ ////////////////////////////////////////////////////////////
+ const Input& GetInput() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Limit the framerate to a maximum fixed frequency
+ ///
+ /// \param Limit : Framerate limit, in frames per seconds (use 0 to disable limit)
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetFramerateLimit(unsigned int Limit);
+
+ ////////////////////////////////////////////////////////////
+ /// Get time elapsed since last frame
+ ///
+ /// \return Time elapsed, in seconds
+ ///
+ ////////////////////////////////////////////////////////////
+ float GetFrameTime() const;
+
+ ////////////////////////////////////////////////////////////
+ /// Change the joystick threshold, ie. the value below which
+ /// no move event will be generated
+ ///
+ /// \param Threshold : New threshold, in range [0, 100]
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetJoystickThreshold(float Threshold);
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ /// Called after the window has been created
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void OnCreate();
+
+ ////////////////////////////////////////////////////////////
+ /// /see WindowListener::OnEvent
+ ///
+ /// \param EventReceived : Event received
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void OnEvent(const Event& EventReceived);
+
+ ////////////////////////////////////////////////////////////
+ /// Initialize internal window
+ ///
+ /// \param Impl : New internal window implementation
+ ///
+ ////////////////////////////////////////////////////////////
+ void Initialize(priv::WindowImpl* Impl);
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ priv::WindowImpl* myWindow; ///< Platform-specific implementation of window
+ std::queue<Event> myEvents; ///< Queue of received events
+ Input myInput; ///< Input manager connected to window
+ Clock myClock; ///< Clock for measuring the elapsed time between frames
+ WindowSettings mySettings; ///< Creation settings of the window
+ float myLastFrameTime; ///< Time elapsed since last frame
+ bool myIsExternal; ///< Tell whether the window is internal or external (created by SFML or not)
+ unsigned int myFramerateLimit; ///< Current framerate limit
+ int mySetCursorPosX; ///< X coordinate passed to the last call to SetCursorPosition
+ int mySetCursorPosY; ///< Y coordinate passed to the last call to SetCursorPosition
+};
+
+} // namespace sf
+
+
+#endif // SFML_WINDOW_HPP
diff --git a/include/SFML/Window/.svn/text-base/WindowHandle.hpp.svn-base b/include/SFML/Window/.svn/text-base/WindowHandle.hpp.svn-base
new file mode 100644
index 0000000..356a798
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/WindowHandle.hpp.svn-base
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWHANDLE_HPP
+#define SFML_WINDOWHANDLE_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Define a low-level window handle type, specific to
+/// each platform
+////////////////////////////////////////////////////////////
+#if defined(SFML_SYSTEM_WINDOWS)
+
+ // Windows defines a void* handle (HWND)
+ typedef void* WindowHandle;
+
+#elif defined(SFML_SYSTEM_LINUX)
+
+ // Unix - X11 defines an unsigned integer handle (Window)
+ typedef unsigned long WindowHandle;
+
+#elif defined(SFML_SYSTEM_MACOS)
+
+ // OSX - A GrafPort struct defined as WindowRef
+ typedef void* WindowHandle;
+
+#endif
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWHANDLE_HPP
diff --git a/include/SFML/Window/.svn/text-base/WindowListener.hpp.svn-base b/include/SFML/Window/.svn/text-base/WindowListener.hpp.svn-base
new file mode 100644
index 0000000..244f6fe
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/WindowListener.hpp.svn-base
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWLISTENER_HPP
+#define SFML_WINDOWLISTENER_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+
+
+namespace sf
+{
+class Event;
+
+////////////////////////////////////////////////////////////
+/// Base class for classes that want to receive events
+/// from a window (for internal use only)
+////////////////////////////////////////////////////////////
+class SFML_API WindowListener
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Called each time an event is received from attached window
+ ///
+ /// \param EventReceived : Event received
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void OnEvent(const Event& EventReceived) = 0;
+
+protected :
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual ~WindowListener() {}
+};
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWLISTENER_HPP
diff --git a/include/SFML/Window/.svn/text-base/WindowSettings.hpp.svn-base b/include/SFML/Window/.svn/text-base/WindowSettings.hpp.svn-base
new file mode 100644
index 0000000..05e8962
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/WindowSettings.hpp.svn-base
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWSETTINGS_HPP
+#define SFML_WINDOWSETTINGS_HPP
+
+
+namespace sf
+{
+////////////////////////////////////////////////////////////
+/// Structure defining the creation settings of windows
+////////////////////////////////////////////////////////////
+struct WindowSettings
+{
+ ////////////////////////////////////////////////////////////
+ /// Default constructor
+ ///
+ /// \param Depth : Depth buffer bits (24 by default)
+ /// \param Stencil : Stencil buffer bits (8 by default)
+ /// \param Antialiasing : Antialiasing level (0 by default)
+ ///
+ ////////////////////////////////////////////////////////////
+ explicit WindowSettings(unsigned int Depth = 24, unsigned int Stencil = 8, unsigned int Antialiasing = 0) :
+ DepthBits (Depth),
+ StencilBits (Stencil),
+ AntialiasingLevel(Antialiasing)
+ {
+ }
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ unsigned int DepthBits; ///< Bits of the depth buffer
+ unsigned int StencilBits; ///< Bits of the stencil buffer
+ unsigned int AntialiasingLevel; ///< Level of antialiasing
+};
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWSETTINGS_HPP
diff --git a/include/SFML/Window/.svn/text-base/WindowStyle.hpp.svn-base b/include/SFML/Window/.svn/text-base/WindowStyle.hpp.svn-base
new file mode 100644
index 0000000..159b999
--- /dev/null
+++ b/include/SFML/Window/.svn/text-base/WindowStyle.hpp.svn-base
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_WINDOWSTYLE_HPP
+#define SFML_WINDOWSTYLE_HPP
+
+
+namespace sf
+{
+
+////////////////////////////////////////////////////////////
+/// Enumeration of window creation styles
+////////////////////////////////////////////////////////////
+namespace Style
+{
+ enum
+ {
+ None = 0, ///< No border / title bar (this flag and all others are mutually exclusive)
+ Titlebar = 1 << 0, ///< Title bar + fixed border
+ Resize = 1 << 1, ///< Titlebar + resizable border + maximize button
+ Close = 1 << 2, ///< Titlebar + close button
+ Fullscreen = 1 << 3 ///< Fullscreen mode (this flag and all others are mutually exclusive)
+ };
+}
+
+
+} // namespace sf
+
+
+#endif // SFML_WINDOWSTYLE_HPP
diff --git a/include/SFML/Window/Context.hpp b/include/SFML/Window/Context.hpp
new file mode 100644
index 0000000..2335afb
--- /dev/null
+++ b/include/SFML/Window/Context.hpp
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_CONTEXT_HPP
+#define SFML_CONTEXT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include <SFML/Config.hpp>
+#include <SFML/System/NonCopyable.hpp>
+
+
+namespace sf
+{
+namespace priv
+{
+ class WindowImpl;
+}
+
+////////////////////////////////////////////////////////////
+/// Class wrapping an OpenGL context.
+/// All SFML windows already have their own context, so
+/// this class is more a helper for specific issues involving
+/// OpenGL and multi-threading.
+/// It's meant to be used internally.
+////////////////////////////////////////////////////////////
+class SFML_API Context : NonCopyable
+{
+public :
+
+ ////////////////////////////////////////////////////////////
+ /// Default constructor, create the context
+ ///
+ ////////////////////////////////////////////////////////////
+ Context();
+
+ ////////////////////////////////////////////////////////////
+ /// Destructor, destroy the context
+ ///
+ ////////////////////////////////////////////////////////////
+ ~Context();
+
+ ////////////////////////////////////////////////////////////
+ /// Activate or deactivate the context
+ ///
+ /// \param Active : True to activate the context, false to deactivate it
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetActive(bool Active);
+
+ ////////////////////////////////////////////////////////////
+ /// Check if there's a context bound to the current thread
+ ///
+ /// \return True if there's a context bound to the current thread
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool IsContextActive();
+
+ ////////////////////////////////////////////////////////////
+ /// Get the global context
+ ///
+ /// \return Reference to the global context
+ ///
+ ////////////////////////////////////////////////////////////
+ static Context& GetGlobal();
+
+private :
+
+ ////////////////////////////////////////////////////////////
+ // Member data
+ ////////////////////////////////////////////////////////////
+ priv::WindowImpl* myDummyWindow; ///< Dummy window holding the context
+};
+
+} // namespace sf
+
+
+#endif // SFML_CONTEXT_HPP
diff --git a/include/SFML/Window/Event.hpp b/include/SFML/Window/Event.hpp
index 2f03830..dd9814e 100755..100644
--- a/include/SFML/Window/Event.hpp
+++ b/include/SFML/Window/Event.hpp
@@ -208,7 +208,7 @@ public :
////////////////////////////////////////////////////////////
struct TextEvent
{
- Uint16 Unicode;
+ Uint32 Unicode;
};
////////////////////////////////////////////////////////////
@@ -216,8 +216,8 @@ public :
////////////////////////////////////////////////////////////
struct MouseMoveEvent
{
- unsigned int X;
- unsigned int Y;
+ int X;
+ int Y;
};
////////////////////////////////////////////////////////////
@@ -226,6 +226,8 @@ public :
struct MouseButtonEvent
{
Mouse::Button Button;
+ int X;
+ int Y;
};
////////////////////////////////////////////////////////////
@@ -280,6 +282,8 @@ public :
MouseButtonPressed,
MouseButtonReleased,
MouseMoved,
+ MouseEntered,
+ MouseLeft,
JoyButtonPressed,
JoyButtonReleased,
JoyMoved
diff --git a/include/SFML/Window/Input.hpp b/include/SFML/Window/Input.hpp
index 3cbdbc4..4156db2 100755..100644
--- a/include/SFML/Window/Input.hpp
+++ b/include/SFML/Window/Input.hpp
@@ -88,7 +88,7 @@ public :
/// \return Current mouse left position, relative to owner window
///
////////////////////////////////////////////////////////////
- unsigned int GetMouseX() const;
+ int GetMouseX() const;
////////////////////////////////////////////////////////////
/// Get the mouse Y position
@@ -96,7 +96,7 @@ public :
/// \return Current mouse top position, relative to owner window
///
////////////////////////////////////////////////////////////
- unsigned int GetMouseY() const;
+ int GetMouseY() const;
////////////////////////////////////////////////////////////
/// Get a joystick axis position
@@ -112,7 +112,7 @@ public :
private :
////////////////////////////////////////////////////////////
- /// /see sfWindowListener::OnEvent
+ /// /see WindowListener::OnEvent
///
////////////////////////////////////////////////////////////
virtual void OnEvent(const Event& EventReceived);
@@ -120,12 +120,12 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- bool myKeys[Key::Count]; ///< Array containing the state of all keayboard keys
- bool myMouseButtons[Mouse::Count]; ///< Array containing the state of all mouse buttons
- bool myJoystickButtons[2][16]; ///< Array containing the state of all joysticks buttons
- unsigned int myMouseX; ///< Mouse position on X
- unsigned int myMouseY; ///< Mouse position on Y
- float myJoystickAxis[2][Joy::Count]; ///< Joysticks position on each axis
+ bool myKeys[Key::Count]; ///< Array containing the state of all keyboard keys
+ bool myMouseButtons[Mouse::Count]; ///< Array containing the state of all mouse buttons
+ bool myJoystickButtons[2][16]; ///< Array containing the state of all joysticks buttons
+ int myMouseX; ///< Mouse position on X
+ int myMouseY; ///< Mouse position on Y
+ float myJoystickAxis[2][Joy::Count]; ///< Joysticks position on each axis
};
} // namespace sf
diff --git a/include/SFML/Window/OpenGL.hpp b/include/SFML/Window/OpenGL.hpp
index 56e2623..56e2623 100755..100644
--- a/include/SFML/Window/OpenGL.hpp
+++ b/include/SFML/Window/OpenGL.hpp
diff --git a/include/SFML/Window/VideoMode.hpp b/include/SFML/Window/VideoMode.hpp
index 955f016..955f016 100755..100644
--- a/include/SFML/Window/VideoMode.hpp
+++ b/include/SFML/Window/VideoMode.hpp
diff --git a/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp
index 57ca37f..1506b3f 100755..100644
--- a/include/SFML/Window/Window.hpp
+++ b/include/SFML/Window/Window.hpp
@@ -196,6 +196,15 @@ public :
void SetPosition(int Left, int Top);
////////////////////////////////////////////////////////////
+ /// Change the size of the rendering region of the window
+ ///
+ /// \param Width : New width
+ /// \param Height : New height
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetSize(unsigned int Width, unsigned int Height);
+
+ ////////////////////////////////////////////////////////////
/// Show or hide the window
///
/// \param State : True to show, false to hide
@@ -213,6 +222,16 @@ public :
void EnableKeyRepeat(bool Enabled);
////////////////////////////////////////////////////////////
+ /// Change the window's icon
+ ///
+ /// \param Width : Icon's width, in pixels
+ /// \param Height : Icon's height, in pixels
+ /// \param Pixels : Pointer to the pixels in memory, format must be RGBA 32 bits
+ ///
+ ////////////////////////////////////////////////////////////
+ void SetIcon(unsigned int Width, unsigned int Height, const Uint8* Pixels);
+
+ ////////////////////////////////////////////////////////////
/// Activate of deactivate the window as the current target
/// for rendering
///
@@ -262,13 +281,6 @@ public :
////////////////////////////////////////////////////////////
void SetJoystickThreshold(float Threshold);
- ////////////////////////////////////////////////////////////
- /// Force a valid OpenGL context to exist even if
- /// no window has been created
- ///
- ////////////////////////////////////////////////////////////
- static void ForceContextInit();
-
private :
////////////////////////////////////////////////////////////
@@ -278,12 +290,6 @@ private :
virtual void OnCreate();
////////////////////////////////////////////////////////////
- /// Called when the window displays its content on screen
- ///
- ////////////////////////////////////////////////////////////
- virtual void OnDisplay();
-
- ////////////////////////////////////////////////////////////
/// /see WindowListener::OnEvent
///
/// \param EventReceived : Event received
@@ -300,11 +306,6 @@ private :
void Initialize(priv::WindowImpl* Impl);
////////////////////////////////////////////////////////////
- // Static member data
- ////////////////////////////////////////////////////////////
- static priv::WindowImpl* ourDummyWindow; ///< Dummy window used to ensure a valid OpenGL context is created
-
- ////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
priv::WindowImpl* myWindow; ///< Platform-specific implementation of window
diff --git a/include/SFML/Window/WindowHandle.hpp b/include/SFML/Window/WindowHandle.hpp
index 356a798..356a798 100755..100644
--- a/include/SFML/Window/WindowHandle.hpp
+++ b/include/SFML/Window/WindowHandle.hpp
diff --git a/include/SFML/Window/WindowListener.hpp b/include/SFML/Window/WindowListener.hpp
index 244f6fe..244f6fe 100755..100644
--- a/include/SFML/Window/WindowListener.hpp
+++ b/include/SFML/Window/WindowListener.hpp
diff --git a/include/SFML/Window/WindowSettings.hpp b/include/SFML/Window/WindowSettings.hpp
index 05e8962..05e8962 100755..100644
--- a/include/SFML/Window/WindowSettings.hpp
+++ b/include/SFML/Window/WindowSettings.hpp
diff --git a/include/SFML/Window/WindowStyle.hpp b/include/SFML/Window/WindowStyle.hpp
index 159b999..159b999 100755..100644
--- a/include/SFML/Window/WindowStyle.hpp
+++ b/include/SFML/Window/WindowStyle.hpp