mirror of
https://github.com/SFML/SFML.git
synced 2025-01-19 15:55:13 +08:00
Minor internal modifications (renamed New functions to Create)
This commit is contained in:
parent
2de690f02d
commit
90854907b5
@ -34,7 +34,7 @@ namespace sf
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Context::Context()
|
Context::Context()
|
||||||
{
|
{
|
||||||
myContext = priv::GlContext::New();
|
myContext = priv::GlContext::Create();
|
||||||
SetActive(true);
|
SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ bool Context::SetActive(bool active)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Context::Context(const ContextSettings& settings, unsigned int width, unsigned int height)
|
Context::Context(const ContextSettings& settings, unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
myContext = priv::GlContext::New(settings, width, height);
|
myContext = priv::GlContext::Create(settings, width, height);
|
||||||
SetActive(true);
|
SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ namespace
|
|||||||
{
|
{
|
||||||
if (!HasInternalContext())
|
if (!HasInternalContext())
|
||||||
{
|
{
|
||||||
internalContext = sf::priv::GlContext::New();
|
internalContext = sf::priv::GlContext::Create();
|
||||||
sf::Lock lock(internalContextsMutex);
|
sf::Lock lock(internalContextsMutex);
|
||||||
internalContexts.insert(internalContext);
|
internalContexts.insert(internalContext);
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ void GlContext::EnsureContext()
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
GlContext* GlContext::New()
|
GlContext* GlContext::Create()
|
||||||
{
|
{
|
||||||
GlContext* context = new ContextType(sharedContext);
|
GlContext* context = new ContextType(sharedContext);
|
||||||
context->Initialize();
|
context->Initialize();
|
||||||
@ -147,7 +147,7 @@ GlContext* GlContext::New()
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
GlContext* GlContext::New(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel)
|
GlContext* GlContext::Create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel)
|
||||||
{
|
{
|
||||||
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
|
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
|
||||||
EnsureContext();
|
EnsureContext();
|
||||||
@ -161,7 +161,7 @@ GlContext* GlContext::New(const ContextSettings& settings, const WindowImpl* own
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
GlContext* GlContext::New(const ContextSettings& settings, unsigned int width, unsigned int height)
|
GlContext* GlContext::Create(const ContextSettings& settings, unsigned int width, unsigned int height)
|
||||||
{
|
{
|
||||||
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
|
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
|
||||||
EnsureContext();
|
EnsureContext();
|
||||||
|
@ -86,7 +86,7 @@ public :
|
|||||||
/// \return Pointer to the created context (don't forget to delete it)
|
/// \return Pointer to the created context (don't forget to delete it)
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static GlContext* New();
|
static GlContext* Create();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create a new context attached to a window
|
/// \brief Create a new context attached to a window
|
||||||
@ -101,7 +101,7 @@ public :
|
|||||||
/// \return Pointer to the created context
|
/// \return Pointer to the created context
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static GlContext* New(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
|
static GlContext* Create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create a new context that embeds its own rendering target
|
/// \brief Create a new context that embeds its own rendering target
|
||||||
@ -116,7 +116,7 @@ public :
|
|||||||
/// \return Pointer to the created context
|
/// \return Pointer to the created context
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static GlContext* New(const ContextSettings& settings, unsigned int width, unsigned int height);
|
static GlContext* Create(const ContextSettings& settings, unsigned int width, unsigned int height);
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
|
@ -111,10 +111,10 @@ void Window::Create(VideoMode mode, const std::string& title, Uint32 style, cons
|
|||||||
style |= Style::Titlebar;
|
style |= Style::Titlebar;
|
||||||
|
|
||||||
// Recreate the window implementation
|
// Recreate the window implementation
|
||||||
myImpl = priv::WindowImpl::New(mode, title, style);
|
myImpl = priv::WindowImpl::Create(mode, title, style);
|
||||||
|
|
||||||
// Recreate the context
|
// Recreate the context
|
||||||
myContext = priv::GlContext::New(settings, myImpl, mode.BitsPerPixel);
|
myContext = priv::GlContext::Create(settings, myImpl, mode.BitsPerPixel);
|
||||||
|
|
||||||
// Perform common initializations
|
// Perform common initializations
|
||||||
Initialize();
|
Initialize();
|
||||||
@ -128,10 +128,10 @@ void Window::Create(WindowHandle handle, const ContextSettings& settings)
|
|||||||
Close();
|
Close();
|
||||||
|
|
||||||
// Recreate the window implementation
|
// Recreate the window implementation
|
||||||
myImpl = priv::WindowImpl::New(handle);
|
myImpl = priv::WindowImpl::Create(handle);
|
||||||
|
|
||||||
// Recreate the context
|
// Recreate the context
|
||||||
myContext = priv::GlContext::New(settings, myImpl, VideoMode::GetDesktopMode().BitsPerPixel);
|
myContext = priv::GlContext::Create(settings, myImpl, VideoMode::GetDesktopMode().BitsPerPixel);
|
||||||
|
|
||||||
// Perform common initializations
|
// Perform common initializations
|
||||||
Initialize();
|
Initialize();
|
||||||
|
@ -55,14 +55,14 @@ namespace sf
|
|||||||
namespace priv
|
namespace priv
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
WindowImpl* WindowImpl::New(VideoMode mode, const std::string& title, Uint32 style)
|
WindowImpl* WindowImpl::Create(VideoMode mode, const std::string& title, Uint32 style)
|
||||||
{
|
{
|
||||||
return new WindowImplType(mode, title, style);
|
return new WindowImplType(mode, title, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
WindowImpl* WindowImpl::New(WindowHandle handle)
|
WindowImpl* WindowImpl::Create(WindowHandle handle)
|
||||||
{
|
{
|
||||||
return new WindowImplType(handle);
|
return new WindowImplType(handle);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ public :
|
|||||||
/// \return Pointer to the created window (don't forget to delete it)
|
/// \return Pointer to the created window (don't forget to delete it)
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static WindowImpl* New(VideoMode mode, const std::string& title, Uint32 style);
|
static WindowImpl* Create(VideoMode mode, const std::string& title, Uint32 style);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create a new window depending on to the current OS
|
/// \brief Create a new window depending on to the current OS
|
||||||
@ -74,7 +74,7 @@ public :
|
|||||||
/// \return Pointer to the created window (don't forget to delete it)
|
/// \return Pointer to the created window (don't forget to delete it)
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static WindowImpl* New(WindowHandle handle);
|
static WindowImpl* Create(WindowHandle handle);
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user