diff --git a/examples/opengl/OpenGL.cpp b/examples/opengl/OpenGL.cpp index 38451722d..f5681f954 100644 --- a/examples/opengl/OpenGL.cpp +++ b/examples/opengl/OpenGL.cpp @@ -57,7 +57,7 @@ int main() sf::Clock clock; // Start game loop - while (window.IsOpened()) + while (window.IsOpen()) { // Process events sf::Event event; diff --git a/examples/pong/Pong.cpp b/examples/pong/Pong.cpp index 3b1b940ae..d5faa199c 100644 --- a/examples/pong/Pong.cpp +++ b/examples/pong/Pong.cpp @@ -82,7 +82,7 @@ int main() float ballAngle = 0.f; // to be changed later bool isPlaying = false; - while (window.IsOpened()) + while (window.IsOpen()) { // Handle events sf::Event event; diff --git a/examples/shader/Shader.cpp b/examples/shader/Shader.cpp index a431303a4..2f388c43f 100644 --- a/examples/shader/Shader.cpp +++ b/examples/shader/Shader.cpp @@ -305,7 +305,7 @@ int main() // Start the game loop sf::Clock clock; - while (window.IsOpened()) + while (window.IsOpen()) { // Process events sf::Event event; diff --git a/examples/window/Window.cpp b/examples/window/Window.cpp index fb99a1b1d..c5e524837 100644 --- a/examples/window/Window.cpp +++ b/examples/window/Window.cpp @@ -34,7 +34,7 @@ int main() gluPerspective(90.f, 1.f, 1.f, 500.f); // Start the game loop - while (window.IsOpened()) + while (window.IsOpen()) { // Process events sf::Event event; diff --git a/include/SFML/Graphics/RenderTexture.hpp b/include/SFML/Graphics/RenderTexture.hpp index 44f2a059d..97f193657 100644 --- a/include/SFML/Graphics/RenderTexture.hpp +++ b/include/SFML/Graphics/RenderTexture.hpp @@ -195,8 +195,8 @@ private : //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - Texture myTexture; ///< Target texture to draw on - priv::RenderTextureImpl* myRenderTexture; ///< Platform/hardware specific implementation + priv::RenderTextureImpl* myImpl; ///< Platform/hardware specific implementation + Texture myTexture; ///< Target texture to draw on }; } // namespace sf @@ -233,7 +233,7 @@ private : /// return -1 /// /// // The main loop -/// while (window.IsOpened()) +/// while (window.IsOpen()) /// { /// // Event processing /// // ... diff --git a/include/SFML/Graphics/RenderWindow.hpp b/include/SFML/Graphics/RenderWindow.hpp index 239c28724..a8d2e10bb 100644 --- a/include/SFML/Graphics/RenderWindow.hpp +++ b/include/SFML/Graphics/RenderWindow.hpp @@ -205,7 +205,7 @@ private : /// window.SetFramerateLimit(60); /// /// // The main loop - ends as soon as the window is closed -/// while (window.IsOpened()) +/// while (window.IsOpen()) /// { /// // Event processing /// sf::Event event; @@ -247,7 +247,7 @@ private : /// ... /// /// // Start the rendering loop -/// while (window.IsOpened()) +/// while (window.IsOpen()) /// { /// // Process events /// ... diff --git a/include/SFML/Graphics/Shader.hpp b/include/SFML/Graphics/Shader.hpp index 07640c627..43621db94 100644 --- a/include/SFML/Graphics/Shader.hpp +++ b/include/SFML/Graphics/Shader.hpp @@ -503,7 +503,7 @@ private : /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - bool CompileProgram(const char* vertexShaderCode, const char* fragmentShaderCode); + bool Compile(const char* vertexShaderCode, const char* fragmentShaderCode); //////////////////////////////////////////////////////////// /// \brief Bind all the textures used by the shader diff --git a/include/SFML/System/Thread.hpp b/include/SFML/System/Thread.hpp index aece4c7a0..837971397 100644 --- a/include/SFML/System/Thread.hpp +++ b/include/SFML/System/Thread.hpp @@ -186,8 +186,8 @@ private : //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - priv::ThreadImpl* myImpl; ///< OS-specific implementation of the thread - priv::ThreadFunc* myFunction; ///< Abstraction of the function to run + priv::ThreadImpl* myImpl; ///< OS-specific implementation of the thread + priv::ThreadFunc* myEntryPoint; ///< Abstraction of the function to run }; #include diff --git a/include/SFML/System/Thread.inl b/include/SFML/System/Thread.inl index 462bfb1b8..2cd1c4d9a 100644 --- a/include/SFML/System/Thread.inl +++ b/include/SFML/System/Thread.inl @@ -66,8 +66,8 @@ struct ThreadMemberFunc : ThreadFunc //////////////////////////////////////////////////////////// template Thread::Thread(F functor) : -myImpl (NULL), -myFunction(new priv::ThreadFunctor(functor)) +myImpl (NULL), +myEntryPoint(new priv::ThreadFunctor(functor)) { } @@ -75,8 +75,8 @@ myFunction(new priv::ThreadFunctor(functor)) //////////////////////////////////////////////////////////// template Thread::Thread(F function, A argument) : -myImpl (NULL), -myFunction(new priv::ThreadFunctorWithArg(function, argument)) +myImpl (NULL), +myEntryPoint(new priv::ThreadFunctorWithArg(function, argument)) { } @@ -84,7 +84,7 @@ myFunction(new priv::ThreadFunctorWithArg(function, argument)) //////////////////////////////////////////////////////////// template Thread::Thread(void(C::*function)(), C* object) : -myImpl (NULL), -myFunction(new priv::ThreadMemberFunc(function, object)) +myImpl (NULL), +myEntryPoint(new priv::ThreadMemberFunc(function, object)) { } diff --git a/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp index 0a0d257a2..5933e11a8 100644 --- a/include/SFML/Window/Window.hpp +++ b/include/SFML/Window/Window.hpp @@ -145,7 +145,7 @@ public : /// After calling this function, the sf::Window instance remains /// valid and you can call Create() to recreate the window. /// All other functions such as PollEvent() or Display() will - /// still work (i.e. you don't have to test IsOpened() every time), + /// still work (i.e. you don't have to test IsOpen() every time), /// and will have no effect on closed windows. /// //////////////////////////////////////////////////////////// @@ -160,7 +160,7 @@ public : /// \return True if the window is opened, false if it has been closed /// //////////////////////////////////////////////////////////// - bool IsOpened() const; + bool IsOpen() const; //////////////////////////////////////////////////////////// /// \brief Get the width of the rendering region of the window @@ -471,7 +471,7 @@ private : //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - priv::WindowImpl* myWindow; ///< Platform-specific implementation of the window + priv::WindowImpl* myImpl; ///< Platform-specific implementation of the window priv::GlContext* myContext; ///< Platform-specific implementation of the OpenGL context Clock myClock; ///< Clock for measuring the elapsed time between frames Uint32 myLastFrameTime; ///< Time elapsed since last frame @@ -519,7 +519,7 @@ private : /// window.SetFramerateLimit(60); /// /// // The main loop - ends as soon as the window is closed -/// while (window.IsOpened()) +/// while (window.IsOpen()) /// { /// // Event processing /// sf::Event event; diff --git a/src/SFML/Graphics/RenderTexture.cpp b/src/SFML/Graphics/RenderTexture.cpp index ff0986d1a..e3250b7b3 100644 --- a/src/SFML/Graphics/RenderTexture.cpp +++ b/src/SFML/Graphics/RenderTexture.cpp @@ -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; } } diff --git a/src/SFML/Graphics/Shader.cpp b/src/SFML/Graphics/Shader.cpp index 8847b0faf..30497e148 100644 --- a/src/SFML/Graphics/Shader.cpp +++ b/src/SFML/Graphics/Shader.cpp @@ -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(); diff --git a/src/SFML/System/Thread.cpp b/src/SFML/System/Thread.cpp index d521fe4cd..9fe51629c 100644 --- a/src/SFML/System/Thread.cpp +++ b/src/SFML/System/Thread.cpp @@ -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 diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 7101649b5..1042dfe03 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -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; }