mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Renamed internal classes related to OpenGL contexts in the window module
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1501 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
51ff7296ad
commit
a512479a42
@ -117,19 +117,18 @@
|
||||
<Unit filename="..\..\include\SFML\Window\Window.hpp" />
|
||||
<Unit filename="..\..\include\SFML\Window\WindowHandle.hpp" />
|
||||
<Unit filename="..\..\include\SFML\Window\WindowStyle.hpp" />
|
||||
<Unit filename="..\..\include\SFML\Window\glew\glew.h" />
|
||||
<Unit filename="..\..\src\SFML\Window\Context.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\ContextGL.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\ContextGL.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\GlContext.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\GlContext.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Input.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Joystick.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\VideoMode.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\VideoModeImpl.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\ContextWGL.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\ContextWGL.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\Joystick.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\Joystick.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\VideoModeImpl.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\WglContext.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\WglContext.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\WindowImplWin32.cpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Win32\WindowImplWin32.hpp" />
|
||||
<Unit filename="..\..\src\SFML\Window\Window.cpp" />
|
||||
|
@ -351,14 +351,6 @@
|
||||
<Filter
|
||||
Name="Win32"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\ContextWGL.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\ContextWGL.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\Joystick.cpp"
|
||||
>
|
||||
@ -403,6 +395,14 @@
|
||||
RelativePath="..\..\src\SFML\Window\Win32\VideoModeImpl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\WglContext.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\WglContext.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\WindowImplWin32.cpp"
|
||||
>
|
||||
@ -452,14 +452,6 @@
|
||||
RelativePath="..\..\include\SFML\Window\Context.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\ContextGL.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\ContextGL.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\SFML\Window\ContextSettings.hpp"
|
||||
>
|
||||
@ -468,6 +460,14 @@
|
||||
RelativePath="..\..\include\SFML\Window\Event.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\GlContext.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\GlContext.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Input.cpp"
|
||||
>
|
||||
|
@ -346,14 +346,6 @@
|
||||
<Filter
|
||||
Name="Win32"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\ContextWGL.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\ContextWGL.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\Joystick.cpp"
|
||||
>
|
||||
@ -366,6 +358,14 @@
|
||||
RelativePath="..\..\src\SFML\Window\Win32\VideoModeImpl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\WglContext.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\WglContext.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Win32\WindowImplWin32.cpp"
|
||||
>
|
||||
@ -415,14 +415,6 @@
|
||||
RelativePath="..\..\include\SFML\Window\Context.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\ContextGL.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\ContextGL.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\SFML\Window\ContextSettings.hpp"
|
||||
>
|
||||
@ -431,6 +423,14 @@
|
||||
RelativePath="..\..\include\SFML\Window\Event.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\GlContext.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\GlContext.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\SFML\Window\Input.cpp"
|
||||
>
|
||||
|
@ -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
|
||||
|
@ -28,10 +28,10 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/ContextSettings.hpp>
|
||||
#include <SFML/Window/Input.hpp>
|
||||
#include <SFML/Window/VideoMode.hpp>
|
||||
#include <SFML/Window/WindowHandle.hpp>
|
||||
#include <SFML/Window/ContextSettings.hpp>
|
||||
#include <SFML/Window/WindowStyle.hpp>
|
||||
#include <SFML/System/Clock.hpp>
|
||||
#include <SFML/System/NonCopyable.hpp>
|
||||
@ -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
|
||||
|
@ -26,7 +26,7 @@
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Context.hpp>
|
||||
#include <SFML/Window/ContextGL.hpp>
|
||||
#include <SFML/Window/GlContext.hpp>
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/ContextGL.hpp>
|
||||
#include <SFML/Window/GlContext.hpp>
|
||||
#include <SFML/System/ThreadLocalPtr.hpp>
|
||||
#include <SFML/OpenGL.hpp>
|
||||
#include <SFML/Window/glext/glext.h>
|
||||
@ -34,18 +34,18 @@
|
||||
|
||||
#if defined(SFML_SYSTEM_WINDOWS)
|
||||
|
||||
#include <SFML/Window/Win32/ContextWGL.hpp>
|
||||
typedef sf::priv::ContextWGL ContextType;
|
||||
#include <SFML/Window/Win32/WglContext.hpp>
|
||||
typedef sf::priv::WglContext ContextType;
|
||||
|
||||
#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)
|
||||
|
||||
#include <SFML/Window/Linux/ContextGLX.hpp>
|
||||
typedef sf::priv::ContextGLX ContextType;
|
||||
#include <SFML/Window/Linux/GlxContext.hpp>
|
||||
typedef sf::priv::GlxContext ContextType;
|
||||
|
||||
#elif defined(SFML_SYSTEM_MACOS)
|
||||
|
||||
#include <SFML/Window/Cocoa/ContextAGL.hpp>
|
||||
typedef sf::priv::ContextAGL ContextType;
|
||||
#include <SFML/Window/Cocoa/AglContext.hpp>
|
||||
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<sf::priv::ContextGL> threadContext(NULL);
|
||||
sf::ThreadLocalPtr<sf::priv::GlContext> 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<int>(bitsPerPixel - colorBits)) +
|
||||
abs(static_cast<int>(settings.DepthBits - depthBits)) +
|
@ -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
|
@ -26,7 +26,7 @@
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#define GLX_GLXEXT_LEGACY // so that our local glxext.h is used instead of the system one
|
||||
#include <SFML/Window/Linux/ContextGLX.hpp>
|
||||
#include <SFML/Window/Linux/GlxContext.hpp>
|
||||
#include <SFML/Window/Linux/WindowImplX11.hpp>
|
||||
#include <SFML/OpenGL.hpp>
|
||||
#include <SFML/Window/glext/glxext.h>
|
||||
@ -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<const GLubyte*>("glXSwapIntervalSGI");
|
||||
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = reinterpret_cast<PFNGLXSWAPINTERVALSGIPROC>(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;
|
@ -22,13 +22,13 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef SFML_CONTEXTGLX_HPP
|
||||
#define SFML_CONTEXTGLX_HPP
|
||||
#ifndef SFML_GLXCONTEXT_HPP
|
||||
#define SFML_GLXCONTEXT_HPP
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/ContextGL.hpp>
|
||||
#include <SFML/Window/GlContext.hpp>
|
||||
#include <X11/Xlib.h>
|
||||
#include <GL/glx.h>
|
||||
|
||||
@ -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
|
@ -25,7 +25,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Win32/ContextWGL.hpp>
|
||||
#include <SFML/Window/Win32/WglContext.hpp>
|
||||
#include <SFML/Window/WindowImpl.hpp>
|
||||
#include <SFML/OpenGL.hpp>
|
||||
#include <SFML/Window/glext/wglext.h>
|
||||
@ -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<PFNWGLSWAPINTERVALEXTPROC>(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;
|
@ -22,13 +22,13 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef SFML_CONTEXTWGL_HPP
|
||||
#define SFML_CONTEXTWGL_HPP
|
||||
#ifndef SFML_WGLCONTEXT_HPP
|
||||
#define SFML_WGLCONTEXT_HPP
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/ContextGL.hpp>
|
||||
#include <SFML/Window/GlContext.hpp>
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
@ -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
|
@ -26,7 +26,7 @@
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Window.hpp>
|
||||
#include <SFML/Window/ContextGL.hpp>
|
||||
#include <SFML/Window/GlContext.hpp>
|
||||
#include <SFML/Window/WindowImpl.hpp>
|
||||
#include <SFML/System/Sleep.hpp>
|
||||
#include <SFML/System/Err.hpp>
|
||||
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user