diff --git a/build/codeblocks/sfml-window.cbp b/build/codeblocks/sfml-window.cbp
index c7d0358cc..636547d74 100644
--- a/build/codeblocks/sfml-window.cbp
+++ b/build/codeblocks/sfml-window.cbp
@@ -117,19 +117,18 @@
-
-
-
+
+
-
-
+
+
diff --git a/build/vc2005/sfml-window.vcproj b/build/vc2005/sfml-window.vcproj
index b07ad2a13..d3c9d5556 100644
--- a/build/vc2005/sfml-window.vcproj
+++ b/build/vc2005/sfml-window.vcproj
@@ -351,14 +351,6 @@
-
-
-
-
@@ -403,6 +395,14 @@
RelativePath="..\..\src\SFML\Window\Win32\VideoModeImpl.cpp"
>
+
+
+
+
@@ -452,14 +452,6 @@
RelativePath="..\..\include\SFML\Window\Context.hpp"
>
-
-
-
-
@@ -468,6 +460,14 @@
RelativePath="..\..\include\SFML\Window\Event.hpp"
>
+
+
+
+
diff --git a/build/vc2008/sfml-window.vcproj b/build/vc2008/sfml-window.vcproj
index b114297ec..84ea34c9c 100644
--- a/build/vc2008/sfml-window.vcproj
+++ b/build/vc2008/sfml-window.vcproj
@@ -346,14 +346,6 @@
-
-
-
-
@@ -366,6 +358,14 @@
RelativePath="..\..\src\SFML\Window\Win32\VideoModeImpl.cpp"
>
+
+
+
+
@@ -415,14 +415,6 @@
RelativePath="..\..\include\SFML\Window\Context.hpp"
>
-
-
-
-
@@ -431,6 +423,14 @@
RelativePath="..\..\include\SFML\Window\Event.hpp"
>
+
+
+
+
diff --git a/include/SFML/Window/Context.hpp b/include/SFML/Window/Context.hpp
index b191cba4e..d88e749c1 100644
--- a/include/SFML/Window/Context.hpp
+++ b/include/SFML/Window/Context.hpp
@@ -36,7 +36,7 @@ namespace sf
{
namespace priv
{
- class ContextGL;
+ class GlContext;
}
////////////////////////////////////////////////////////////
@@ -88,7 +88,7 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- priv::ContextGL* myContext; ///< Internal OpenGL context
+ priv::GlContext* myContext; ///< Internal OpenGL context
};
} // namespace sf
diff --git a/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp
index 6c75ca737..06fc6ee78 100644
--- a/include/SFML/Window/Window.hpp
+++ b/include/SFML/Window/Window.hpp
@@ -28,10 +28,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
+#include
#include
#include
#include
-#include
#include
#include
#include
@@ -42,8 +42,8 @@ namespace sf
{
namespace priv
{
+ class GlContext;
class WindowImpl;
- class ContextGL;
}
class Event;
@@ -470,7 +470,7 @@ private :
// Member data
////////////////////////////////////////////////////////////
priv::WindowImpl* myWindow; ///< Platform-specific implementation of the window
- priv::ContextGL* myContext; ///< Platform-specific implementation of the OpenGL context
+ priv::GlContext* myContext; ///< Platform-specific implementation of the OpenGL context
Input myInput; ///< Input manager connected to window
Clock myClock; ///< Clock for measuring the elapsed time between frames
float myLastFrameTime; ///< Time elapsed since last frame
diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp
index be53a8d1c..feb46a09e 100644
--- a/src/SFML/Window/Context.cpp
+++ b/src/SFML/Window/Context.cpp
@@ -26,7 +26,7 @@
// Headers
////////////////////////////////////////////////////////////
#include
-#include
+#include
namespace sf
@@ -34,7 +34,7 @@ namespace sf
////////////////////////////////////////////////////////////
Context::Context()
{
- myContext = priv::ContextGL::New();
+ myContext = priv::GlContext::New();
SetActive(true);
}
@@ -57,7 +57,7 @@ void Context::SetActive(bool active)
////////////////////////////////////////////////////////////
bool Context::SetReferenceActive()
{
- return priv::ContextGL::SetReferenceActive();
+ return priv::GlContext::SetReferenceActive();
}
diff --git a/src/SFML/Window/ContextGL.cpp b/src/SFML/Window/GlContext.cpp
similarity index 84%
rename from src/SFML/Window/ContextGL.cpp
rename to src/SFML/Window/GlContext.cpp
index 156aa3e1f..eaee1aedf 100644
--- a/src/SFML/Window/ContextGL.cpp
+++ b/src/SFML/Window/GlContext.cpp
@@ -25,7 +25,7 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include
+#include
#include
#include
#include
@@ -34,18 +34,18 @@
#if defined(SFML_SYSTEM_WINDOWS)
- #include
- typedef sf::priv::ContextWGL ContextType;
+ #include
+ typedef sf::priv::WglContext ContextType;
#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
- #include
- typedef sf::priv::ContextGLX ContextType;
+ #include
+ typedef sf::priv::GlxContext ContextType;
#elif defined(SFML_SYSTEM_MACOS)
- #include
- typedef sf::priv::ContextAGL ContextType;
+ #include
+ typedef sf::priv::AglContext ContextType;
#endif
@@ -56,7 +56,7 @@
namespace
{
// This thread-local variable will hold the "global" context for each thread
- sf::ThreadLocalPtr threadContext(NULL);
+ sf::ThreadLocalPtr threadContext(NULL);
// Now we create two global contexts.
// The first one is the reference context: it will be shared with every other
@@ -73,14 +73,14 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-ContextGL* ContextGL::New()
+GlContext* GlContext::New()
{
return new ContextType(&referenceContext);
}
////////////////////////////////////////////////////////////
-ContextGL* ContextGL::New(const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings)
+GlContext* GlContext::New(const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings)
{
ContextType* context = new ContextType(&referenceContext, owner, bitsPerPixel, settings);
@@ -93,7 +93,7 @@ ContextGL* ContextGL::New(const WindowImpl* owner, unsigned int bitsPerPixel, co
////////////////////////////////////////////////////////////
-ContextGL::~ContextGL()
+GlContext::~GlContext()
{
if (threadContext == this)
{
@@ -108,14 +108,14 @@ ContextGL::~ContextGL()
////////////////////////////////////////////////////////////
-const ContextSettings& ContextGL::GetSettings() const
+const ContextSettings& GlContext::GetSettings() const
{
return mySettings;
}
////////////////////////////////////////////////////////////
-bool ContextGL::SetActive(bool active)
+bool GlContext::SetActive(bool active)
{
if (active)
{
@@ -148,7 +148,7 @@ bool ContextGL::SetActive(bool active)
////////////////////////////////////////////////////////////
-bool ContextGL::SetReferenceActive()
+bool GlContext::SetReferenceActive()
{
if (threadContext)
return threadContext->SetActive(true);
@@ -158,14 +158,14 @@ bool ContextGL::SetReferenceActive()
////////////////////////////////////////////////////////////
-ContextGL::ContextGL()
+GlContext::GlContext()
{
// Nothing to do
}
////////////////////////////////////////////////////////////
-int ContextGL::EvaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing)
+int GlContext::EvaluateFormat(unsigned int bitsPerPixel, const ContextSettings& settings, int colorBits, int depthBits, int stencilBits, int antialiasing)
{
return abs(static_cast(bitsPerPixel - colorBits)) +
abs(static_cast(settings.DepthBits - depthBits)) +
diff --git a/src/SFML/Window/ContextGL.hpp b/src/SFML/Window/GlContext.hpp
similarity index 94%
rename from src/SFML/Window/ContextGL.hpp
rename to src/SFML/Window/GlContext.hpp
index d0b6461c1..c20f484f3 100644
--- a/src/SFML/Window/ContextGL.hpp
+++ b/src/SFML/Window/GlContext.hpp
@@ -22,8 +22,8 @@
//
////////////////////////////////////////////////////////////
-#ifndef SFML_CONTEXTGL_HPP
-#define SFML_CONTEXTGL_HPP
+#ifndef SFML_GLCONTEXT_HPP
+#define SFML_GLCONTEXT_HPP
////////////////////////////////////////////////////////////
// Headers
@@ -43,7 +43,7 @@ class WindowImpl;
/// \brief Abstract class representing an OpenGL context
///
////////////////////////////////////////////////////////////
-class ContextGL : NonCopyable
+class GlContext : NonCopyable
{
public :
@@ -56,7 +56,7 @@ public :
/// \return Pointer to the created context (don't forget to delete it)
///
////////////////////////////////////////////////////////////
- static ContextGL* New();
+ static GlContext* New();
////////////////////////////////////////////////////////////
/// \brief Create a new context attached to a window
@@ -71,7 +71,7 @@ public :
/// \return Pointer to the created context (don't forget to delete it)
///
////////////////////////////////////////////////////////////
- static ContextGL* New(const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings);
+ static GlContext* New(const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings);
public :
@@ -79,7 +79,7 @@ public :
/// \brief Destructor
///
////////////////////////////////////////////////////////////
- virtual ~ContextGL();
+ virtual ~GlContext();
////////////////////////////////////////////////////////////
/// \brief Get the settings of the context
@@ -149,7 +149,7 @@ protected :
/// This constructor is meant for derived classes only.
///
////////////////////////////////////////////////////////////
- ContextGL();
+ GlContext();
////////////////////////////////////////////////////////////
/// \brief Activate the context as the current target
@@ -191,4 +191,4 @@ protected :
} // namespace sf
-#endif // SFML_CONTEXTGL_HPP
+#endif // SFML_GLCONTEXT_HPP
diff --git a/src/SFML/Window/Linux/ContextGLX.cpp b/src/SFML/Window/Linux/GlxContext.cpp
similarity index 94%
rename from src/SFML/Window/Linux/ContextGLX.cpp
rename to src/SFML/Window/Linux/GlxContext.cpp
index 6fce25758..b04bb00ba 100644
--- a/src/SFML/Window/Linux/ContextGLX.cpp
+++ b/src/SFML/Window/Linux/GlxContext.cpp
@@ -26,7 +26,7 @@
// Headers
////////////////////////////////////////////////////////////
#define GLX_GLXEXT_LEGACY // so that our local glxext.h is used instead of the system one
-#include
+#include
#include
#include
#include
@@ -38,7 +38,7 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-ContextGLX::ContextGLX(ContextGLX* shared) :
+GlxContext::GlxContext(GlxContext* shared) :
myWindow (0),
myContext (NULL),
myOwnsWindow(true)
@@ -67,7 +67,7 @@ myOwnsWindow(true)
////////////////////////////////////////////////////////////
-ContextGLX::ContextGLX(ContextGLX* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings) :
+GlxContext::GlxContext(GlxContext* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings) :
myWindow (0),
myContext (NULL),
myOwnsWindow(false)
@@ -88,7 +88,7 @@ myOwnsWindow(false)
////////////////////////////////////////////////////////////
-ContextGLX::~ContextGLX()
+GlxContext::~GlxContext()
{
// Destroy the context
if (myContext)
@@ -114,7 +114,7 @@ ContextGLX::~ContextGLX()
////////////////////////////////////////////////////////////
-bool ContextGLX::MakeCurrent()
+bool GlxContext::MakeCurrent()
{
if (myContext)
{
@@ -131,7 +131,7 @@ bool ContextGLX::MakeCurrent()
////////////////////////////////////////////////////////////
-void ContextGLX::Display()
+void GlxContext::Display()
{
if (myWindow)
glXSwapBuffers(myDisplay, myWindow);
@@ -139,7 +139,7 @@ void ContextGLX::Display()
////////////////////////////////////////////////////////////
-void ContextGLX::UseVerticalSync(bool enabled)
+void GlxContext::UseVerticalSync(bool enabled)
{
const GLubyte* name = reinterpret_cast("glXSwapIntervalSGI");
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = reinterpret_cast(glXGetProcAddress(name));
@@ -149,7 +149,7 @@ void ContextGLX::UseVerticalSync(bool enabled)
////////////////////////////////////////////////////////////
-void ContextGLX::CreateContext(ContextGLX* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
+void GlxContext::CreateContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
{
// Save the creation settings
mySettings = settings;
diff --git a/src/SFML/Window/Linux/ContextGLX.hpp b/src/SFML/Window/Linux/GlxContext.hpp
similarity index 90%
rename from src/SFML/Window/Linux/ContextGLX.hpp
rename to src/SFML/Window/Linux/GlxContext.hpp
index 634458256..96b9621f7 100644
--- a/src/SFML/Window/Linux/ContextGLX.hpp
+++ b/src/SFML/Window/Linux/GlxContext.hpp
@@ -22,13 +22,13 @@
//
////////////////////////////////////////////////////////////
-#ifndef SFML_CONTEXTGLX_HPP
-#define SFML_CONTEXTGLX_HPP
+#ifndef SFML_GLXCONTEXT_HPP
+#define SFML_GLXCONTEXT_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include
+#include
#include
#include
@@ -41,7 +41,7 @@ namespace priv
/// \brief Linux (GLX) implementation of OpenGL contexts
///
////////////////////////////////////////////////////////////
-class ContextGLX : public ContextGL
+class GlxContext : public GlContext
{
public :
@@ -51,7 +51,7 @@ public :
/// \param shared Context to share the new one with (can be NULL)
///
////////////////////////////////////////////////////////////
- ContextGLX(ContextGLX* shared);
+ GlxContext(GlxContext* shared);
////////////////////////////////////////////////////////////
/// \brief Create a new context attached to a window
@@ -62,13 +62,13 @@ public :
/// \param settings Creation parameters
///
////////////////////////////////////////////////////////////
- ContextGLX(ContextGLX* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings);
+ GlxContext(GlxContext* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings);
////////////////////////////////////////////////////////////
/// \brief Destructor
///
////////////////////////////////////////////////////////////
- ~ContextGLX();
+ ~GlxContext();
////////////////////////////////////////////////////////////
/// \brief Activate the context as the current target
@@ -108,7 +108,7 @@ private :
/// \param settings Creation parameters
///
////////////////////////////////////////////////////////////
- void CreateContext(ContextGLX* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
+ void CreateContext(GlxContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
////////////////////////////////////////////////////////////
// Member data
@@ -123,4 +123,4 @@ private :
} // namespace sf
-#endif // SFML_CONTEXTGLX_HPP
+#endif // SFML_GLXCONTEXT_HPP
diff --git a/src/SFML/Window/Win32/ContextWGL.cpp b/src/SFML/Window/Win32/WglContext.cpp
similarity index 94%
rename from src/SFML/Window/Win32/ContextWGL.cpp
rename to src/SFML/Window/Win32/WglContext.cpp
index d1c0422cd..318d784b1 100644
--- a/src/SFML/Window/Win32/ContextWGL.cpp
+++ b/src/SFML/Window/Win32/WglContext.cpp
@@ -25,7 +25,7 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include
+#include
#include
#include
#include
@@ -39,7 +39,7 @@ namespace sf
namespace priv
{
////////////////////////////////////////////////////////////
-ContextWGL::ContextWGL(ContextWGL* shared) :
+WglContext::WglContext(WglContext* shared) :
myWindow (NULL),
myDeviceContext(NULL),
myContext (NULL),
@@ -64,7 +64,7 @@ myOwnsWindow (true)
////////////////////////////////////////////////////////////
-ContextWGL::ContextWGL(ContextWGL* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings) :
+WglContext::WglContext(WglContext* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings) :
myWindow (NULL),
myDeviceContext(NULL),
myContext (NULL),
@@ -84,7 +84,7 @@ myOwnsWindow (false)
////////////////////////////////////////////////////////////
-ContextWGL::~ContextWGL()
+WglContext::~WglContext()
{
// Destroy the OpenGL context
if (myContext)
@@ -105,7 +105,7 @@ ContextWGL::~ContextWGL()
////////////////////////////////////////////////////////////
-bool ContextWGL::MakeCurrent()
+bool WglContext::MakeCurrent()
{
if (myDeviceContext && myContext)
{
@@ -122,7 +122,7 @@ bool ContextWGL::MakeCurrent()
////////////////////////////////////////////////////////////
-void ContextWGL::Display()
+void WglContext::Display()
{
if (myDeviceContext && myContext)
SwapBuffers(myDeviceContext);
@@ -130,7 +130,7 @@ void ContextWGL::Display()
////////////////////////////////////////////////////////////
-void ContextWGL::UseVerticalSync(bool enabled)
+void WglContext::UseVerticalSync(bool enabled)
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = reinterpret_cast(wglGetProcAddress("wglSwapIntervalEXT"));
if (wglSwapIntervalEXT)
@@ -139,7 +139,7 @@ void ContextWGL::UseVerticalSync(bool enabled)
////////////////////////////////////////////////////////////
-void ContextWGL::CreateContext(ContextWGL* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
+void WglContext::CreateContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings)
{
// Save the creation settings
mySettings = settings;
diff --git a/src/SFML/Window/Win32/ContextWGL.hpp b/src/SFML/Window/Win32/WglContext.hpp
similarity index 90%
rename from src/SFML/Window/Win32/ContextWGL.hpp
rename to src/SFML/Window/Win32/WglContext.hpp
index 52405980e..d0c2d371e 100644
--- a/src/SFML/Window/Win32/ContextWGL.hpp
+++ b/src/SFML/Window/Win32/WglContext.hpp
@@ -22,13 +22,13 @@
//
////////////////////////////////////////////////////////////
-#ifndef SFML_CONTEXTWGL_HPP
-#define SFML_CONTEXTWGL_HPP
+#ifndef SFML_WGLCONTEXT_HPP
+#define SFML_WGLCONTEXT_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include
+#include
#include
@@ -40,7 +40,7 @@ namespace priv
/// \brief Windows (WGL) implementation of OpenGL contexts
///
////////////////////////////////////////////////////////////
-class ContextWGL : public ContextGL
+class WglContext : public GlContext
{
public :
@@ -50,7 +50,7 @@ public :
/// \param shared Context to share the new one with (can be NULL)
///
////////////////////////////////////////////////////////////
- ContextWGL(ContextWGL* shared);
+ WglContext(WglContext* shared);
////////////////////////////////////////////////////////////
/// \brief Create a new context attached to a window
@@ -61,13 +61,13 @@ public :
/// \param settings Creation parameters
///
////////////////////////////////////////////////////////////
- ContextWGL(ContextWGL* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings);
+ WglContext(WglContext* shared, const WindowImpl* owner, unsigned int bitsPerPixel, const ContextSettings& settings);
////////////////////////////////////////////////////////////
/// \brief Destructor
///
////////////////////////////////////////////////////////////
- ~ContextWGL();
+ ~WglContext();
////////////////////////////////////////////////////////////
/// \brief Activate the context as the current target
@@ -107,7 +107,7 @@ private :
/// \param settings Creation parameters
///
////////////////////////////////////////////////////////////
- void CreateContext(ContextWGL* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
+ void CreateContext(WglContext* shared, unsigned int bitsPerPixel, const ContextSettings& settings);
////////////////////////////////////////////////////////////
// Member data
@@ -122,4 +122,4 @@ private :
} // namespace sf
-#endif // SFML_CONTEXTWGL_HPP
+#endif // SFML_WGLCONTEXT_HPP
diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp
index f2c286e80..42d88594d 100644
--- a/src/SFML/Window/Window.cpp
+++ b/src/SFML/Window/Window.cpp
@@ -26,7 +26,7 @@
// Headers
////////////////////////////////////////////////////////////
#include
-#include
+#include
#include
#include
#include
@@ -129,7 +129,7 @@ void Window::Create(VideoMode mode, const std::string& title, unsigned long styl
myWindow = priv::WindowImpl::New(mode, title, style);
// Recreate the context
- myContext = priv::ContextGL::New(myWindow, mode.BitsPerPixel, settings);
+ myContext = priv::GlContext::New(myWindow, mode.BitsPerPixel, settings);
// Perform common initializations
Initialize();
@@ -146,7 +146,7 @@ void Window::Create(WindowHandle handle, const ContextSettings& settings)
myWindow = priv::WindowImpl::New(handle);
// Recreate the context
- myContext = priv::ContextGL::New(myWindow, VideoMode::GetDesktopMode().BitsPerPixel, settings);
+ myContext = priv::GlContext::New(myWindow, VideoMode::GetDesktopMode().BitsPerPixel, settings);
// Perform common initializations
Initialize();