Renamed Window::IsOpened to IsOpen
Made some minor consistency modifications in internal code
This commit is contained in:
parent
9d4c8b26a5
commit
c2039e866c
14 changed files with 75 additions and 75 deletions
|
@ -35,7 +35,7 @@ namespace sf
|
|||
{
|
||||
////////////////////////////////////////////////////////////
|
||||
RenderTexture::RenderTexture() :
|
||||
myRenderTexture(NULL)
|
||||
myImpl(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ myRenderTexture(NULL)
|
|||
////////////////////////////////////////////////////////////
|
||||
RenderTexture::~RenderTexture()
|
||||
{
|
||||
delete myRenderTexture;
|
||||
delete myImpl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,20 +62,20 @@ bool RenderTexture::Create(unsigned int width, unsigned int height, bool depthBu
|
|||
SetSmooth(false);
|
||||
|
||||
// Create the implementation
|
||||
delete myRenderTexture;
|
||||
delete myImpl;
|
||||
if (priv::RenderTextureImplFBO::IsAvailable())
|
||||
{
|
||||
// Use frame-buffer object (FBO)
|
||||
myRenderTexture = new priv::RenderTextureImplFBO;
|
||||
myImpl = new priv::RenderTextureImplFBO;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use default implementation
|
||||
myRenderTexture = new priv::RenderTextureImplDefault;
|
||||
myImpl = new priv::RenderTextureImplDefault;
|
||||
}
|
||||
|
||||
// Initialize the render texture
|
||||
if (!myRenderTexture->Create(width, height, myTexture.myTexture, depthBuffer))
|
||||
if (!myImpl->Create(width, height, myTexture.myTexture, depthBuffer))
|
||||
return false;
|
||||
|
||||
// We can now initialize the render target part
|
||||
|
@ -102,7 +102,7 @@ bool RenderTexture::IsSmooth() const
|
|||
////////////////////////////////////////////////////////////
|
||||
bool RenderTexture::SetActive(bool active)
|
||||
{
|
||||
return myRenderTexture && myRenderTexture->Activate(active);
|
||||
return myImpl && myImpl->Activate(active);
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +112,7 @@ void RenderTexture::Display()
|
|||
// Update the target texture
|
||||
if (SetActive(true))
|
||||
{
|
||||
myRenderTexture->UpdateTexture(myTexture.myTexture);
|
||||
myImpl->UpdateTexture(myTexture.myTexture);
|
||||
myTexture.myPixelsFlipped = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,9 +118,9 @@ bool Shader::LoadFromFile(const std::string& filename, Type type)
|
|||
|
||||
// Compile the shader program
|
||||
if (type == Vertex)
|
||||
return CompileProgram(&shader[0], NULL);
|
||||
return Compile(&shader[0], NULL);
|
||||
else
|
||||
return CompileProgram(NULL, &shader[0]);
|
||||
return Compile(NULL, &shader[0]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ bool Shader::LoadFromFile(const std::string& vertexShaderFilename, const std::st
|
|||
}
|
||||
|
||||
// Compile the shader program
|
||||
return CompileProgram(&vertexShader[0], &fragmentShader[0]);
|
||||
return Compile(&vertexShader[0], &fragmentShader[0]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,9 +153,9 @@ bool Shader::LoadFromMemory(const std::string& shader, Type type)
|
|||
{
|
||||
// Compile the shader program
|
||||
if (type == Vertex)
|
||||
return CompileProgram(shader.c_str(), NULL);
|
||||
return Compile(shader.c_str(), NULL);
|
||||
else
|
||||
return CompileProgram(NULL, shader.c_str());
|
||||
return Compile(NULL, shader.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -163,7 +163,7 @@ bool Shader::LoadFromMemory(const std::string& shader, Type type)
|
|||
bool Shader::LoadFromMemory(const std::string& vertexShader, const std::string& fragmentShader)
|
||||
{
|
||||
// Compile the shader program
|
||||
return CompileProgram(vertexShader.c_str(), fragmentShader.c_str());
|
||||
return Compile(vertexShader.c_str(), fragmentShader.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -180,9 +180,9 @@ bool Shader::LoadFromStream(InputStream& stream, Type type)
|
|||
|
||||
// Compile the shader program
|
||||
if (type == Vertex)
|
||||
return CompileProgram(&shader[0], NULL);
|
||||
return Compile(&shader[0], NULL);
|
||||
else
|
||||
return CompileProgram(NULL, &shader[0]);
|
||||
return Compile(NULL, &shader[0]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,7 +206,7 @@ bool Shader::LoadFromStream(InputStream& vertexShaderStream, InputStream& fragme
|
|||
}
|
||||
|
||||
// Compile the shader program
|
||||
return CompileProgram(&vertexShader[0], &fragmentShader[0]);
|
||||
return Compile(&vertexShader[0], &fragmentShader[0]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -449,7 +449,7 @@ bool Shader::IsAvailable()
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool Shader::CompileProgram(const char* vertexShaderCode, const char* fragmentShaderCode)
|
||||
bool Shader::Compile(const char* vertexShaderCode, const char* fragmentShaderCode)
|
||||
{
|
||||
EnsureGlContext();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace sf
|
|||
Thread::~Thread()
|
||||
{
|
||||
Wait();
|
||||
delete myFunction;
|
||||
delete myEntryPoint;
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ void Thread::Terminate()
|
|||
////////////////////////////////////////////////////////////
|
||||
void Thread::Run()
|
||||
{
|
||||
myFunction->Run();
|
||||
myEntryPoint->Run();
|
||||
}
|
||||
|
||||
} // namespace sf
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace sf
|
|||
{
|
||||
////////////////////////////////////////////////////////////
|
||||
Window::Window() :
|
||||
myWindow (NULL),
|
||||
myImpl (NULL),
|
||||
myContext (NULL),
|
||||
myLastFrameTime (0),
|
||||
myFramerateLimit(0)
|
||||
|
@ -56,7 +56,7 @@ myFramerateLimit(0)
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
Window::Window(VideoMode mode, const std::string& title, Uint32 style, const ContextSettings& settings) :
|
||||
myWindow (NULL),
|
||||
myImpl (NULL),
|
||||
myContext (NULL),
|
||||
myLastFrameTime (0),
|
||||
myFramerateLimit(0)
|
||||
|
@ -67,7 +67,7 @@ myFramerateLimit(0)
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
Window::Window(WindowHandle handle, const ContextSettings& settings) :
|
||||
myWindow (NULL),
|
||||
myImpl (NULL),
|
||||
myContext (NULL),
|
||||
myLastFrameTime (0),
|
||||
myFramerateLimit(0)
|
||||
|
@ -117,10 +117,10 @@ void Window::Create(VideoMode mode, const std::string& title, Uint32 style, cons
|
|||
style |= Style::Titlebar;
|
||||
|
||||
// Recreate the window implementation
|
||||
myWindow = priv::WindowImpl::New(mode, title, style);
|
||||
myImpl = priv::WindowImpl::New(mode, title, style);
|
||||
|
||||
// Recreate the context
|
||||
myContext = priv::GlContext::New(settings, myWindow, mode.BitsPerPixel);
|
||||
myContext = priv::GlContext::New(settings, myImpl, mode.BitsPerPixel);
|
||||
|
||||
// Perform common initializations
|
||||
Initialize();
|
||||
|
@ -134,10 +134,10 @@ void Window::Create(WindowHandle handle, const ContextSettings& settings)
|
|||
Close();
|
||||
|
||||
// Recreate the window implementation
|
||||
myWindow = priv::WindowImpl::New(handle);
|
||||
myImpl = priv::WindowImpl::New(handle);
|
||||
|
||||
// Recreate the context
|
||||
myContext = priv::GlContext::New(settings, myWindow, VideoMode::GetDesktopMode().BitsPerPixel);
|
||||
myContext = priv::GlContext::New(settings, myImpl, VideoMode::GetDesktopMode().BitsPerPixel);
|
||||
|
||||
// Perform common initializations
|
||||
Initialize();
|
||||
|
@ -154,11 +154,11 @@ void Window::Close()
|
|||
myContext = NULL;
|
||||
}
|
||||
|
||||
if (myWindow)
|
||||
if (myImpl)
|
||||
{
|
||||
// Delete the window implementation
|
||||
delete myWindow;
|
||||
myWindow = NULL;
|
||||
delete myImpl;
|
||||
myImpl = NULL;
|
||||
}
|
||||
|
||||
// Update the fullscreen window
|
||||
|
@ -168,23 +168,23 @@ void Window::Close()
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool Window::IsOpened() const
|
||||
bool Window::IsOpen() const
|
||||
{
|
||||
return myWindow != NULL;
|
||||
return myImpl != NULL;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Window::GetWidth() const
|
||||
{
|
||||
return myWindow ? myWindow->GetWidth() : 0;
|
||||
return myImpl ? myImpl->GetWidth() : 0;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int Window::GetHeight() const
|
||||
{
|
||||
return myWindow ? myWindow->GetHeight() : 0;
|
||||
return myImpl ? myImpl->GetHeight() : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ const ContextSettings& Window::GetSettings() const
|
|||
////////////////////////////////////////////////////////////
|
||||
bool Window::PollEvent(Event& event)
|
||||
{
|
||||
if (myWindow && myWindow->PopEvent(event, false))
|
||||
if (myImpl && myImpl->PopEvent(event, false))
|
||||
{
|
||||
return FilterEvent(event);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ bool Window::PollEvent(Event& event)
|
|||
////////////////////////////////////////////////////////////
|
||||
bool Window::WaitEvent(Event& event)
|
||||
{
|
||||
if (myWindow && myWindow->PopEvent(event, true))
|
||||
if (myImpl && myImpl->PopEvent(event, true))
|
||||
{
|
||||
return FilterEvent(event);
|
||||
}
|
||||
|
@ -236,56 +236,56 @@ void Window::EnableVerticalSync(bool enabled)
|
|||
////////////////////////////////////////////////////////////
|
||||
void Window::ShowMouseCursor(bool show)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->ShowMouseCursor(show);
|
||||
if (myImpl)
|
||||
myImpl->ShowMouseCursor(show);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Window::SetPosition(int x, int y)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->SetPosition(x, y);
|
||||
if (myImpl)
|
||||
myImpl->SetPosition(x, y);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Window::SetSize(unsigned int width, unsigned int height)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->SetSize(width, height);
|
||||
if (myImpl)
|
||||
myImpl->SetSize(width, height);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Window::SetTitle(const std::string& title)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->SetTitle(title);
|
||||
if (myImpl)
|
||||
myImpl->SetTitle(title);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Window::Show(bool show)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->Show(show);
|
||||
if (myImpl)
|
||||
myImpl->Show(show);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Window::EnableKeyRepeat(bool enabled)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->EnableKeyRepeat(enabled);
|
||||
if (myImpl)
|
||||
myImpl->EnableKeyRepeat(enabled);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Window::SetIcon(unsigned int width, unsigned int height, const Uint8* pixels)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->SetIcon(width, height, pixels);
|
||||
if (myImpl)
|
||||
myImpl->SetIcon(width, height, pixels);
|
||||
}
|
||||
|
||||
|
||||
|
@ -349,15 +349,15 @@ Uint32 Window::GetFrameTime() const
|
|||
////////////////////////////////////////////////////////////
|
||||
void Window::SetJoystickThreshold(float threshold)
|
||||
{
|
||||
if (myWindow)
|
||||
myWindow->SetJoystickThreshold(threshold);
|
||||
if (myImpl)
|
||||
myImpl->SetJoystickThreshold(threshold);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
WindowHandle Window::GetSystemHandle() const
|
||||
{
|
||||
return myWindow ? myWindow->GetSystemHandle() : 0;
|
||||
return myImpl ? myImpl->GetSystemHandle() : 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue