From 4eefeb4cd34559911f56f537981c9091c72ce46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Wed, 15 Feb 2017 01:31:37 -0300 Subject: [PATCH] Window module refactored. --HG-- branch : dev --- include/eepp/math/vector2.hpp | 4 +- include/eepp/window/clipboard.hpp | 10 +- include/eepp/window/cursor.hpp | 16 +- include/eepp/window/cursormanager.hpp | 50 +-- include/eepp/window/engine.hpp | 54 +-- include/eepp/window/input.hpp | 110 +++--- include/eepp/window/inputfinger.hpp | 8 +- include/eepp/window/inputtextbuffer.hpp | 94 ++--- include/eepp/window/joystick.hpp | 36 +- include/eepp/window/joystickmanager.hpp | 14 +- include/eepp/window/platformimpl.hpp | 36 +- include/eepp/window/view.hpp | 24 +- include/eepp/window/window.hpp | 192 +++++----- premake4.lua | 5 +- projects/linux/ee.files | 3 + projects/linux/ee.includes | 1 + src/eepp/gaming/mapeditor/mapeditor.cpp | 4 +- src/eepp/gaming/mapeditor/uimap.cpp | 10 +- src/eepp/gaming/tilemap.cpp | 10 +- src/eepp/graphics/console.cpp | 104 +++--- src/eepp/graphics/framebuffer.cpp | 8 +- src/eepp/graphics/framebufferfbo.cpp | 2 +- src/eepp/graphics/particlesystem.cpp | 2 +- src/eepp/graphics/sprite.cpp | 2 +- src/eepp/graphics/textureloader.cpp | 18 +- src/eepp/physics/space.cpp | 2 +- src/eepp/system/sys.cpp | 8 +- src/eepp/ui/tools/textureatlaseditor.cpp | 2 +- src/eepp/ui/tools/textureatlasnew.cpp | 4 +- src/eepp/ui/uidropdownlist.cpp | 2 +- src/eepp/ui/uigridcell.cpp | 2 +- src/eepp/ui/uilistbox.cpp | 2 +- src/eepp/ui/uilistboxitem.cpp | 2 +- src/eepp/ui/uimanager.cpp | 66 ++-- src/eepp/ui/uiscrollbar.cpp | 2 +- src/eepp/ui/uislider.cpp | 2 +- src/eepp/ui/uispinbox.cpp | 4 +- src/eepp/ui/uitab.cpp | 2 +- src/eepp/ui/uitextedit.cpp | 10 +- src/eepp/ui/uitextinput.cpp | 66 ++-- src/eepp/ui/uitextinputpassword.cpp | 6 +- src/eepp/window/backend/SDL/clipboardsdl.cpp | 37 +- src/eepp/window/backend/SDL/clipboardsdl.hpp | 8 +- .../window/backend/SDL/cursormanagersdl.cpp | 46 +-- .../window/backend/SDL/cursormanagersdl.hpp | 20 +- src/eepp/window/backend/SDL/cursorsdl.cpp | 2 +- src/eepp/window/backend/SDL/cursorsdl.hpp | 2 +- src/eepp/window/backend/SDL/inputsdl.cpp | 38 +- src/eepp/window/backend/SDL/inputsdl.hpp | 10 +- .../window/backend/SDL/joystickmanagersdl.cpp | 14 +- .../window/backend/SDL/joystickmanagersdl.hpp | 8 +- src/eepp/window/backend/SDL/joysticksdl.cpp | 22 +- src/eepp/window/backend/SDL/joysticksdl.hpp | 14 +- src/eepp/window/backend/SDL/windowsdl.cpp | 120 +++--- src/eepp/window/backend/SDL/windowsdl.hpp | 28 +- .../window/backend/SDL2/clipboardsdl2.cpp | 8 +- .../window/backend/SDL2/clipboardsdl2.hpp | 8 +- .../window/backend/SDL2/cursormanagersdl2.cpp | 38 +- .../window/backend/SDL2/cursormanagersdl2.hpp | 20 +- src/eepp/window/backend/SDL2/cursorsdl2.cpp | 8 +- src/eepp/window/backend/SDL2/cursorsdl2.hpp | 2 +- src/eepp/window/backend/SDL2/inputsdl2.cpp | 24 +- src/eepp/window/backend/SDL2/inputsdl2.hpp | 12 +- .../backend/SDL2/joystickmanagersdl2.cpp | 18 +- .../backend/SDL2/joystickmanagersdl2.hpp | 10 +- src/eepp/window/backend/SDL2/joysticksdl2.cpp | 22 +- src/eepp/window/backend/SDL2/joysticksdl2.hpp | 14 +- src/eepp/window/backend/SDL2/windowsdl2.cpp | 160 ++++---- src/eepp/window/backend/SDL2/windowsdl2.hpp | 70 ++-- src/eepp/window/backend/SDL2/wminfo.cpp | 4 +- src/eepp/window/backend/SDL2/wminfo.hpp | 4 +- .../window/backend/SFML/cursormanagersfml.cpp | 16 +- src/eepp/window/backend/SFML/windowsfml.cpp | 9 +- .../window/backend/null/clipboardnull.cpp | 8 +- .../window/backend/null/clipboardnull.hpp | 8 +- .../window/backend/null/cursormanagernull.cpp | 22 +- .../window/backend/null/cursormanagernull.hpp | 20 +- src/eepp/window/backend/null/cursornull.cpp | 4 +- src/eepp/window/backend/null/cursornull.hpp | 8 +- src/eepp/window/backend/null/inputnull.cpp | 10 +- src/eepp/window/backend/null/inputnull.hpp | 10 +- .../backend/null/joystickmanagernull.cpp | 8 +- .../backend/null/joystickmanagernull.hpp | 8 +- src/eepp/window/backend/null/joysticknull.cpp | 14 +- src/eepp/window/backend/null/joysticknull.hpp | 14 +- src/eepp/window/backend/null/windownull.cpp | 46 +-- src/eepp/window/backend/null/windownull.hpp | 44 +-- src/eepp/window/clipboard.cpp | 2 +- src/eepp/window/cursor.cpp | 8 +- src/eepp/window/cursormanager.cpp | 54 +-- src/eepp/window/engine.cpp | 96 ++--- src/eepp/window/input.cpp | 146 ++++---- src/eepp/window/inputfinger.cpp | 8 +- src/eepp/window/inputtextbuffer.cpp | 344 +++++++++--------- src/eepp/window/joystick.cpp | 34 +- src/eepp/window/joystickmanager.cpp | 20 +- src/eepp/window/platform/null/nullimpl.cpp | 36 +- src/eepp/window/platform/null/nullimpl.hpp | 36 +- src/eepp/window/platform/osx/osximpl.cpp | 36 +- src/eepp/window/platform/osx/osximpl.hpp | 36 +- src/eepp/window/platform/win/cursorwin.cpp | 18 +- src/eepp/window/platform/win/cursorwin.hpp | 6 +- src/eepp/window/platform/win/winimpl.cpp | 64 ++-- src/eepp/window/platform/win/winimpl.hpp | 38 +- src/eepp/window/platform/x11/cursorx11.cpp | 20 +- src/eepp/window/platform/x11/cursorx11.hpp | 10 +- src/eepp/window/platform/x11/x11impl.cpp | 38 +- src/eepp/window/platform/x11/x11impl.hpp | 36 +- src/eepp/window/view.cpp | 42 +-- src/eepp/window/window.cpp | 220 +++++------ src/examples/empty_window/empty_window.cpp | 24 +- .../external_shader/external_shader.cpp | 44 +-- src/examples/fonts/fonts.cpp | 32 +- src/examples/physics/physics.cpp | 58 +-- src/examples/sprites/sprites.cpp | 24 +- src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp | 26 +- src/test/eetest.cpp | 308 ++++++++-------- src/test/eetest.hpp | 4 +- 118 files changed, 1964 insertions(+), 1943 deletions(-) diff --git a/include/eepp/math/vector2.hpp b/include/eepp/math/vector2.hpp index 8a2398578..748f10381 100755 --- a/include/eepp/math/vector2.hpp +++ b/include/eepp/math/vector2.hpp @@ -72,7 +72,7 @@ class Vector2 { T distanceSq( const Vector2& Vec ); /** @return True if the distance between the two vectors is less than Dist */ - bool near( const Vector2& Vec, T Dist ); + bool nearDist( const Vector2& Vec, T Dist ); /** @return The spherical linear interpolation between two 2D vectors. */ Vector2 sphericalLerp( const Vector2& Vec, T Time ); @@ -396,7 +396,7 @@ void Vector2::clamp( T len ) { } template -bool Vector2::near( const Vector2& Vec, T Dist ) { +bool Vector2::nearDist( const Vector2& Vec, T Dist ) { return 0 != ( distanceSq( Vec ) < Dist * Dist ); } diff --git a/include/eepp/window/clipboard.hpp b/include/eepp/window/clipboard.hpp index edb9d8856..865f6dab8 100644 --- a/include/eepp/window/clipboard.hpp +++ b/include/eepp/window/clipboard.hpp @@ -10,23 +10,23 @@ class EE_API Clipboard { virtual ~Clipboard(); /** @return The Clipboard Text if available */ - virtual std::string GetText() = 0; + virtual std::string getText() = 0; /** @return The Clipboard Text if available ( as String ) */ - virtual String GetWideText() = 0; + virtual String getWideText() = 0; /** Set the current clipboard text */ - virtual void SetText( const std::string& Text ) = 0; + virtual void setText( const std::string& Text ) = 0; /** @return The parent window of the clipboard */ - EE::Window::Window * GetWindow() const; + EE::Window::Window * getWindow() const; protected: friend class Window; Clipboard( EE::Window::Window * window ); /** Initialize the clipboard manager. This is needed because the backends first create the instance of the clipboard and then initialize the window context. */ - virtual void Init() = 0; + virtual void init() = 0; EE::Window::Window * mWindow; }; diff --git a/include/eepp/window/cursor.hpp b/include/eepp/window/cursor.hpp index ef2394fae..cd6e2c015 100644 --- a/include/eepp/window/cursor.hpp +++ b/include/eepp/window/cursor.hpp @@ -16,16 +16,16 @@ class Window; class EE_API Cursor { public: /** @return The cursor id */ - const Uint32& Id() const; + const Uint32& getId() const; /** @return The cursor name */ - const std::string& Name() const; + const std::string& getName() const; /** @return The cursor hotspot, this means, the position inside the cursor image, where the click is taken */ - const Vector2i& HotSpot() const; + const Vector2i& getHotSpot() const; /** @return The pointer to the image that represents the cursor */ - Graphics::Image * Image() const; + Graphics::Image * getImage() const; virtual ~Cursor(); protected: @@ -37,13 +37,13 @@ class EE_API Cursor { Vector2i mHotSpot; EE::Window::Window * mWindow; - Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + Cursor( Texture * tex, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - Cursor( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + Cursor( const std::string& path, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - virtual void Create() = 0; + virtual void create() = 0; }; }} diff --git a/include/eepp/window/cursormanager.hpp b/include/eepp/window/cursormanager.hpp index c846c3807..06cc7dc80 100644 --- a/include/eepp/window/cursormanager.hpp +++ b/include/eepp/window/cursormanager.hpp @@ -26,96 +26,96 @@ class EE_API CursorManager { * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * create( Texture * tex, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image * @param img The image path * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * Create( Image * img, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * create( Image * img, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image path * @param path The image pointer to use as cursor * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * Create( const std::string& path, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * create( const std::string& path, const Vector2i& hotspot, const std::string& name ) = 0; /** Adds the cursor to the cursor manager */ - virtual Cursor * Add( Cursor * cursor ); + virtual Cursor * add( Cursor * cursor ); /** Removes the cursor from the cursor manager * @param cursor The cursor pointer * @param Delete Indicates if the cursor must be delete after being removed from the cursor manager */ - virtual void Remove( Cursor * cursor, bool Delete = false ) = 0; + virtual void remove( Cursor * cursor, bool Delete = false ) = 0; /** Removes the cursor by its name * @param name The cursor name * @param Delete Indicates if the cursor must be delete after being removed from the cursor manager */ - virtual void Remove( const std::string& name, bool Delete = false ); + virtual void remove( const std::string& name, bool Delete = false ); /** Removes the cursor by its id * @param id The cursor pointer id * @param Delete Indicates if the cursor must be delete after being removed from the cursor manager */ - virtual void Remove( const Uint32& id, bool Delete = false ); + virtual void remove( const Uint32& id, bool Delete = false ); /** @return The cursor pointer by its name */ - virtual Cursor * Get( const std::string& name ); + virtual Cursor * get( const std::string& name ); /** @return The cursor pointer by its id */ - virtual Cursor * GetById( const Uint32& id ); + virtual Cursor * getById( const Uint32& id ); /** Set the the current cursor by its name */ - virtual void Set( const std::string& name ); + virtual void set( const std::string& name ); /** Set the the current cursor by its id */ - virtual void SetById( const Uint32& id ); + virtual void setById( const Uint32& id ); /** Set the the current cursor by its cursor pointer */ - virtual void Set( Cursor * cursor ) = 0; + virtual void set( Cursor * cursor ) = 0; /** Set the cursor using a system cursor */ - virtual void Set( EE_SYSTEM_CURSOR syscurid ) = 0; + virtual void set( EE_SYSTEM_CURSOR syscurid ) = 0; /** Set the cursor as the global cursor used in eepp ** @see SetGlobalCursor */ - virtual void Set( EE_CURSOR_TYPE cursor ); + virtual void set( EE_CURSOR_TYPE cursor ); /** A Global Cursor is a cursor setted to be used in eepp. It's the system cursor of the engine. ** The global cursor can be a Cursor ( user created cursor ) or a system cursor ( the OS cursor ). ** The system cursor is used by default, but can be override it with this function. */ - virtual void SetGlobalCursor( EE_CURSOR_TYPE cursor, Cursor * fromCursor ); + virtual void setGlobalCursor( EE_CURSOR_TYPE cursor, Cursor * fromCursor ); /** @see SetGlobalCursor */ - virtual void SetGlobalCursor( EE_CURSOR_TYPE cursor, EE_SYSTEM_CURSOR fromCursor ); + virtual void setGlobalCursor( EE_CURSOR_TYPE cursor, EE_SYSTEM_CURSOR fromCursor ); /** Force to show the cursor */ - virtual void Show() = 0; + virtual void show() = 0; /** Hides the cursor */ - virtual void Hide() = 0; + virtual void hide() = 0; /** Force to reset the state of the current seted cursor */ - virtual void Reload() = 0; + virtual void reload() = 0; /** Set to show/hide the cursor */ - virtual void Visible( bool visible ) = 0; + virtual void visible( bool visible ) = 0; /** @return If the cursor is visible in the window */ - virtual bool Visible(); + virtual bool visible(); /** @return A pointer to the curent cursor */ - Cursor * Current() const; + Cursor * getCurrent() const; /** @return The current system cursor */ - EE_SYSTEM_CURSOR CurrentSysCursor() const; + EE_SYSTEM_CURSOR getCurrentSysCursor() const; /** @return True if the current cursor seted is a system cursor */ - bool CurrentIsSysCursor() const; + bool currentIsSysCursor() const; protected: typedef std::set CursorsList; class GlobalCursor @@ -144,7 +144,7 @@ class EE_API CursorManager { bool mCurSysCursor; bool mVisible; - void InitGlobalCursors(); + void initGlobalCursors(); }; }} diff --git a/include/eepp/window/engine.hpp b/include/eepp/window/engine.hpp index 388b85085..7062eff8f 100755 --- a/include/eepp/window/engine.hpp +++ b/include/eepp/window/engine.hpp @@ -20,36 +20,36 @@ class EE_API Engine { /** Creates a new window. * SDL2, SFML backends support more than one window creation, SDL 1.2 backend only 1 window. */ - EE::Window::Window * CreateWindow( WindowSettings Settings, ContextSettings Context = ContextSettings() ); + EE::Window::Window * createWindow( WindowSettings Settings, ContextSettings Context = ContextSettings() ); /** Destroy the window instance, and set as current other window running ( if any ). * This function is only useful for multi-window environment. Avoid using it with one window context. */ - void DestroyWindow( EE::Window::Window * window ); + void destroyWindow( EE::Window::Window * window ); /** @return The current Window context. */ - EE::Window::Window * GetCurrentWindow() const; + EE::Window::Window * getCurrentWindow() const; /** Set the window as the current. */ - void SetCurrentWindow( EE::Window::Window * window ); + void setCurrentWindow( EE::Window::Window * window ); /** @return The number of windows created. */ - Uint32 GetWindowCount() const; + Uint32 getWindowCount() const; /** @return If any window is created. */ - bool Running() const; + bool isRunning() const; /** @return The current window elapsed time. */ - Time Elapsed() const; + Time elapsed() const; /** @return The current window width. */ - const Uint32& GetWidth() const; + const Uint32& getWidth() const; /** @return The current window height */ - const Uint32& GetHeight() const; + const Uint32& getHeight() const; /** @return If the window instance is inside the window list. */ - bool ExistsWindow( EE::Window::Window * window ); + bool existsWindow( EE::Window::Window * window ); /** Constructs WindowSettings from an ini file It will search for the following properties: @@ -65,7 +65,7 @@ class EE_API Engine { @param iniPath The ini file path @param iniKeyName The ini key name to search the properties */ - WindowSettings CreateWindowSettings( std::string iniPath, std::string iniKeyName = "EEPP" ); + WindowSettings createWindowSettings( std::string iniPath, std::string iniKeyName = "EEPP" ); /** Constructs WindowSettings from an ini file instance It will search for the following properties: @@ -81,7 +81,7 @@ class EE_API Engine { @param ini The ini file instance @param iniKeyName The ini key name to search the properties */ - WindowSettings CreateWindowSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); + WindowSettings createWindowSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); /** Constructs ContextSettings from an ini file\n It will search for the following properties: @@ -94,7 +94,7 @@ class EE_API Engine { @param iniPath The ini file path @param iniKeyName The ini key name to search the properties */ - ContextSettings CreateContextSettings( std::string iniPath, std::string iniKeyName = "EEPP" ); + ContextSettings createContextSettings( std::string iniPath, std::string iniKeyName = "EEPP" ); /** Constructs ContextSettings from an ini file instance\n It will search for the following properties: @@ -107,24 +107,24 @@ class EE_API Engine { @param ini The ini file instance @param iniKeyName The ini key name to search the properties */ - ContextSettings CreateContextSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); + ContextSettings createContextSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); /** Enabling Shared GL Context allows asynchronous OpenGL resource loading ( only if is supported by the backend and the OS, SDL 2 backend is the only one supported ). ** If the TextureLoader is threaded, will upload the texture in another thread to the GPU. So, it will not block the main rendering thread. ** Shared GL Context is disabled by default. */ - void EnableSharedGLContext(); + void enableSharedGLContext(); /** Disable the Shared GL Context ** @see EnableSharedGLContext() */ - void DisableSharedGLContext(); + void disableSharedGLContext(); /** @return If the Shared GL Context is enabled and ready to use. */ - bool IsSharedGLContextEnabled(); + bool isSharedGLContextEnabled(); /** @return The id of the thread that was used to initialize the OpenGL Context. */ - Uint32 GetMainThreadId(); + Uint32 getMainThreadId(); protected: friend class Window; @@ -136,23 +136,23 @@ class EE_API Engine { Engine(); - void Destroy(); + void destroy(); - Backend::WindowBackend * CreateSDLBackend( const WindowSettings& Settings ); + Backend::WindowBackend * createSDLBackend( const WindowSettings& Settings ); - Backend::WindowBackend * CreateSDL2Backend( const WindowSettings& Settings ); + Backend::WindowBackend * createSDL2Backend( const WindowSettings& Settings ); - Backend::WindowBackend * CreateSFMLBackend( const WindowSettings& Settings ); + Backend::WindowBackend * createSFMLBackend( const WindowSettings& Settings ); - EE::Window::Window * CreateSDLWindow( const WindowSettings& Settings, const ContextSettings& Context ); + EE::Window::Window * createSDLWindow( const WindowSettings& Settings, const ContextSettings& Context ); - EE::Window::Window * CreateSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ); + EE::Window::Window * createSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ); - EE::Window::Window * CreateSFMLWindow( const WindowSettings& Settings, const ContextSettings& Context ); + EE::Window::Window * createSFMLWindow( const WindowSettings& Settings, const ContextSettings& Context ); - EE::Window::Window * CreateDefaultWindow( const WindowSettings& Settings, const ContextSettings& Context ); + EE::Window::Window * createDefaultWindow( const WindowSettings& Settings, const ContextSettings& Context ); - Uint32 GetDefaultBackend() const; + Uint32 getDefaultBackend() const; }; }} diff --git a/include/eepp/window/input.hpp b/include/eepp/window/input.hpp index 379b5518c..80693a56b 100644 --- a/include/eepp/window/input.hpp +++ b/include/eepp/window/input.hpp @@ -21,117 +21,117 @@ class EE_API Input { virtual ~Input(); /** Update the Input */ - virtual void Update() = 0; + virtual void update() = 0; /** @return If the mouse and keyboard are grabed. */ - virtual bool GrabInput() = 0; + virtual bool grabInput() = 0; /** Grab or Ungrab the mouse and keyboard. */ - virtual void GrabInput( const bool& Grab ) = 0; + virtual void grabInput( const bool& Grab ) = 0; /** Inject the mouse position given */ - virtual void InjectMousePos( const Uint16& x, const Uint16& y ) = 0; + virtual void injectMousePos( const Uint16& x, const Uint16& y ) = 0; /** @return If keyboard key was released */ - bool IsKeyUp( const EE_KEY& Key ); + bool isKeyUp( const EE_KEY& Key ); /** @return If keyboard key it's pressed */ - bool IsKeyDown( const EE_KEY& Key ); + bool isKeyDown( const EE_KEY& Key ); /** Inject the key state of a key as KEY UP or RELEASE */ - void InjectKeyUp( const EE_KEY& Key ); + void injectKeyUp( const EE_KEY& Key ); /** Inject the key state of a key as KEY DOWN or PRESSED */ - void InjectKeyDown( const EE_KEY& Key ); + void injectKeyDown( const EE_KEY& Key ); /** Inject the mouse position given */ - void InjectMousePos( const Vector2i& Pos ); + void injectMousePos( const Vector2i& Pos ); /** Inject the mouse button as pressed */ - void InjectButtonPress( const Uint32& Button ); + void injectButtonPress( const Uint32& Button ); /** Inject the mouse button as released */ - void InjectButtonRelease( const Uint32& Button ); + void injectButtonRelease( const Uint32& Button ); /** @return If the Control Key is pressed */ - bool ControlPressed() const; + bool controlPressed() const; /** @return If the Shift Key is pressed */ - bool ShiftPressed() const; + bool shiftPressed() const; /** @return If the Alt Key is pressed */ - bool AltPressed() const; + bool altPressed() const; /** @return If the Meta Key is pressed */ - bool MetaPressed() const; + bool metaPressed() const; /** @return If mouse left button it's pressed */ - bool MouseLeftPressed() const; + bool mouseLeftPressed() const; /** @return If mouse right button it's pressed */ - bool MouseRightPressed() const; + bool mouseRightPressed() const; /** @return If mouse middle button it's pressed */ - bool MouseMiddlePressed() const; + bool mouseMiddlePressed() const; /** @return If mouse left click was clicked */ - bool MouseLeftClick() const; + bool mouseLeftClick() const; /** @return If mouse right click was clicked */ - bool MouseRightClick() const; + bool mouseRightClick() const; /** @return If mouse middle button (scroll button) was clicked. */ - bool MouseMiddleClick() const; + bool mouseMiddleClick() const; /** @return If mouse left click was double clicked */ - bool MouseLeftDoubleClick() const; + bool mouseLeftDoubleClick() const; /** @return If mouse right click was double clicked */ - bool MouseRightDoubleClick() const; + bool mouseRightDoubleClick() const; /** @return If mouse middle button (scroll button) was double clicked. */ - bool MouseMiddleDoubleClick() const; + bool mouseMiddleDoubleClick() const; /** @return If mouse wheel up scrolled */ - bool MouseWheelUp() const; + bool mouseWheelUp() const; /** @return If mouse wheel down scrolled */ - bool MouseWheelDown() const; + bool mouseWheelDown() const; /** Push a new input callback. * @return The Callback Id */ - Uint32 PushCallback( const InputCallback& cb ); + Uint32 pushCallback( const InputCallback& cb ); /** Pop the callback id indicated. */ - void PopCallback( const Uint32& CallbackId ); + void popCallback( const Uint32& CallbackId ); /** @return The Mouse position vector */ - Vector2i GetMousePos() const; + Vector2i getMousePos() const; /** @return The position vector converted to float */ - Vector2f GetMousePosf(); + Vector2f getMousePosf(); /** This will change the value of the mouse pos, will not REALLY move the mouse ( for that is InjectMousePos ). */ - void SetMousePos( const Vector2i& Pos ); + void setMousePos( const Vector2i& Pos ); /** @return The mouse position over the current view */ - Vector2i GetMousePosFromView( const View& View ); + Vector2i getMousePosFromView( const View& View ); /** @return The Mouse X axis position */ - Uint16 MouseX() const; + Uint16 mouseX() const; /** @return The Mouse Y axis position */ - Uint16 MouseY() const; + Uint16 mouseY() const; /** Set the mouse speed ( only affects grabed windows ) */ - void MouseSpeed( const Float& Speed ); + void mouseSpeed( const Float& Speed ); /** @return The Mouse Speed */ - const Float& MouseSpeed() const; + const Float& mouseSpeed() const; /** @return The bitflags of the last pressed trigger (before the current state of press trigger) */ - const Uint32& LastPressTrigger() const; + const Uint32& lastPressTrigger() const; /** @return The current state as flags of the mouse press trigger @brief Triggers are used mostly for the UI components. They are simple to manage. @@ -139,52 +139,52 @@ class EE_API Input { For Example The usage is simple, to know if the left mouse click is pressed you need to check against the left mouse flag mask if ( myInput->PressTrigger() & EE_BUTTON_LMASK ) ... */ - const Uint32& PressTrigger() const; + const Uint32& pressTrigger() const; /** @return The current state as flags of the mouse release trigger */ - const Uint32& ReleaseTrigger() const; + const Uint32& releaseTrigger() const; /** @return The current state as flags of the mouse click trigger */ - const Uint32& ClickTrigger() const; + const Uint32& clickTrigger() const; /** @return The current state as flags of the mouse double click trigger */ - const Uint32& DoubleClickTrigger() const; + const Uint32& doubleClickTrigger() const; /** @return The double click interval in milliseconds ( default 500 ms ) */ - const Uint32& DoubleClickInterval() const; + const Uint32& doubleClickInterval() const; /** Set the double click interval in milliseconds */ - void DoubleClickInterval( const Uint32& Interval ); + void doubleClickInterval( const Uint32& Interval ); /** Clean the keyboard and mouse states */ - void CleanStates(); + void cleanStates(); /** Send an input event to the window */ - void SendEvent( InputEvent * Event ); + void sendEvent( InputEvent * Event ); /** @return The joystick manager */ - JoystickManager * GetJoystickManager() const; + JoystickManager * getJoystickManager() const; /** @return The maximun number of fingers */ - Uint32 GetFingerCount(); + Uint32 getFingerCount(); /** @return The input finger from it's index */ - InputFinger * GetFingerIndex( const Uint32& Index ); + InputFinger * getFingerIndex( const Uint32& Index ); /** @return The Input Finder from it's id */ - InputFinger * GetFinger( const Int64& fingerId ); + InputFinger * getFinger( const Int64& fingerId ); /** @return A list of the input finders that are currently down */ - std::list GetFingersDown(); + std::list getFingersDown(); /** @return A list of the input finders that were down in the last update */ - std::list GetFingersWasDown(); + std::list getFingersWasDown(); protected: friend class Window; Input( EE::Window::Window * window, JoystickManager * joystickmanager ); - virtual void Init() = 0; + virtual void init() = 0; EE::Window::Window * mWindow; JoystickManager * mJoystickManager; @@ -212,11 +212,11 @@ class EE_API Input { std::map mCallbacks; - void ProcessEvent( InputEvent * Event ); + void processEvent( InputEvent * Event ); - InputFinger * GetFingerId( const Int64& fingerId ); + InputFinger * getFingerId( const Int64& fingerId ); - void ResetFingerWasDown(); + void resetFingerWasDown(); }; }} diff --git a/include/eepp/window/inputfinger.hpp b/include/eepp/window/inputfinger.hpp index 05aeb5aec..ec81f1871 100644 --- a/include/eepp/window/inputfinger.hpp +++ b/include/eepp/window/inputfinger.hpp @@ -25,17 +25,17 @@ class InputFinger { bool was_down; /** @return If is currently pressed */ - bool IsDown(); + bool isDown(); /** @return If was down in the last update */ - bool WasDown(); + bool wasDown(); /** @return The current position of the finger */ - Vector2i Pos(); + Vector2i pos(); protected: friend class Input; - void WriteLast(); + void writeLast(); }; }} diff --git a/include/eepp/window/inputtextbuffer.hpp b/include/eepp/window/inputtextbuffer.hpp index 334138ce9..5b6419fb3 100755 --- a/include/eepp/window/inputtextbuffer.hpp +++ b/include/eepp/window/inputtextbuffer.hpp @@ -33,103 +33,103 @@ class EE_API InputTextBuffer { ~InputTextBuffer(); /** @return The current buffer */ - String Buffer() const; + String buffer() const; /** Set a new current buffer */ - void Buffer( const String& str ); + void buffer( const String& str ); /** @return If input buffer is active */ - bool Active() const; + bool active() const; /** Set the state of the input buffer */ - void Active( const bool& Active ); + void active( const bool& active ); /** @return If new line is supported */ - bool SupportNewLine(); + bool supportNewLine(); /** Support new line consist of allowing to add a new line when key return is pressed. */ - void SupportNewLine( const bool& SupportNewLine ); + void supportNewLine( const bool& supportNewLine ); /** @return If Free Editing is enabled */ - bool SupportFreeEditing() const; + bool supportFreeEditing() const; /** Free editing consist on the capability of moving the cursor position over the buffer, to write over the buffer, and not only after the last character. */ - void SupportFreeEditing( const bool& Support); + void supportFreeEditing( const bool& Support); /** Block all the inserts, allow only numeric characters. */ - void AllowOnlyNumbers( const bool& onlynums, const bool& allowdots = false ); + void allowOnlyNumbers( const bool& onlynums, const bool& allowdots = false ); /** @return If is only allowing numbers */ - bool AllowOnlyNumbers(); + bool allowOnlyNumbers(); /** @return If is only allowing numbers, it allow floating point numbers? */ - bool AllowDotsInNumbers(); + bool allowDotsInNumbers(); /** @return If text selection feature is enabled */ - bool TextSelectionEnabled(); + bool textSelectionEnabled(); /** Enable text selection */ - void TextSelectionEnabled( const bool& enabled ); + void textSelectionEnabled( const bool& enabled ); /** Start the input buffer */ - void Start(); + void start(); /** Clear the buffer */ - void Clear(); + void clear(); /** Internal callback, don't call it */ - void Update( InputEvent * Event ); + void update( InputEvent * Event ); /** A callback for the key return */ - void SetReturnCallback( EnterCallback EC ); + void setReturnCallback( EnterCallback EC ); /** @return If something changed since last update */ - bool ChangedSinceLastUpdate(); + bool changedSinceLastUpdate(); /** Set if changed since last update */ - void ChangedSinceLastUpdate( const bool& Changed ); + void changedSinceLastUpdate( const bool& Changed ); /** @return The Cursor Position (where is the cursor editing) */ - int CurPos() const; + int curPos() const; /** Set the cursor position */ - void CurPos( const Uint32& pos ); + void curPos( const Uint32& pos ); /** This function it's for helping the Font class to locate the cursor position for the correct rendering of it. * @param LastNewLinePos This will return the position of the closest "\n" to the current Cursor Pos * @return On which line it's the cursor */ - Uint32 GetCurPosLinePos( Uint32& LastNewLinePos ); + Uint32 getCurPosLinePos( Uint32& LastNewLinePos ); /** Push the char you want to ignore */ - void PushIgnoredChar( const Uint32& ch ); + void pushIgnoredChar( const Uint32& ch ); /** Set the new max length */ - void MaxLength( const Uint32& Max ); + void maxLength( const Uint32& Max ); /** @return The Max Length */ - const Uint32& MaxLength() const; + const Uint32& maxLength() const; /** Support copy paste */ - void SupportCopyPaste( const bool& support ); + void supportCopyPaste( const bool& support ); /** @return Support copy paste */ - bool SupportCopyPaste(); + bool supportCopyPaste(); /** Set the cursor to the last character of the buffer. */ - void CursorToEnd(); + void cursorToEnd(); /** Set the selection cursor initial position */ - void SelCurInit( const Int32& init ); + void selCurInit( const Int32& init ); /** Set the selection cursor final position */ - void SelCurEnd( const Int32& end ); + void selCurEnd( const Int32& end ); /** @return The selection cursor initial position */ - const Int32& SelCurInit() const; + const Int32& selCurInit() const; /** @return The selection cursor final position */ - const Int32& SelCurEnd() const; + const Int32& selCurEnd() const; protected: EE::Window::Window * mWindow; String mText; @@ -142,35 +142,35 @@ class EE_API InputTextBuffer { Int32 mSelCurInit; Int32 mSelCurEnd; - void AutoPrompt( const bool& set ); + void autoPrompt( const bool& set ); - bool AutoPrompt(); + bool autoPrompt(); - bool CanAdd(); + bool canAdd(); - void MovePromptRowDown( const bool& breakit ); + void movePromptRowDown( const bool& breakit ); - void MovePromptRowUp( const bool& breakit ); + void movePromptRowUp( const bool& breakit ); - void PromptToLeftFirstNoChar(); + void promptToLeftFirstNoChar(); - void PromptToRightFirstNoChar(); + void promptToRightFirstNoChar(); - void EraseToPrevNoChar(); + void eraseToPrevNoChar(); - void EraseToNextNoChar(); + void eraseToNextNoChar(); - bool IsIgnoredChar( const Uint32& c ); + bool isIgnoredChar( const Uint32& c ); - bool ValidChar( const Uint32& c ); + bool validChar( const Uint32& c ); - void TryAddChar( const Uint32& c ); + void tryAddChar( const Uint32& c ); - void ShiftSelection( const int& lastPromtpPos ); + void shiftSelection( const int& lastPromtpPos ); - void RemoveSelection(); + void removeSelection(); - void ResetSelection(); + void resetSelection(); }; }} diff --git a/include/eepp/window/joystick.hpp b/include/eepp/window/joystick.hpp index c9fb88b13..1ef97d3d5 100644 --- a/include/eepp/window/joystick.hpp +++ b/include/eepp/window/joystick.hpp @@ -14,58 +14,58 @@ class EE_API Joystick { virtual ~Joystick(); /** Close the joystick */ - virtual void Close(); + virtual void close(); /** Open the joystick */ - virtual void Open(); + virtual void open(); /** Update the current joystick states ( users don't need to call this manually ) */ - virtual void Update() = 0; + virtual void update() = 0; /** @return The hat index state * @see EE_HAT_POS to get info about the possible states * You just need to compare the state against what position you need, example if ( myJoy->GetHat() == HAT_LEFT ) { ... do whatever you need to do } */ - virtual Uint8 GetHat( const Int32& index = 0 ) = 0; + virtual Uint8 getHat( const Int32& index = 0 ) = 0; /** @return the axis state * @see EE_JOYAXIS to know the possible axis ( usually you will use AXIS_X and AXIS_Y * Axis values goes from AXIS_MIN to AXIS_MAX */ - virtual Float GetAxis( const Int32& axis ) = 0; + virtual Float getAxis( const Int32& axis ) = 0; /** @return The ball motion position */ - virtual Vector2i GetBallMotion( const Int32& ball ) = 0; + virtual Vector2i getBallMotion( const Int32& ball ) = 0; /** @return True if the joystick is plugged in */ - virtual bool Plugged() const = 0; + virtual bool isPlugged() const = 0; /** ReOpen the joysick ( this is the same of doing Close and the Open ) */ - virtual void ReOpen(); + virtual void reOpen(); /** @return The number of hats */ - const Int32& GetNumHats() const; + const Int32& getNumHats() const; /** @return The number of buttons */ - const Int32& GetNumButtons() const; + const Int32& getNumButtons() const; /** @return The number of axes */ - const Int32& GetNumAxes() const; + const Int32& getNumAxes() const; /** @return The number of balls */ - const Int32& GetNumBalls() const; + const Int32& getNumBalls() const; /** @return The buttons states flags */ - const Uint32& GetButtonTrigger() const; + const Uint32& getButtonTrigger() const; /** @return The buttons released states flags */ - const Uint32& GetButtonUpTrigger() const; + const Uint32& getButtonUpTrigger() const; /** @return If the button index is down ( pressed ) */ - bool IsButtonDown( const Int32& index ); + bool isButtonDown( const Int32& index ); /** @return If the button index is up ( released ) */ - bool IsButtonUp( const Int32& index ); + bool isButtonUp( const Int32& index ); protected: friend class JoystickManager; Uint32 mIndex; @@ -78,9 +78,9 @@ class EE_API Joystick { Uint32 mButtonDownLast; Uint32 mButtonUp; - void UpdateButton( const Uint32& index, const bool& down ); + void updateButton( const Uint32& index, const bool& down ); - virtual void ClearStates(); + virtual void clearStates(); }; }} diff --git a/include/eepp/window/joystickmanager.hpp b/include/eepp/window/joystickmanager.hpp index 4b6452774..830780896 100644 --- a/include/eepp/window/joystickmanager.hpp +++ b/include/eepp/window/joystickmanager.hpp @@ -14,25 +14,25 @@ class EE_API JoystickManager { virtual ~JoystickManager(); /** @return The number of joysticks attached to the system */ - virtual Uint32 Count(); + virtual Uint32 count(); /** Update the states of all joysticks */ - virtual void Update() = 0; + virtual void update() = 0; /** @return The joystick instante of the joystick index */ - Joystick * GetJoystick( const Uint32& index ); + Joystick * getJoystick( const Uint32& index ); /** Rescan all joysticks to look for new joystick connected. * This could be slow on some backends, and unnecessary on others. * Is slow in SDL. SFML and SDL2 shouldn't need this. */ - virtual void Rescan(); + virtual void rescan(); /** Close all the joysticks */ - virtual void Close(); + virtual void close(); /** Open all the joysticks */ - virtual void Open(); + virtual void open(); protected: friend class Joystick; @@ -42,7 +42,7 @@ class EE_API JoystickManager { Uint32 mCount; - virtual void Create( const Uint32& index ) = 0; + virtual void create( const Uint32& index ) = 0; }; }} diff --git a/include/eepp/window/platformimpl.hpp b/include/eepp/window/platformimpl.hpp index 514c6cd91..8149d23f6 100644 --- a/include/eepp/window/platformimpl.hpp +++ b/include/eepp/window/platformimpl.hpp @@ -40,72 +40,72 @@ class PlatformImpl { virtual ~PlatformImpl(); /** Minimize the window */ - virtual void MinimizeWindow() = 0; + virtual void minimizeWindow() = 0; /** Maximize the window */ - virtual void MaximizeWindow() = 0; + virtual void maximizeWindow() = 0; /** @return true if the window is maximized */ - virtual bool IsWindowMaximized() = 0; + virtual bool isWindowMaximized() = 0; /** Hide the window */ - virtual void HideWindow() = 0; + virtual void hideWindow() = 0; /** Raise the window */ - virtual void RaiseWindow() = 0; + virtual void raiseWindow() = 0; /** Show the window */ - virtual void ShowWindow() = 0; + virtual void showWindow() = 0; /** Move the window to the desired position * @param left Move to the x-axis position * @param top Move to the y-axis position */ - virtual void MoveWindow( int left, int top ) = 0; + virtual void moveWindow( int left, int top ) = 0; /** Set the GL context as the current context */ - virtual void SetContext( eeWindowContex Context ) = 0; + virtual void setContext( eeWindowContex Context ) = 0; /** @return The current window position */ - virtual Vector2i Position() = 0; + virtual Vector2i getPosition() = 0; /** Force to show the mouse cursor */ - virtual void ShowMouseCursor() = 0; + virtual void showMouseCursor() = 0; /** Hide the mouse cursor */ - virtual void HideMouseCursor() = 0; + virtual void hideMouseCursor() = 0; /** Creates a cursor from a texture * @param tex The texture pointer to use as cursor * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image * @param img The image path * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image path * @param path The image pointer to use as cursor * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) = 0; /** Set the the current cursor by its cursor pointer */ - virtual void SetMouseCursor( Cursor * cursor ) = 0; + virtual void setMouseCursor( Cursor * cursor ) = 0; /** Set the cursor using a system cursor */ - virtual void SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) = 0; + virtual void setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) = 0; /** Force to reset the state of the current seted cursor */ - virtual void RestoreCursor() = 0; + virtual void restoreCursor() = 0; - virtual eeWindowContex GetWindowContext() = 0; + virtual eeWindowContex getWindowContext() = 0; protected: EE::Window::Window * mWindow; }; diff --git a/include/eepp/window/view.hpp b/include/eepp/window/view.hpp index 8b10c2266..6d0d06897 100755 --- a/include/eepp/window/view.hpp +++ b/include/eepp/window/view.hpp @@ -17,34 +17,34 @@ class EE_API View { ~View(); /** Offset the position */ - void Move( const int& OffsetX, const int& OffsetY ); + void move( const int& OffsetX, const int& OffsetY ); /** Offset the position */ - void Move( const Vector2i& Offset ); + void move( const Vector2i& Offset ); /** Scale the current view (from center) */ - void Scale( const Float& Factor ); + void scale( const Float& Factor ); /** Scale the current view (from center) */ - void Scale( const Vector2f& Factor ); + void scale( const Vector2f& Factor ); /** @return The center position of the view */ - Vector2i Center() const; + Vector2i center() const; /** Set the center position of the view ( will move it if is needed ) */ - void Center( const Vector2i& Center ); + void center( const Vector2i& center ); /** @return The current view ( Left = X, Right = Width, Top = Y, Bottom = Height ) */ - Recti GetView() const { return mView; } + Recti getView() const { return mView; } /** Set a new position to the view */ - void SetPosition( const int& X, const int& Y ); + void setPosition( const int& X, const int& Y ); /** Set a new size to the view */ - void SetSize( const int& Width, const int& Height ); + void setSize( const int& Width, const int& Height ); /** Creates a new view */ - void SetView( const int& X, const int& Y, const int& Width, const int& Height ); + void setView( const int& X, const int& Y, const int& Width, const int& Height ); private: friend class Window; @@ -52,9 +52,9 @@ class EE_API View { Recti mView; Vector2f mCenter; - void CalcCenter(); + void calcCenter(); - bool NeedUpdate() const; + bool needUpdate() const; }; }} diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 0cbee5e2c..4af0f8255 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -155,149 +155,149 @@ class EE_API Window { virtual ~Window(); /** Creates a new window and GL context */ - virtual bool Create( WindowSettings Settings, ContextSettings Context ) = 0; + virtual bool create( WindowSettings Settings, ContextSettings Context ) = 0; /** Toogle the screen to Fullscreen, if it's in fullscreen toogle to windowed mode. */ - virtual void ToggleFullscreen() = 0; + virtual void toggleFullscreen() = 0; /** Set the window caption */ - virtual void Caption( const std::string& Caption ) = 0; + virtual void caption( const std::string& caption ) = 0; /** Set the Window icon */ - virtual bool Icon( const std::string& Path ) = 0; + virtual bool icon( const std::string& Path ) = 0; /** This will attempt to iconify/minimize the window. */ - virtual void Minimize(); + virtual void minimize(); /** Maximize the Window */ - virtual void Maximize(); + virtual void maximize(); /** @return true if the window is maximized */ - virtual bool IsMaximized(); + virtual bool isMaximized(); /** This will attempt to hide the window */ - virtual void Hide(); + virtual void hide(); /** This will attempt to raise the window */ - virtual void Raise(); + virtual void raise(); /** This will attempt to show the window */ - virtual void Show(); + virtual void show(); /** This will attemp to move the window over the desktop to the position */ - virtual void Position( Int16 Left, Int16 Top ); + virtual void position( Int16 Left, Int16 Top ); /** @return The Current Window Position */ - virtual Vector2i Position(); + virtual Vector2i position(); /** Set as current context the default context ( the context used for the window creation ) */ - virtual void SetDefaultContext(); + virtual void setDefaultContext(); /** @return If the current window is active */ - virtual bool Active() = 0; + virtual bool active() = 0; /** @return If the current window is visible */ - virtual bool Visible() = 0; + virtual bool visible() = 0; /** Set the size of the window for a windowed window */ - virtual void Size( Uint32 Width, Uint32 Height ); + virtual void size( Uint32 Width, Uint32 Height ); /** @return The caption of the titlebar */ - virtual std::string Caption(); + virtual std::string caption(); /** Change the window size or the screen resolution * @param Width New screen width * @param Height New screen height * @param Windowed Windowed or Fullscreen */ - virtual void Size( Uint32 Width, Uint32 Height, bool Windowed ) = 0; + virtual void size( Uint32 Width, Uint32 Height, bool isWindowed ) = 0; /** @return The resolutions that support the video card */ - virtual std::vector GetDisplayModes() const = 0; + virtual std::vector getDisplayModes() const = 0; /** Set the Screen Gamma. Default is (1,1,1). Accept values between 0.1 and 10. */ - virtual void SetGamma( Float Red, Float Green, Float Blue ) = 0; + virtual void setGamma( Float Red, Float Green, Float Blue ) = 0; /** The the OpenGL context as the current context */ - virtual void SetCurrentContext( eeWindowContex Context ); + virtual void setCurrentContext( eeWindowContex Context ); /** @return The current OpenGL context */ - virtual eeWindowContex GetContext() const; + virtual eeWindowContex getContext() const; /** @return The window handler */ - virtual eeWindowHandle GetWindowHandler() = 0; + virtual eeWindowHandle getWindowHandler() = 0; /** @brief Clear the window back buffer This function is usually called once every frame, to clear the previous frame content. */ - virtual void Clear(); + virtual void clear(); /** Render the Scene to Screen @param clear Clear after swapping buffers? It will not work if the target platform is Emscripten. Since there's no swap buffers. */ - virtual void Display( bool clear = false ); + virtual void display( bool clear = false ); /** @return The elapsed time for the last frame rendered */ - virtual System::Time Elapsed() const; + virtual System::Time elapsed() const; /** @return The current frames per second of the screen */ virtual Uint32 FPS() const; /** @return If the screen is windowed */ - virtual bool Windowed() const; + virtual bool isWindowed() const; /** @return If the main window is resizeable */ - virtual bool Resizeable() const; + virtual bool isResizeable() const; /** @return The window size */ - virtual Sizei Size(); + virtual Sizei size(); /** @return The Window Width */ - virtual const Uint32& GetWidth() const; + virtual const Uint32& getWidth() const; /** @return The Window Height */ - virtual const Uint32& GetHeight() const; + virtual const Uint32& getHeight() const; /** @return The current desktop resolution */ - virtual const Sizei& GetDesktopResolution(); + virtual const Sizei& getDesktopResolution(); /** Center the window to the desktop ( if windowed ) */ - virtual void Center(); + virtual void center(); /** @return If the aplication is running returns true ( If you Init correctly the window and is running ). */ - bool Running() const; + bool isRunning() const; /** @return If the window was created */ - bool Created() const; + bool created() const; /** Close the window if is running */ - virtual void Close(); + virtual void close(); /** Set the current active view @param View New view to use (pass GetDefaultView() to set the default view) */ - void SetView( const View& View ); + void setView( const View& View ); /** Get the current view */ - const View& GetView() const; + const View& getView() const; /** Get the default view of the window */ - const View& GetDefaultView() const; + const View& getDefaultView() const; /** This will set the default rendering states and view to render in 2D mode */ - void Setup2D( const bool& KeepView = false ); + void setup2D( const bool& KeepView = false ); /** Set a new 2D projection matrix */ - void Set2DProjection( const Uint32& Width, const Uint32& Height ); + void set2DProjection( const Uint32& Width, const Uint32& Height ); /** Set the current Viewport ( and creates a new ortho proyection if needed ) */ - void SetViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix = true ); + void setViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix = true ); /** Set the window background color */ - void BackColor( const RGB& Color ); + void backColor( const RGB& Color ); /** @return The background clear color */ - const RGB& BackColor() const; + const RGB& backColor() const; /** Captures the window front buffer and saves it to disk. \n * You have to call it before Display, and after render all the objects. \n @@ -305,149 +305,149 @@ class EE_API Window { * You can set only the path to save the files, like "screenshots/" * @return False if failed, otherwise returns True */ - bool TakeScreenshot( std::string filepath = "", const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG ); + bool takeScreenshot( std::string filepath = "", const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG ); /** @return The pointer to the Window Info ( read only ) */ - const WindowInfo * GetWindowInfo() const; + const WindowInfo * getWindowInfo() const; /** Set a frame per second limit. It's not 100 % accurate. */ - void FrameRateLimit( const Uint32& FrameRateLimit ); + void frameRateLimit( const Uint32& frameRateLimit ); /** Get a frame per second limit. */ - Uint32 FrameRateLimit(); + Uint32 frameRateLimit(); /** Set the current Clipping area ( default the entire window, SCISSOR TEST ). */ - void ClipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ); + void clipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ); /** Disable the Clipping area */ - void ClipDisable(); + void clipDisable(); /** Clip the area with a plane. */ - void ClipPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); + void clipPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); /** Disable the clip plane area. */ - void ClipPlaneDisable(); + void clipPlaneDisable(); /** @return The clipboard manager */ - Clipboard * GetClipboard() const; + Clipboard * getClipboard() const; /** @return The input manager */ - Input * GetInput() const; + Input * getInput() const; /** @return The cursor manager */ - CursorManager * GetCursorManager() const; + CursorManager * getCursorManager() const; /** Push a new window resize callback. * @return The Callback Id */ - Uint32 PushResizeCallback( const WindowResizeCallback& cb ); + Uint32 pushResizeCallback( const WindowResizeCallback& cb ); /** Pop the callback id indicated. */ - void PopResizeCallback( const Uint32& CallbackId ); + void popResizeCallback( const Uint32& CallbackId ); /** @return The pointer to the instance of the platform implementation functions. */ - Platform::PlatformImpl * GetPlatform() const; + Platform::PlatformImpl * getPlatform() const; /** * @brief Start accepting Unicode text input events. * This function will show the on-screen keyboard if supported. * - * @sa StopTextInput() - * @sa SetTextInputRect() - * @sa HasScreenKeyboardSupport() + * @sa stopTextInput() + * @sa setTextInputRect() + * @sa hasScreenKeyboardSupport() */ - virtual void StartTextInput(); + virtual void startTextInput(); /** * @brief Return whether or not Unicode text input events are enabled. * - * @sa StartTextInput() - * @sa StopTextInput() + * @sa startTextInput() + * @sa stopTextInput() */ - virtual bool IsTextInputActive(); + virtual bool isTextInputActive(); /** * @brief Stop receiving any text input events. * This function will hide the on-screen keyboard if supported. * - * @sa StartTextInput() - * @sa HasScreenKeyboardSupport() + * @sa startTextInput() + * @sa hasScreenKeyboardSupport() */ - virtual void StopTextInput(); + virtual void stopTextInput(); /** * @brief Set the rectangle used to type Unicode text inputs. * This is used as a hint for IME and on-screen keyboard placement. * - * @sa StartTextInput() + * @sa startTextInput() */ - virtual void SetTextInputRect( Recti& rect ); + virtual void setTextInputRect( Recti& rect ); /** * @brief Returns whether the platform has some screen keyboard support. * @return true if some keyboard support is available else false. * @note Not all screen keyboard functions are supported on all platforms. * - * @sa IsScreenKeyboardShown() + * @sa isScreenKeyboardShown() */ - virtual bool HasScreenKeyboardSupport(); + virtual bool hasScreenKeyboardSupport(); /** * @brief Returns whether the screen keyboard is shown for given window. * @return true if screen keyboard is shown else false. * - * @sa HasScreenKeyboardSupport() + * @sa hasScreenKeyboardSupport() */ - virtual bool IsScreenKeyboardShown(); + virtual bool isScreenKeyboardShown(); #if EE_PLATFORM == EE_PLATFORM_ANDROID /** @return The JNI environment for the current thread * This returns JNIEnv*, but the prototype is void* so we don't need jni.h */ - virtual void * GetJNIEnv(); + virtual void * getJNIEnv(); /** @return The SDL Activity object for the application * This returns jobject, but the prototype is void* so we don't need jni.h */ - virtual void * GetActivity(); + virtual void * getActivity(); /** @return The current state of external storage, a bitmask of these values: * EE_ANDROID_EXTERNAL_STORAGE_READ * EE_ANDROID_EXTERNAL_STORAGE_WRITE * If external storage is currently unavailable, this will return 0. */ - virtual int GetExternalStorageState(); + virtual int getExternalStorageState(); /** @return The path used for internal storage for this application. * This path is unique to your application and cannot be written to * by other applications. */ - virtual std::string GetInternalStoragePath(); + virtual std::string getInternalStoragePath(); /** @return The path used for external storage for this application. * This path is unique to your application, but is public and can be * written to by other applications. */ - virtual std::string GetExternalStoragePath(); + virtual std::string getExternalStoragePath(); /** @return The application APK file path */ - virtual std::string GetApkPath(); + virtual std::string getApkPath(); #endif /** @return True if the current window support a threaded GL Context. This means that supports OpenGL Shared Contexts ( multithreaded opengl contexts ). ** Only supported with SDL2 backend.*/ - virtual bool IsThreadedGLContext(); + virtual bool isThreadedGLContext(); /** Activates the shared GL context in the current thread. */ - virtual void SetGLContextThread(); + virtual void setGLContextThread(); /** Deactviates the shared GL context in the current thread. */ - virtual void UnsetGLContextThread(); + virtual void unsetGLContextThread(); /** Runs the main loop function passed as parameter ** @param func The main loop function ** @param fps The desired FPS ( 0 = infinite ) */ - void RunMainLoop( void (*func)(), int fps = 0 ); + void runMainLoop( void (*func)(), int fps = 0 ); protected: friend class Engine; @@ -492,31 +492,31 @@ class EE_API Window { FrameData mFrameData; /** Set the flag state to be the current window */ - virtual void SetCurrent(); + virtual void setCurrent(); /** Swap Buffers call */ - virtual void SwapBuffers() = 0; + virtual void swapBuffers() = 0; /** Obtain the Main Context, this is called after the OpenGL context creation. */ - virtual void GetMainContext(); + virtual void getMainContext(); - virtual void CreatePlatform(); + virtual void createPlatform(); - void SendVideoResizeCb(); + void sendVideoResizeCb(); - void CreateView(); + void createView(); - void CalculateFps(); + void calculateFps(); - void LimitFps(); + void limitFps(); - void GetElapsedTime(); + void getElapsedTime(); - void ViewCheckUpdate(); + void viewCheckUpdate(); - void LogSuccessfulInit( const std::string& BackendName, const std::string& ProcessPath = "" ); + void logSuccessfulInit( const std::string& BackendName, const std::string& ProcessPath = "" ); - void LogFailureInit( const std::string& ClassName, const std::string& BackendName ); + void logFailureInit( const std::string& ClassName, const std::string& BackendName ); }; }} diff --git a/premake4.lua b/premake4.lua index 609a21353..799a0ddea 100644 --- a/premake4.lua +++ b/premake4.lua @@ -147,7 +147,7 @@ newoption { trigger = "with-gles1", description = "Compile with GLES1 support" } newoption { trigger = "use-frameworks", description = "In Mac OS X it will try to link the external libraries from its frameworks. For example, instead of linking against SDL2 it will link agains SDL2.framework." } newoption { trigger = "with-backend", - description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.\n\t\t\tIt's possible to build with more than one backend support.\n\t\t\t\tUse comma to separate the backends to build ( you can't mix SDL and SDL2, you'll get random crashes ).\n\t\t\t\tExample: --with-backend=SDL2,SFML", + description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.\n\t\t\tIt's possible to build with more than one backend support.\n\t\t\t\tUse comma to separate the backends to build ( you can't mix SDL and SDL2, you'll get random crashes ).\n\t\t\t\tExample: --with-backend=SDL2+SFML", allowed = { { "SDL", "SDL 1.2" }, { "SDL2", "SDL2 (default and recommended)" }, @@ -521,6 +521,7 @@ function insert_static_backend( name ) end function add_sdl2() + print("Using SDL2 backend"); files { "src/eepp/window/backend/SDL2/*.cpp" } defines { "EE_BACKEND_SDL_ACTIVE", "EE_SDL_VERSION_2" } @@ -532,6 +533,7 @@ function add_sdl2() end function add_sdl() + print("Using SDL backend"); --- SDL is LGPL. It can't be build as static library table.insert( link_list, get_backend_link_name( "SDL" ) ) files { "src/eepp/window/backend/SDL/*.cpp" } @@ -539,6 +541,7 @@ function add_sdl() end function add_sfml() + print("Using SFML backend"); files { "src/eepp/window/backend/SFML/*.cpp" } defines { "EE_BACKEND_SFML_ACTIVE" } diff --git a/projects/linux/ee.files b/projects/linux/ee.files index 34ba41313..cfc6f2328 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -1,3 +1,6 @@ +ee.config +ee.includes +../../../eeiv/src/capp.cpp ../../include/eepp/audio/soundmanager.hpp ../../include/eepp/audio/soundloader.hpp ../../include/eepp/audio/soundstream.hpp diff --git a/projects/linux/ee.includes b/projects/linux/ee.includes index 75bde3e90..c4d88f340 100644 --- a/projects/linux/ee.includes +++ b/projects/linux/ee.includes @@ -2,3 +2,4 @@ ../../include/ ../../src/examples/strobe ../../../eeiv/src +. diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index 13be271e7..ad06fdba8 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -909,7 +909,7 @@ void MapEditor::FileMenuClick( const UIEvent * Event ) { MsgBox->Show(); } else if ( "Quit" == txt ) { if ( mUIWindow == UIManager::instance()->MainControl() ) { - UIManager::instance()->GetWindow()->Close(); + UIManager::instance()->GetWindow()->close(); } else { mUIWindow->CloseWindow(); } @@ -1247,7 +1247,7 @@ void MapEditor::AddGameObject() { Vector2i p( tMap->GetMouseMapPos() ); - if ( UIManager::instance()->GetInput()->IsKeyDown( KEY_LCTRL ) ) { + if ( UIManager::instance()->GetInput()->isKeyDown( KEY_LCTRL ) ) { p = tMap->GetMouseTilePosCoords(); } diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index 3e90e5fe2..b2d7163cb 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -99,7 +99,7 @@ void UIMap::Update() { mMap->Update(); if ( mEnabled && mVisible && IsMouseOver() ) { - Uint32 Flags = UIManager::instance()->GetInput()->ClickTrigger(); + Uint32 Flags = UIManager::instance()->GetInput()->clickTrigger(); if ( EDITING_LIGHT == mEditingMode ) { if ( NULL != mSelLight ) { @@ -134,7 +134,7 @@ void UIMap::Update() { } } - Flags = UIManager::instance()->GetInput()->PressTrigger(); + Flags = UIManager::instance()->GetInput()->pressTrigger(); if ( Flags & EE_BUTTON_MMASK ) { mSelLight->Position( mMap->GetMouseMapPosf() ); @@ -220,8 +220,8 @@ void UIMap::DragPoly( Uint32 Flags, Uint32 PFlags ) { } void UIMap::ManageObject( Uint32 Flags ) { - Uint32 PFlags = UIManager::instance()->GetInput()->PressTrigger(); - Uint32 LPFlags = UIManager::instance()->GetInput()->LastPressTrigger(); + Uint32 PFlags = UIManager::instance()->GetInput()->pressTrigger(); + Uint32 LPFlags = UIManager::instance()->GetInput()->lastPressTrigger(); switch ( mEditingObjMode ) { @@ -574,7 +574,7 @@ void UIMap::CreateObjPopUpMenu() { Menu->AddEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &UIMap::ObjItemClick ) ); if ( Menu->Show() ) { - Vector2i Pos = UIManager::instance()->GetInput()->GetMousePos(); + Vector2i Pos = UIManager::instance()->GetInput()->getMousePos(); UIMenu::FixMenuPos( Pos , Menu ); Menu->Pos( Pos ); } diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 186b974e7..82b3a90de 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -23,7 +23,7 @@ using namespace EE::Graphics; namespace EE { namespace Gaming { TileMap::TileMap() : - mWindow( Engine::instance()->GetCurrentWindow() ), + mWindow( Engine::instance()->getCurrentWindow() ), mLayers( NULL ), mFlags( 0 ), mMaxLayers( 0 ), @@ -90,7 +90,7 @@ void TileMap::Create( Sizei Size, Uint32 MaxLayers, Sizei TileSize, Uint32 Flags mWindow = Window; if ( NULL == mWindow ) - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); mFlags = Flags; mMaxLayers = MaxLayers; @@ -214,7 +214,7 @@ void TileMap::Draw() { GlobalBatchRenderer::instance()->Draw(); if ( ClipedArea() ) { - mWindow->ClipEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y ); + mWindow->clipEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y ); } if ( DrawBackground() ) { @@ -252,7 +252,7 @@ void TileMap::Draw() { GLi->LoadMatrixf( oldM ); if ( ClipedArea() ) { - mWindow->ClipDisable(); + mWindow->clipDisable(); } } @@ -316,7 +316,7 @@ const bool& TileMap::IsMouseOver() const { } void TileMap::GetMouseOverTile() { - Vector2i mouse = mWindow->GetInput()->GetMousePos(); + Vector2i mouse = mWindow->getInput()->getMousePos(); Vector2i MapPos( static_cast( mouse.x - mScreenPos.x - mOffset.x ) / mScale, static_cast( mouse.y - mScreenPos.y - mOffset.y ) / mScale ); diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index ec3df63af..2b56ecd8b 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -42,7 +42,7 @@ Console::Console( EE::Window::Window * window ) : mCurSide(false) { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } } @@ -76,7 +76,7 @@ Console::Console( Font* Font, const bool& MakeDefaultCommands, const bool& Attac mCurSide(false) { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } Create( Font, MakeDefaultCommands, AttachToLog, MaxLogLines, TextureId ); @@ -85,11 +85,11 @@ Console::Console( Font* Font, const bool& MakeDefaultCommands, const bool& Attac Console::~Console() { if ( mMyCallback && NULL != Engine::existsSingleton() && - Engine::instance()->ExistsWindow( mWindow ) + Engine::instance()->existsWindow( mWindow ) ) { - mWindow->GetInput()->PopCallback( mMyCallback ); - mWindow->PopResizeCallback( mVidCb ); + mWindow->getInput()->popCallback( mMyCallback ); + mWindow->popResizeCallback( mVidCb ); } eeSAFE_DELETE( mTBuf ); @@ -101,7 +101,7 @@ Console::~Console() { void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& AttachToLog, const unsigned int& MaxLogLines, const Uint32& TextureId ) { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } mFont = Font; @@ -122,21 +122,21 @@ void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& A if ( MakeDefaultCommands ) CreateDefaultCommands(); - mWidth = (Float) mWindow->GetWidth(); - mHeight = (Float) mWindow->GetHeight(); - mHeightMin = (Float) ( mWindow->GetHeight() / 2 ); + mWidth = (Float) mWindow->getWidth(); + mHeight = (Float) mWindow->getHeight(); + mHeightMin = (Float) ( mWindow->getHeight() / 2 ); if ( NULL != Engine::existsSingleton() && - Engine::instance()->ExistsWindow( mWindow ) ) + Engine::instance()->existsWindow( mWindow ) ) { - mMyCallback = mWindow->GetInput()->PushCallback( cb::Make1( this, &Console::PrivInputCallback ) ); - mVidCb = mWindow->PushResizeCallback( cb::Make1( this, &Console::PrivVideoResize ) ); + mMyCallback = mWindow->getInput()->pushCallback( cb::Make1( this, &Console::PrivInputCallback ) ); + mVidCb = mWindow->pushResizeCallback( cb::Make1( this, &Console::PrivVideoResize ) ); } - mTBuf->SetReturnCallback( cb::Make0( this, &Console::ProcessLine ) ); - mTBuf->Start(); - mTBuf->SupportNewLine( false ); - mTBuf->Active( false ); + mTBuf->setReturnCallback( cb::Make0( this, &Console::ProcessLine ) ); + mTBuf->start(); + mTBuf->supportNewLine( false ); + mTBuf->active( false ); IgnoreCharOnPrompt( KEY_TAB ); mCon.ConModif = 0; @@ -203,15 +203,15 @@ void Console::Draw() { CurY = mTempY + mY + mCurHeight - mFontSize - 1; mFont->Color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mA) ) ); - mFont->SetText( "> " + mTBuf->Buffer() ); + mFont->SetText( "> " + mTBuf->buffer() ); mFont->Draw( mFontSize, CurY ); mFont->Color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mCurAlpha) ) ); - if ( (unsigned int)mTBuf->CurPos() == mTBuf->Buffer().size() ) { + if ( (unsigned int)mTBuf->curPos() == mTBuf->buffer().size() ) { mFont->Draw( "_", mFontSize + mFont->GetTextWidth() , CurY ); } else { - mFont->SetText( "> " + mTBuf->Buffer().substr( 0, mTBuf->CurPos() ) ); + mFont->SetText( "> " + mTBuf->buffer().substr( 0, mTBuf->curPos() ) ); mFont->Draw( "_", mFontSize + mFont->GetTextWidth() , CurY ); } @@ -223,7 +223,7 @@ void Console::Draw() { ColorA OldColor1( mFont->Color() ); mFont->Color( ColorA () ); mFont->SetText( "FPS: " + String::toStr( mWindow->FPS() ) ); - mFont->Draw( mWindow->GetWidth() - mFont->GetTextWidth() - 15, 6 ); + mFont->Draw( mWindow->getWidth() - mFont->GetTextWidth() - 15, 6 ); mFont->Color( OldColor1 ); } } @@ -234,7 +234,7 @@ void Console::FadeIn() { mFadeIn = true; mVisible = true; mY = 0.0f; - mTBuf->Active( true ); + mTBuf->active( true ); } } @@ -243,7 +243,7 @@ void Console::FadeOut() { mFading = true; mFadeOut = true; mVisible = false; - mTBuf->Active( false ); + mTBuf->active( false ); } } @@ -280,7 +280,7 @@ static std::vector< String > SplitCommandParams( String str ) { } void Console::ProcessLine() { - String str = mTBuf->Buffer(); + String str = mTBuf->buffer(); std::vector < String > params = SplitCommandParams( str ); mLastCommands.push_back( str ); @@ -298,7 +298,7 @@ void Console::ProcessLine() { PrivPushText( "Unknown Command: '" + params[0] + "'" ); } } - mTBuf->Clear(); + mTBuf->clear(); } void Console::PrivPushText( const String& str ) { @@ -359,13 +359,13 @@ void Console::Toggle() { void Console::Fade() { if (mCurSide) { - mCurAlpha -= 255.f * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mCurAlpha -= 255.f * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha <= 0.0f ) { mCurAlpha = 0.0f; mCurSide = !mCurSide; } } else { - mCurAlpha += 255.f * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mCurAlpha += 255.f * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha >= 255.f ) { mCurAlpha = 255.f; mCurSide = !mCurSide; @@ -379,7 +379,7 @@ void Console::Fade() { if ( mFadeIn ) { mFadeOut = false; - mY += mCurHeight * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mY += mCurHeight * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); mA = ( mY * mMaxAlpha / mCurHeight ) ; if ( mY > mCurHeight ) { @@ -391,7 +391,7 @@ void Console::Fade() { if ( mFadeOut ) { mFadeIn = false; - mY -= mCurHeight * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mY -= mCurHeight * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); mA = ( mY * mMaxAlpha / mCurHeight ) ; if ( mY <= 0.0f ) { @@ -406,7 +406,7 @@ void Console::Fade() { } String Console::GetLastCommonSubStr( std::list& cmds ) { - String lastCommon( mTBuf->Buffer() ); + String lastCommon( mTBuf->buffer() ); String strTry( lastCommon ); std::list::iterator ite; @@ -453,7 +453,7 @@ void Console::PrintCommandsStartingWith( const String& start ) { } if ( cmds.size() > 1 ) { - PrivPushText( "> " + mTBuf->Buffer() ); + PrivPushText( "> " + mTBuf->buffer() ); std::list::iterator ite; @@ -462,19 +462,19 @@ void Console::PrintCommandsStartingWith( const String& start ) { String newStr( GetLastCommonSubStr( cmds ) ); - if ( newStr != mTBuf->Buffer() ) { - mTBuf->Buffer( newStr ); - mTBuf->CursorToEnd(); + if ( newStr != mTBuf->buffer() ) { + mTBuf->buffer( newStr ); + mTBuf->cursorToEnd(); } } else if ( cmds.size() ) { - mTBuf->Buffer( cmds.front() ); - mTBuf->CursorToEnd(); + mTBuf->buffer( cmds.front() ); + mTBuf->cursorToEnd(); } } void Console::PrivVideoResize( EE::Window::Window * win ) { - mWidth = (Float) mWindow->GetWidth(); - mHeight = (Float) mWindow->GetHeight(); + mWidth = (Float) mWindow->getWidth(); + mHeight = (Float) mWindow->getHeight(); if ( mVisible ) { if ( mExpand ) @@ -558,14 +558,14 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { slash = FileSystem::getOSlash(); } - mTBuf->Buffer( mTBuf->Buffer().substr( 0, pos + 1 ) + files[lasti] + slash ); - mTBuf->CursorToEnd(); + mTBuf->buffer( mTBuf->buffer().substr( 0, pos + 1 ) + files[lasti] + slash ); + mTBuf->cursorToEnd(); } else if ( count > 1 ) { PrivPushText( "Directory file list:" ); PushText( res ); - mTBuf->Buffer( mTBuf->Buffer().substr( 0, pos + 1 ) + file ); - mTBuf->CursorToEnd(); + mTBuf->buffer( mTBuf->buffer().substr( 0, pos + 1 ) + file ); + mTBuf->cursorToEnd(); } } } @@ -584,9 +584,9 @@ void Console::PrivInputCallback( InputEvent * Event ) { Uint32 Button = Event->button.button; if ( InputEvent::KeyDown == etype ) { - if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->CurPos() == mTBuf->Buffer().size() ) { - PrintCommandsStartingWith( mTBuf->Buffer() ); - GetFilesFrom( mTBuf->Buffer().toUtf8(), mTBuf->CurPos() ); + if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->curPos() == mTBuf->buffer().size() ) { + PrintCommandsStartingWith( mTBuf->buffer() ); + GetFilesFrom( mTBuf->buffer().toUtf8(), mTBuf->curPos() ); } if ( KeyMod & KEYMOD_SHIFT ) { @@ -634,10 +634,10 @@ void Console::PrivInputCallback( InputEvent * Event ) { if ( KeyCode == KEY_UP || KeyCode == KEY_DOWN ) { if ( mLastLogPos == static_cast( mLastCommands.size() ) ) { - mTBuf->Buffer( "" ); + mTBuf->buffer( "" ); } else { - mTBuf->Buffer( mLastCommands[mLastLogPos] ); - mTBuf->CursorToEnd(); + mTBuf->buffer( mLastCommands[mLastLogPos] ); + mTBuf->cursorToEnd(); } } } @@ -712,7 +712,7 @@ void Console::CmdMinimize ( const std::vector < String >& params ) { } void Console::CmdQuit ( const std::vector < String >& params ) { - mWindow->Close(); + mWindow->close(); } void Console::CmdGetTextureMemory ( const std::vector < String >& params ) { @@ -733,7 +733,7 @@ void Console::CmdShowCursor ( const std::vector < String >& params ) { bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt == 0 || tInt == 1 ) ) { - mWindow->GetCursorManager()->Visible( 0 != tInt ); + mWindow->getCursorManager()->visible( 0 != tInt ); } else PrivPushText( "Valid parameters are 0 or 1." ); } else { @@ -748,7 +748,7 @@ void Console::CmdFrameLimit ( const std::vector < String >& params ) { bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt >= 0 && tInt <= 10000 ) ) { - mWindow->FrameRateLimit( tInt ); + mWindow->frameRateLimit( tInt ); return; } } @@ -787,7 +787,7 @@ void Console::CmdSetGamma( const std::vector < String >& params ) { bool Res = String::fromString( tFloat, params[1] ); if ( Res && ( tFloat > 0.1f && tFloat <= 10.0f ) ) { - mWindow->SetGamma( tFloat, tFloat, tFloat ); + mWindow->setGamma( tFloat, tFloat, tFloat ); return; } } @@ -887,7 +887,7 @@ void Console::CmdHideConsole( const std::vector < String >& params ) { } void Console::IgnoreCharOnPrompt( const Uint32& ch ) { - mTBuf->PushIgnoredChar( ch ); + mTBuf->pushIgnoredChar( ch ); } const bool& Console::IsShowingFps() const { diff --git a/src/eepp/graphics/framebuffer.cpp b/src/eepp/graphics/framebuffer.cpp index 8a1328dfc..8c3cdcb56 100644 --- a/src/eepp/graphics/framebuffer.cpp +++ b/src/eepp/graphics/framebuffer.cpp @@ -26,7 +26,7 @@ FrameBuffer::FrameBuffer( EE::Window::Window * window ) : mClearColor(0,0,0,0) { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } FrameBufferManager::instance()->add( this ); @@ -55,11 +55,11 @@ ColorAf FrameBuffer::ClearColor() const { void FrameBuffer::Clear() { GLi->ClearColor( mClearColor.r(), mClearColor.g(), mClearColor.b(), mClearColor.a() ); GLi->Clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - mWindow->BackColor( mWindow->BackColor() ); + mWindow->backColor( mWindow->backColor() ); } void FrameBuffer::SetBufferView() { - mPrevView = mWindow->GetView(); + mPrevView = mWindow->getView(); // Get the user projection matrix GLi->GetCurrentMatrix( GL_PROJECTION_MATRIX, mProjMat ); @@ -75,7 +75,7 @@ void FrameBuffer::SetBufferView() { void FrameBuffer::RecoverView() { GlobalBatchRenderer::instance()->Draw(); - mWindow->SetView( mPrevView ); + mWindow->setView( mPrevView ); // Recover the user projection matrix GLi->LoadIdentity(); diff --git a/src/eepp/graphics/framebufferfbo.cpp b/src/eepp/graphics/framebufferfbo.cpp index 0e02c6c9f..24b251d0b 100644 --- a/src/eepp/graphics/framebufferfbo.cpp +++ b/src/eepp/graphics/framebufferfbo.cpp @@ -59,7 +59,7 @@ bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool Dep return false; if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } mWidth = Width; diff --git a/src/eepp/graphics/particlesystem.cpp b/src/eepp/graphics/particlesystem.cpp index e1bb4bc8e..f36ff0e2f 100755 --- a/src/eepp/graphics/particlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -363,7 +363,7 @@ void ParticleSystem::Draw() { } void ParticleSystem::Update() { - Update( Engine::instance()->Elapsed() ); + Update( Engine::instance()->elapsed() ); } void ParticleSystem::Update( const System::Time& time ) { diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 090e6ab66..519421ecb 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -481,7 +481,7 @@ bool Sprite::AddSubFrame(const Uint32& TexId, const unsigned int& NumFrame, cons } void Sprite::Update() { - Update( Engine::instance()->Elapsed() ); + Update( Engine::instance()->elapsed() ); } void Sprite::Update( const Time& ElapsedTime ) { diff --git a/src/eepp/graphics/textureloader.cpp b/src/eepp/graphics/textureloader.cpp index 1ea7c279f..e0f7da18b 100644 --- a/src/eepp/graphics/textureloader.cpp +++ b/src/eepp/graphics/textureloader.cpp @@ -242,7 +242,7 @@ void TextureLoader::start() { mTexLoaded = true; - if ( !mThreaded || ( Engine::instance()->IsSharedGLContextEnabled() && Engine::instance()->GetCurrentWindow()->IsThreadedGLContext() ) ) { + if ( !mThreaded || ( Engine::instance()->isSharedGLContextEnabled() && Engine::instance()->getCurrentWindow()->isThreadedGLContext() ) ) { LoadFromPixels(); } } @@ -424,13 +424,13 @@ void TextureLoader::LoadFromPixels() { flags = ( mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; flags = ( mCompressTexture ) ? ( flags | SOIL_FLAG_COMPRESS_TO_DXT ) : flags; - bool ForceGLThreaded = Thread::getCurrentThreadId() != Engine::instance()->GetMainThreadId(); + bool ForceGLThreaded = Thread::getCurrentThreadId() != Engine::instance()->getMainThreadId(); if ( ( mThreaded || ForceGLThreaded ) && - ( ForceGLThreaded || Engine::instance()->IsSharedGLContextEnabled() ) && - Engine::instance()->GetCurrentWindow()->IsThreadedGLContext() ) + ( ForceGLThreaded || Engine::instance()->isSharedGLContextEnabled() ) && + Engine::instance()->getCurrentWindow()->isThreadedGLContext() ) { - Engine::instance()->GetCurrentWindow()->SetGLContextThread(); + Engine::instance()->getCurrentWindow()->setGLContextThread(); } int PreviousTexture; @@ -463,10 +463,10 @@ void TextureLoader::LoadFromPixels() { GLi->BindTexture( GL_TEXTURE_2D, PreviousTexture ); if ( ( mThreaded || ForceGLThreaded ) && - ( ForceGLThreaded || Engine::instance()->IsSharedGLContextEnabled() ) && - Engine::instance()->GetCurrentWindow()->IsThreadedGLContext() ) + ( ForceGLThreaded || Engine::instance()->isSharedGLContextEnabled() ) && + Engine::instance()->getCurrentWindow()->isThreadedGLContext() ) { - Engine::instance()->GetCurrentWindow()->UnsetGLContextThread(); + Engine::instance()->getCurrentWindow()->unsetGLContextThread(); } if ( tTexId ) { @@ -527,7 +527,7 @@ void TextureLoader::LoadFromPixels() { } void TextureLoader::update() { - if ( !( Engine::instance()->IsSharedGLContextEnabled() && Engine::instance()->GetCurrentWindow()->IsThreadedGLContext() ) ) { + if ( !( Engine::instance()->isSharedGLContextEnabled() && Engine::instance()->getCurrentWindow()->isThreadedGLContext() ) ) { LoadFromPixels(); } } diff --git a/src/eepp/physics/space.cpp b/src/eepp/physics/space.cpp index 7fea15127..92d7492b3 100644 --- a/src/eepp/physics/space.cpp +++ b/src/eepp/physics/space.cpp @@ -64,7 +64,7 @@ void Space::Step( const cpFloat& dt ) { void Space::Update() { #ifdef PHYSICS_RENDERER_ENABLED - Step( Window::Engine::instance()->Elapsed().asSeconds() ); + Step( Window::Engine::instance()->elapsed().asSeconds() ); #else Step( 1 / 60 ); #endif diff --git a/src/eepp/system/sys.cpp b/src/eepp/system/sys.cpp index 99b409385..47e5d1e8a 100644 --- a/src/eepp/system/sys.cpp +++ b/src/eepp/system/sys.cpp @@ -515,8 +515,8 @@ static std::string sGetProcessPath() { return FileSystem::FileRemoveFileName( std::string( info.name ) ); #elif EE_PLATFORM == EE_PLATFORM_ANDROID - if ( NULL != Window::Engine::instance() && NULL != Window::Engine::instance()->GetCurrentWindow() ) - return Window::Engine::instance()->GetCurrentWindow()->GetExternalStoragePath(); + if ( NULL != Window::Engine::instance() && NULL != Window::Engine::instance()->getCurrentWindow() ) + return Window::Engine::instance()->getCurrentWindow()->getExternalStoragePath(); return "/sdcard/"; #else @@ -627,7 +627,7 @@ std::string Sys::getConfigPath( std::string appname ) { return GetProcessPath() + "config"; #elif EE_PLATFORM == EE_PLATFORM_ANDROID if ( NULL != Window::Engine::instance() ) - return Window::Engine::instance()->GetCurrentWindow()->GetInternalStoragePath(); + return Window::Engine::instance()->getCurrentWindow()->getInternalStoragePath(); return std::string(); #else @@ -656,7 +656,7 @@ std::string Sys::getTempPath() { } #elif EE_PLATFORM == EE_PLATFORM_ANDROID if ( NULL != Window::Engine::instance() ) { - String::StrCopy( path, Window::Engine::instance()->GetCurrentWindow()->GetInternalStoragePath().c_str(), EE_MAX_CFG_PATH_LEN ); + String::StrCopy( path, Window::Engine::instance()->getCurrentWindow()->getInternalStoragePath().c_str(), EE_MAX_CFG_PATH_LEN ); } else { String::StrCopy( path, "/tmp", EE_MAX_CFG_PATH_LEN ); } diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index be62d6149..eab96a59e 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -262,7 +262,7 @@ void TextureAtlasEditor::FileMenuClick( const UIEvent * Event ) { } } else if ( "Quit" == txt ) { if ( mUIWindow == UIManager::instance()->MainControl() ) { - UIManager::instance()->GetWindow()->Close(); + UIManager::instance()->GetWindow()->close(); } else { mUIWindow->CloseWindow(); } diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index ebab07c53..20ed77f7b 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -48,8 +48,8 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mComboWidth->ListBox()->AddListBoxItems( Sizes ); mComboHeight->ListBox()->AddListBoxItems( Sizes ); - mComboWidth->GetInputTextBuffer()->AllowOnlyNumbers( true ); - mComboHeight->GetInputTextBuffer()->AllowOnlyNumbers( true ); + mComboWidth->GetInputTextBuffer()->allowOnlyNumbers( true ); + mComboHeight->GetInputTextBuffer()->allowOnlyNumbers( true ); mComboWidth->ListBox()->SetSelected( "512" ); mComboHeight->ListBox()->SetSelected( "512" ); diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 624e0bb40..7a5698912 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -200,7 +200,7 @@ void UIDropDownList::Hide() { void UIDropDownList::Update() { if ( mEnabled && mVisible ) { if ( IsMouseOver() ) { - Uint32 Flags = UIManager::instance()->GetInput()->ClickTrigger(); + Uint32 Flags = UIManager::instance()->GetInput()->clickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) { if ( Flags & EE_BUTTON_WUMASK ) { diff --git a/src/eepp/ui/uigridcell.cpp b/src/eepp/ui/uigridcell.cpp index 2f0be826a..3dfe76b72 100644 --- a/src/eepp/ui/uigridcell.cpp +++ b/src/eepp/ui/uigridcell.cpp @@ -65,7 +65,7 @@ void UIGridCell::FixCell() { void UIGridCell::Update() { if ( mEnabled && mVisible ) { UIGenericGrid * MyParent = reinterpret_cast ( Parent()->Parent() ); - Uint32 Flags = UIManager::instance()->GetInput()->ClickTrigger(); + Uint32 Flags = UIManager::instance()->GetInput()->clickTrigger(); if ( NULL != MyParent && MyParent->Alpha() != mAlpha ) { Alpha( MyParent->Alpha() ); diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index 528a85791..e281e2e39 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -576,7 +576,7 @@ void UIListBox::ItemClicked( UIListBoxItem * Item ) { UIEvent ItemEvent( Item, UIEvent::EventOnItemClicked ); SendEvent( &ItemEvent ); - if ( !( IsMultiSelect() && UIManager::instance()->GetInput()->IsKeyDown( KEY_LCTRL ) ) ) + if ( !( IsMultiSelect() && UIManager::instance()->GetInput()->isKeyDown( KEY_LCTRL ) ) ) ResetItemsStates(); } diff --git a/src/eepp/ui/uilistboxitem.cpp b/src/eepp/ui/uilistboxitem.cpp index ca30cd816..e38ba0427 100644 --- a/src/eepp/ui/uilistboxitem.cpp +++ b/src/eepp/ui/uilistboxitem.cpp @@ -78,7 +78,7 @@ void UIListBoxItem::Update() { if ( mEnabled && mVisible ) { UIListBox * LBParent = reinterpret_cast ( Parent()->Parent() ); - Uint32 Flags = UIManager::instance()->GetInput()->ClickTrigger(); + Uint32 Flags = UIManager::instance()->GetInput()->clickTrigger(); if ( IsMouseOver() ) { if ( Flags & EE_BUTTONS_WUWD && LBParent->VerticalScrollBar()->Visible() ) { diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 0819dbb76..441d09234 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -41,17 +41,17 @@ void UIManager::Init( Uint32 Flags, EE::Window::Window * window ) { mFlags = Flags; if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } - mKM = mWindow->GetInput(); + mKM = mWindow->getInput(); mInit = true; UIWindow::CreateParams Params; Params.Parent( NULL ); Params.PosSet( 0, 0 ); - Params.SizeSet( Engine::instance()->GetWidth(), Engine::instance()->GetHeight() ); + Params.SizeSet( Engine::instance()->getWidth(), Engine::instance()->getHeight() ); Params.Flags = UI_CONTROL_DEFAULT_FLAGS | UI_REPORT_SIZE_CHANGE_TO_CHILDS; Params.WinFlags = UI_WIN_NO_BORDER | UI_WIN_RESIZEABLE; Params.MinWindowSize = Sizei( 0, 0 ); @@ -67,19 +67,19 @@ void UIManager::Init( Uint32 Flags, EE::Window::Window * window ) { mFocusControl = mControl; mOverControl = mControl; - mCbId = mKM->PushCallback( cb::Make1( this, &UIManager::InputCallback ) ); - mResizeCb = mWindow->PushResizeCallback( cb::Make1( this, &UIManager::ResizeControl ) ); + mCbId = mKM->pushCallback( cb::Make1( this, &UIManager::InputCallback ) ); + mResizeCb = mWindow->pushResizeCallback( cb::Make1( this, &UIManager::ResizeControl ) ); } void UIManager::Shutdown() { if ( mInit ) { if ( -1 != mCbId && NULL != Engine::existsSingleton() && - Engine::instance()->ExistsWindow( mWindow ) + Engine::instance()->existsWindow( mWindow ) ) { - mKM->PopCallback( mCbId ); - mWindow->PopResizeCallback( mResizeCb ); + mKM->popCallback( mCbId ); + mWindow->popResizeCallback( mResizeCb ); } mShootingDown = true; @@ -111,7 +111,7 @@ void UIManager::InputCallback( InputEvent * Event ) { } void UIManager::ResizeControl( EE::Window::Window * win ) { - mControl->Size( mWindow->GetWidth(), mWindow->GetHeight() ); + mControl->Size( mWindow->getWidth(), mWindow->getHeight() ); SendMsg( mControl, UIMessage::MsgWindowResize ); std::list::iterator it; @@ -182,64 +182,64 @@ void UIManager::SendMsg( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flag } void UIManager::Update() { - mElapsed = mWindow->Elapsed(); + mElapsed = mWindow->elapsed(); bool wasDraggingControl = IsControlDragging(); mControl->Update(); - UIControl * pOver = mControl->OverFind( mKM->GetMousePosf() ); + UIControl * pOver = mControl->OverFind( mKM->getMousePosf() ); if ( pOver != mOverControl ) { if ( NULL != mOverControl ) { SendMsg( mOverControl, UIMessage::MsgMouseExit ); - mOverControl->OnMouseExit( mKM->GetMousePos(), 0 ); + mOverControl->OnMouseExit( mKM->getMousePos(), 0 ); } mOverControl = pOver; if ( NULL != mOverControl ) { SendMsg( mOverControl, UIMessage::MsgMouseEnter ); - mOverControl->OnMouseEnter( mKM->GetMousePos(), 0 ); + mOverControl->OnMouseEnter( mKM->getMousePos(), 0 ); } } else { if ( NULL != mOverControl ) - mOverControl->OnMouseMove( mKM->GetMousePos(), mKM->PressTrigger() ); + mOverControl->OnMouseMove( mKM->getMousePos(), mKM->pressTrigger() ); } - if ( mKM->PressTrigger() ) { + if ( mKM->pressTrigger() ) { /*if ( !wasDraggingControl && mOverControl != mFocusControl ) FocusControl( mOverControl );*/ if ( NULL != mOverControl ) { - mOverControl->OnMouseDown( mKM->GetMousePos(), mKM->PressTrigger() ); - SendMsg( mOverControl, UIMessage::MsgMouseDown, mKM->PressTrigger() ); + mOverControl->OnMouseDown( mKM->getMousePos(), mKM->pressTrigger() ); + SendMsg( mOverControl, UIMessage::MsgMouseDown, mKM->pressTrigger() ); } if ( !mFirstPress ) { mDownControl = mOverControl; - mMouseDownPos = mKM->GetMousePos(); + mMouseDownPos = mKM->getMousePos(); mFirstPress = true; } } - if ( mKM->ReleaseTrigger() ) { + if ( mKM->releaseTrigger() ) { if ( NULL != mFocusControl ) { if ( !wasDraggingControl ) { if ( mOverControl != mFocusControl ) FocusControl( mOverControl ); - mFocusControl->OnMouseUp( mKM->GetMousePos(), mKM->ReleaseTrigger() ); - SendMsg( mFocusControl, UIMessage::MsgMouseUp, mKM->ReleaseTrigger() ); + mFocusControl->OnMouseUp( mKM->getMousePos(), mKM->releaseTrigger() ); + SendMsg( mFocusControl, UIMessage::MsgMouseUp, mKM->releaseTrigger() ); - if ( mKM->ClickTrigger() ) { // mDownControl == mOverControl && - SendMsg( mFocusControl, UIMessage::MsgClick, mKM->ClickTrigger() ); - mFocusControl->OnMouseClick( mKM->GetMousePos(), mKM->ClickTrigger() ); + if ( mKM->clickTrigger() ) { // mDownControl == mOverControl && + SendMsg( mFocusControl, UIMessage::MsgClick, mKM->clickTrigger() ); + mFocusControl->OnMouseClick( mKM->getMousePos(), mKM->clickTrigger() ); - if ( mKM->DoubleClickTrigger() ) { - SendMsg( mFocusControl, UIMessage::MsgDoubleClick, mKM->DoubleClickTrigger() ); - mFocusControl->OnMouseDoubleClick( mKM->GetMousePos(), mKM->DoubleClickTrigger() ); + if ( mKM->doubleClickTrigger() ) { + SendMsg( mFocusControl, UIMessage::MsgDoubleClick, mKM->doubleClickTrigger() ); + mFocusControl->OnMouseDoubleClick( mKM->getMousePos(), mKM->doubleClickTrigger() ); } } } @@ -270,7 +270,7 @@ const Time& UIManager::Elapsed() const { } Vector2i UIManager::GetMousePos() { - return mKM->GetMousePos(); + return mKM->getMousePos(); } Input * UIManager::GetInput() const { @@ -278,19 +278,19 @@ Input * UIManager::GetInput() const { } const Uint32& UIManager::PressTrigger() const { - return mKM->PressTrigger(); + return mKM->pressTrigger(); } const Uint32& UIManager::LastPressTrigger() const { - return mKM->LastPressTrigger(); + return mKM->lastPressTrigger(); } void UIManager::ClipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ) { - mWindow->ClipPlaneEnable( x, y, Width, Height ); + mWindow->clipPlaneEnable( x, y, Width, Height ); } void UIManager::ClipDisable() { - mWindow->ClipPlaneDisable(); + mWindow->clipPlaneDisable(); } void UIManager::HighlightFocus( bool Highlight ) { @@ -460,7 +460,7 @@ const bool& UIManager::UseGlobalCursors() { void UIManager::SetCursor( EE_CURSOR_TYPE cursor ) { if ( mUseGlobalCursors ) { - mWindow->GetCursorManager()->Set( cursor ); + mWindow->getCursorManager()->set( cursor ); } } diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 698dd5b55..02f24f3ae 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -150,7 +150,7 @@ void UIScrollBar::Update() { UIControlAnim::Update(); if ( mBtnUp->IsMouseOver() || mBtnDown->IsMouseOver() ) { - ManageClick( UIManager::instance()->GetInput()->ClickTrigger() ); + ManageClick( UIManager::instance()->GetInput()->clickTrigger() ); } } diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index 61a2f8d2f..eb2c62c41 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -265,7 +265,7 @@ void UISlider::Update() { UIControlAnim::Update(); if ( IsMouseOver() || mBackSlider->IsMouseOver() || mSlider->IsMouseOver() ) { - ManageClick( UIManager::instance()->GetInput()->ClickTrigger() ); + ManageClick( UIManager::instance()->GetInput()->clickTrigger() ); } } diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 85c659b4e..7c9f795b6 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -41,7 +41,7 @@ UISpinBox::UISpinBox( const UISpinBox::CreateParams& Params ) : mPushDown->Visible ( true ); mPushDown->Enabled ( true ); - mInput->GetInputTextBuffer()->AllowOnlyNumbers( true, Params.AllowDotsInNumbers ); + mInput->GetInputTextBuffer()->allowOnlyNumbers( true, Params.AllowDotsInNumbers ); InternalValue( mValue, true ); @@ -201,7 +201,7 @@ const Float& UISpinBox::MaxValue() const { } void UISpinBox::Update() { - bool Changed = mInput->GetInputTextBuffer()->ChangedSinceLastUpdate(); + bool Changed = mInput->GetInputTextBuffer()->changedSinceLastUpdate(); UIControlAnim::Update(); diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index 127489119..5c7886435 100644 --- a/src/eepp/ui/uitab.cpp +++ b/src/eepp/ui/uitab.cpp @@ -131,7 +131,7 @@ void UITab::Update() { UITabWidget * tTabW = GetTabWidget(); if ( NULL != tTabW ) { - Uint32 Flags = UIManager::instance()->GetInput()->ClickTrigger(); + Uint32 Flags = UIManager::instance()->GetInput()->clickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) { if ( Flags & EE_BUTTON_WUMASK ) { diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index dbb30b548..5470b254d 100644 --- a/src/eepp/ui/uitextedit.cpp +++ b/src/eepp/ui/uitextedit.cpp @@ -41,7 +41,7 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) : mFlags |= UI_AUTO_SHRINK_TEXT; mTextInput = eeNew( UITextInput, ( TIParams ) ); - mTextInput->GetInputTextBuffer()->SupportNewLine( true ); + mTextInput->GetInputTextBuffer()->supportNewLine( true ); mTextInput->Visible( true ); mTextInput->Enabled( true ); mTextInput->AddEventListener( UIEvent::EventOnSizeChange , cb::Make1( this, &UITextEdit::OnInputSizeChange ) ); @@ -339,11 +339,11 @@ void UITextEdit::FixScrollToCursor() { if ( FontHAlignGet( mTextInput->Flags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; - Uint32 LineNum = mTextInput->GetInputTextBuffer()->GetCurPosLinePos( NLPos ); + Uint32 LineNum = mTextInput->GetInputTextBuffer()->getCurPosLinePos( NLPos ); mTextInput->GetTextCache()->Font()->SetText( - mTextInput->GetInputTextBuffer()->Buffer().substr( - NLPos, mTextInput->GetInputTextBuffer()->CurPos() - NLPos + mTextInput->GetInputTextBuffer()->buffer().substr( + NLPos, mTextInput->GetInputTextBuffer()->curPos() - NLPos ) ); @@ -381,7 +381,7 @@ void UITextEdit::Update() { UIControlAnim::Update(); if ( mTextInput->Enabled() && mTextInput->Visible() && mTextInput->IsMouseOver() && mVScrollBar->Visible() ) { - Uint32 Flags = UIManager::instance()->GetInput()->ClickTrigger(); + Uint32 Flags = UIManager::instance()->GetInput()->clickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) mVScrollBar->Slider()->ManageClick( Flags ); diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index e0b267bdb..e2ea4be84 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -14,12 +14,12 @@ UITextInput::UITextInput( const UITextInput::CreateParams& Params ) : mAllowEditing( true ), mShowingWait( true ) { - mTextBuffer.Start(); - mTextBuffer.Active( false ); - mTextBuffer.SupportFreeEditing( Params.SupportFreeEditing ); - mTextBuffer.TextSelectionEnabled( IsTextSelectionEnabled() ); - mTextBuffer.MaxLength( Params.MaxLength ); - mTextBuffer.SetReturnCallback( cb::Make0( this, &UITextInput::PrivOnPressEnter ) ); + mTextBuffer.start(); + mTextBuffer.active( false ); + mTextBuffer.supportFreeEditing( Params.SupportFreeEditing ); + mTextBuffer.textSelectionEnabled( IsTextSelectionEnabled() ); + mTextBuffer.maxLength( Params.MaxLength ); + mTextBuffer.setReturnCallback( cb::Make0( this, &UITextInput::PrivOnPressEnter ) ); ApplyDefaultTheme(); } @@ -42,10 +42,10 @@ void UITextInput::Update() { UITextBox::Update(); - if ( mTextBuffer.ChangedSinceLastUpdate() ) { + if ( mTextBuffer.changedSinceLastUpdate() ) { Vector2f offSet = mAlignOffset; - UITextBox::Text( mTextBuffer.Buffer() ); + UITextBox::Text( mTextBuffer.buffer() ); UpdateText(); @@ -55,16 +55,16 @@ void UITextInput::Update() { AlignFix(); - mCursorPos = mTextBuffer.CurPos(); + mCursorPos = mTextBuffer.curPos(); - mTextBuffer.ChangedSinceLastUpdate( false ); + mTextBuffer.changedSinceLastUpdate( false ); return; } - if ( mCursorPos != mTextBuffer.CurPos() ) { + if ( mCursorPos != mTextBuffer.curPos() ) { AlignFix(); - mCursorPos = mTextBuffer.CurPos(); + mCursorPos = mTextBuffer.curPos(); OnCursorPosChange(); } } @@ -74,7 +74,7 @@ void UITextInput::OnCursorPosChange() { } void UITextInput::DrawWaitingCursor() { - if ( mVisible && mTextBuffer.Active() && mTextBuffer.SupportFreeEditing() ) { + if ( mVisible && mTextBuffer.active() && mTextBuffer.supportFreeEditing() ) { mWaitCursorTime += UIManager::instance()->Elapsed().asMilliseconds(); if ( mShowingWait ) { @@ -115,7 +115,7 @@ Uint32 UITextInput::OnFocus() { UIControlAnim::OnFocus(); if ( mAllowEditing ) { - mTextBuffer.Active( true ); + mTextBuffer.active( true ); ResetWaitCursor(); } @@ -124,7 +124,7 @@ Uint32 UITextInput::OnFocus() { } Uint32 UITextInput::OnFocusLoss() { - mTextBuffer.Active( false ); + mTextBuffer.active( false ); return UITextBox::OnFocusLoss(); } @@ -138,7 +138,7 @@ void UITextInput::PrivOnPressEnter() { } void UITextInput::PushIgnoredChar( const Uint32& ch ) { - mTextBuffer.PushIgnoredChar( ch ); + mTextBuffer.pushIgnoredChar( ch ); } void UITextInput::ResetWaitCursor() { @@ -149,9 +149,9 @@ void UITextInput::ResetWaitCursor() { void UITextInput::AlignFix() { if ( FontHAlignGet( Flags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; - Uint32 LineNum = mTextBuffer.GetCurPosLinePos( NLPos ); + Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); - mTextCache->Font()->SetText( mTextBuffer.Buffer().substr( NLPos, mTextBuffer.CurPos() - NLPos ) ); + mTextCache->Font()->SetText( mTextBuffer.buffer().substr( NLPos, mTextBuffer.curPos() - NLPos ) ); Float tW = mTextCache->Font()->GetTextWidth(); Float tX = mAlignOffset.x + tW; @@ -159,7 +159,7 @@ void UITextInput::AlignFix() { mCurPos.x = tW; mCurPos.y = (Float)LineNum * (Float)mTextCache->Font()->GetFontHeight(); - if ( !mTextBuffer.SupportNewLine() ) { + if ( !mTextBuffer.supportNewLine() ) { if ( tX < 0.f ) mAlignOffset.x = -( mAlignOffset.x + ( tW - mAlignOffset.x ) ); else if ( tX > mSize.width() - mPadding.Left - mPadding.Right ) @@ -194,8 +194,8 @@ InputTextBuffer * UITextInput::GetInputTextBuffer() { void UITextInput::AllowEditing( const bool& allow ) { mAllowEditing = allow; - if ( !mAllowEditing && mTextBuffer.Active() ) - mTextBuffer.Active( false ); + if ( !mAllowEditing && mTextBuffer.active() ) + mTextBuffer.active( false ); } const bool& UITextInput::AllowEditing() const { @@ -205,9 +205,9 @@ const bool& UITextInput::AllowEditing() const { void UITextInput::Text( const String& text ) { UITextBox::Text( text ); - mTextBuffer.Buffer( text ); + mTextBuffer.buffer( text ); - mTextBuffer.CursorToEnd(); + mTextBuffer.cursorToEnd(); } const String& UITextInput::Text() { @@ -215,11 +215,11 @@ const String& UITextInput::Text() { } void UITextInput::ShrinkText( const Uint32& MaxWidth ) { - mTextCache->Text( mTextBuffer.Buffer() ); + mTextCache->Text( mTextBuffer.buffer() ); UITextBox::ShrinkText( MaxWidth ); - mTextBuffer.Buffer( mTextCache->Text() ); + mTextBuffer.buffer( mTextCache->Text() ); AlignFix(); } @@ -235,7 +235,7 @@ Uint32 UITextInput::OnMouseClick( const Vector2i& Pos, const Uint32 Flags ) { Int32 curPos = mTextCache->Font()->FindClosestCursorPosFromPoint( mTextCache->Text(), controlPos ); if ( -1 != curPos ) { - mTextBuffer.CurPos( curPos ); + mTextBuffer.curPos( curPos ); ResetWaitCursor(); } } @@ -247,7 +247,7 @@ Uint32 UITextInput::OnMouseDoubleClick( const Vector2i& Pos, const Uint32 Flags UITextBox::OnMouseDoubleClick( Pos, Flags ); if ( IsTextSelectionEnabled() && ( Flags & EE_BUTTON_LMASK ) && SelCurEnd() != -1 ) { - mTextBuffer.CurPos( SelCurEnd() ); + mTextBuffer.curPos( SelCurEnd() ); ResetWaitCursor(); } @@ -263,23 +263,23 @@ Uint32 UITextInput::OnMouseExit( const Vector2i& Pos, const Uint32 Flags ) { } void UITextInput::SelCurInit( const Int32& init ) { - mTextBuffer.SelCurInit( init ); + mTextBuffer.selCurInit( init ); } void UITextInput::SelCurEnd( const Int32& end ) { - mTextBuffer.SelCurEnd( end ); + mTextBuffer.selCurEnd( end ); - if ( mTextBuffer.SelCurEnd() != mTextBuffer.SelCurInit() ) { - mTextBuffer.CurPos( end ); + if ( mTextBuffer.selCurEnd() != mTextBuffer.selCurInit() ) { + mTextBuffer.curPos( end ); } } Int32 UITextInput::SelCurInit() { - return mTextBuffer.SelCurInit(); + return mTextBuffer.selCurInit(); } Int32 UITextInput::SelCurEnd() { - return mTextBuffer.SelCurEnd(); + return mTextBuffer.selCurEnd(); } }} diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index 2516b2f5c..8fe484315 100644 --- a/src/eepp/ui/uitextinputpassword.cpp +++ b/src/eepp/ui/uitextinputpassword.cpp @@ -53,9 +53,9 @@ void UITextInputPassword::Draw() { void UITextInputPassword::AlignFix() { if ( FontHAlignGet( Flags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; - Uint32 LineNum = mTextBuffer.GetCurPosLinePos( NLPos ); + Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); - String curStr( mTextBuffer.Buffer().substr( NLPos, mTextBuffer.CurPos() - NLPos ) ); + String curStr( mTextBuffer.buffer().substr( NLPos, mTextBuffer.curPos() - NLPos ) ); String pasStr; for ( size_t i = 0; i < curStr.size(); i++ ) @@ -69,7 +69,7 @@ void UITextInputPassword::AlignFix() { mCurPos.x = tW; mCurPos.y = (Float)LineNum * (Float)mPassCache->Font()->GetFontHeight(); - if ( !mTextBuffer.SupportNewLine() ) { + if ( !mTextBuffer.supportNewLine() ) { if ( tX < 0.f ) mAlignOffset.x = -( mAlignOffset.x + ( tW - mAlignOffset.x ) ); else if ( tX > mSize.width() - mPadding.Left - mPadding.Right ) diff --git a/src/eepp/window/backend/SDL/clipboardsdl.cpp b/src/eepp/window/backend/SDL/clipboardsdl.cpp index c6bb663f3..df17da7f7 100644 --- a/src/eepp/window/backend/SDL/clipboardsdl.cpp +++ b/src/eepp/window/backend/SDL/clipboardsdl.cpp @@ -1,14 +1,10 @@ -#include +#include #ifdef EE_BACKEND_SDL_1_2 -#include -#include - -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include +#if defined( EE_X11_PLATFORM ) + #include + #include #endif #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) @@ -19,6 +15,16 @@ #endif #endif +#include +#include +#include + +#if !defined( EE_COMPILER_MSVC ) +#include +#else +#include +#endif + #if EE_PLATFORM == EE_PLATFORM_WIN #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN @@ -27,9 +33,6 @@ #define NOMINMAX #endif #include -#elif defined( EE_X11_PLATFORM ) - #include - #include #endif namespace EE { namespace Window { namespace Backend { namespace SDL { @@ -105,13 +108,13 @@ ClipboardSDL::ClipboardSDL( EE::Window::Window * window ) : ClipboardSDL::~ClipboardSDL() { } -void ClipboardSDL::Init() { +void ClipboardSDL::init() { #if defined( EE_X11_PLATFORM ) /// Enable the special window hook events SDL_EventState( SDL_SYSWMEVENT, SDL_ENABLE ); SDL_SetEventFilter( clipboard_filter ); - CurrentHandler = (void*)mWindow->GetWindowHandler(); + CurrentHandler = (void*)mWindow->getWindowHandler(); #endif #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) @@ -127,7 +130,7 @@ void ClipboardSDL::Init() { #endif #endif -void ClipboardSDL::SetText( const std::string& Text ) { +void ClipboardSDL::setText( const std::string& Text ) { #if defined( EE_X11_PLATFORM ) eeWindowHandle display = mInfo->info.x11.display; X11Window window = mInfo->info.x11.wmwindow; @@ -206,7 +209,7 @@ eeScrapType ClipboardSDL::clipboard_convert_format( int type ) { #endif default: { char format[ sizeof(FORMAT_PREFIX)+8+1 ]; - String::StrFormat(format, sizeof(FORMAT_PREFIX)+8+1, "%s%08lx", FORMAT_PREFIX, (unsigned long)type); + String::strFormat(format, sizeof(FORMAT_PREFIX)+8+1, "%s%08lx", FORMAT_PREFIX, (unsigned long)type); #if defined( EE_X11_PLATFORM ) return XInternAtom( mInfo->info.x11.display, format, False ); @@ -300,7 +303,7 @@ void ClipboardSDL::clipboard_get_scrap( int type, int *dstlen, char **dst ) { #endif } -std::string ClipboardSDL::GetText() { +std::string ClipboardSDL::getText() { std::string tStr; #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN @@ -329,7 +332,7 @@ std::string ClipboardSDL::GetText() { return tStr; } -String ClipboardSDL::GetWideText() { +String ClipboardSDL::getWideText() { String tStr; #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN diff --git a/src/eepp/window/backend/SDL/clipboardsdl.hpp b/src/eepp/window/backend/SDL/clipboardsdl.hpp index 927fb9ee1..2e3252edf 100644 --- a/src/eepp/window/backend/SDL/clipboardsdl.hpp +++ b/src/eepp/window/backend/SDL/clipboardsdl.hpp @@ -26,17 +26,17 @@ class EE_API ClipboardSDL : public Clipboard { public: virtual ~ClipboardSDL(); - std::string GetText(); + std::string getText(); - String GetWideText(); + String getWideText(); - void SetText( const std::string& Text ); + void setText( const std::string& Text ); protected: friend class WindowSDL; ClipboardSDL( EE::Window::Window * window ); - void Init(); + void init(); #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) SDL_SysWMinfo * mInfo; diff --git a/src/eepp/window/backend/SDL/cursormanagersdl.cpp b/src/eepp/window/backend/SDL/cursormanagersdl.cpp index b38ed555d..bfd929f7e 100644 --- a/src/eepp/window/backend/SDL/cursormanagersdl.cpp +++ b/src/eepp/window/backend/SDL/cursormanagersdl.cpp @@ -18,73 +18,73 @@ CursorManagerSDL::CursorManagerSDL( EE::Window::Window * window ) : { } -Cursor * CursorManagerSDL::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->GetPlatform()->CreateMouseCursor( tex, hotspot, name ); + return mWindow->getPlatform()->createMouseCursor( tex, hotspot, name ); #else return eeNew( CursorSDL, ( tex, hotspot, name, mWindow ) ); #endif } -Cursor * CursorManagerSDL::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::create( Image * img, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->GetPlatform()->CreateMouseCursor( img, hotspot, name ); + return mWindow->getPlatform()->createMouseCursor( img, hotspot, name ); #else return eeNew( CursorSDL, ( img, hotspot, name, mWindow ) ); #endif } -Cursor * CursorManagerSDL::Create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->GetPlatform()->CreateMouseCursor( path, hotspot, name ); + return mWindow->getPlatform()->createMouseCursor( path, hotspot, name ); #else return eeNew( CursorSDL, ( path, hotspot, name, mWindow ) ); #endif } -void CursorManagerSDL::Set( Cursor * cursor ) { - mWindow->GetPlatform()->SetMouseCursor( cursor ); +void CursorManagerSDL::set( Cursor * cursor ) { + mWindow->getPlatform()->setMouseCursor( cursor ); } -void CursorManagerSDL::Set( EE_SYSTEM_CURSOR syscurid ) { - mWindow->GetPlatform()->SetSystemMouseCursor( syscurid ); +void CursorManagerSDL::set( EE_SYSTEM_CURSOR syscurid ) { + mWindow->getPlatform()->setSystemMouseCursor( syscurid ); } -void CursorManagerSDL::Show() { - Visible( true ); +void CursorManagerSDL::show() { + visible( true ); } -void CursorManagerSDL::Hide() { - Visible( false ); +void CursorManagerSDL::hide() { + visible( false ); } -void CursorManagerSDL::Visible( bool visible ) { +void CursorManagerSDL::visible( bool visible ) { if ( visible ) { SDL_ShowCursor( SDL_ENABLE ); - mWindow->GetPlatform()->ShowMouseCursor(); + mWindow->getPlatform()->showMouseCursor(); mVisible = true; } else { SDL_ShowCursor( SDL_DISABLE ); - mWindow->GetPlatform()->HideMouseCursor(); + mWindow->getPlatform()->hideMouseCursor(); mVisible = false; } } -void CursorManagerSDL::Remove( Cursor * cursor, bool Delete ) { - CursorManager::Remove( cursor, Delete ); +void CursorManagerSDL::remove( Cursor * cursor, bool Delete ) { + CursorManager::remove( cursor, Delete ); } -void CursorManagerSDL::Reload() { +void CursorManagerSDL::reload() { if ( mVisible ) { - Show(); + show(); - mWindow->GetPlatform()->RestoreCursor(); + mWindow->getPlatform()->restoreCursor(); } else { - Hide(); + hide(); } } diff --git a/src/eepp/window/backend/SDL/cursormanagersdl.hpp b/src/eepp/window/backend/SDL/cursormanagersdl.hpp index a464d9040..815e18c20 100644 --- a/src/eepp/window/backend/SDL/cursormanagersdl.hpp +++ b/src/eepp/window/backend/SDL/cursormanagersdl.hpp @@ -14,25 +14,25 @@ class CursorManagerSDL : public CursorManager { public: CursorManagerSDL( EE::Window::Window * window ); - Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * create( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void Set( Cursor * cursor ); + void set( Cursor * cursor ); - void Set( EE_SYSTEM_CURSOR syscurid ); + void set( EE_SYSTEM_CURSOR syscurid ); - void Show(); + void show(); - void Hide(); + void hide(); - void Visible( bool visible ); + void visible( bool visible ); - void Remove( Cursor * cursor, bool Delete = false ); + void remove( Cursor * cursor, bool Delete = false ); - void Reload(); + void reload(); }; }}}} diff --git a/src/eepp/window/backend/SDL/cursorsdl.cpp b/src/eepp/window/backend/SDL/cursorsdl.cpp index ffaa936da..a0c7b5aa9 100644 --- a/src/eepp/window/backend/SDL/cursorsdl.cpp +++ b/src/eepp/window/backend/SDL/cursorsdl.cpp @@ -19,7 +19,7 @@ CursorSDL::CursorSDL( const std::string& path, const Vector2i& hotspot, const st { } -void CursorSDL::Create() { +void CursorSDL::create() { } }}}} diff --git a/src/eepp/window/backend/SDL/cursorsdl.hpp b/src/eepp/window/backend/SDL/cursorsdl.hpp index d24e101d8..0f76e89a6 100644 --- a/src/eepp/window/backend/SDL/cursorsdl.hpp +++ b/src/eepp/window/backend/SDL/cursorsdl.hpp @@ -20,7 +20,7 @@ class CursorSDL : public Cursor { CursorSDL( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - void Create(); + void create(); }; }}}} diff --git a/src/eepp/window/backend/SDL/inputsdl.cpp b/src/eepp/window/backend/SDL/inputsdl.cpp index ae86a6286..c9e3af8a6 100644 --- a/src/eepp/window/backend/SDL/inputsdl.cpp +++ b/src/eepp/window/backend/SDL/inputsdl.cpp @@ -1,13 +1,7 @@ -#include +#include #ifdef EE_BACKEND_SDL_1_2 -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) #if !defined( EE_COMPILER_MSVC ) #include @@ -16,6 +10,14 @@ #endif #endif +#include + +#if !defined( EE_COMPILER_MSVC ) +#include +#else +#include +#endif + #if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN #ifndef SDL_NUMEVENTS #define SDL_NUMEVENTS SDL_LASTEVENT @@ -39,11 +41,11 @@ InputSDL::InputSDL( EE::Window::Window * window ) : InputSDL::~InputSDL() { } -void InputSDL::Update() { +void InputSDL::update() { SDL_Event SDLEvent; InputEvent EEEvent; - CleanStates(); + cleanStates(); while ( SDL_PollEvent( &SDLEvent ) ) { switch( SDLEvent.type ) { @@ -56,12 +58,12 @@ void InputSDL::Update() { } case SDL_KEYDOWN: { - if ( String::IsCharacter( SDLEvent.key.keysym.unicode ) && KEY_TAB != SDLEvent.key.keysym.unicode ) { + if ( String::isCharacter( SDLEvent.key.keysym.unicode ) && KEY_TAB != SDLEvent.key.keysym.unicode ) { EEEvent.Type = InputEvent::TextInput; - EEEvent.text.timestamp = Sys::GetTicks(); + EEEvent.text.timestamp = Sys::getTicks(); EEEvent.text.text = SDLEvent.key.keysym.unicode; - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); } EEEvent.Type = InputEvent::KeyDown; @@ -204,27 +206,27 @@ void InputSDL::Update() { } if ( InputEvent::NoEvent != EEEvent.Type ) { - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); } } } -bool InputSDL::GrabInput() { +bool InputSDL::grabInput() { return ( SDL_WM_GrabInput( SDL_GRAB_QUERY ) == SDL_GRAB_ON ) ? true : false; } -void InputSDL::GrabInput( const bool& Grab ) { +void InputSDL::grabInput( const bool& Grab ) { if ( Grab ) SDL_WM_GrabInput(SDL_GRAB_ON); else SDL_WM_GrabInput(SDL_GRAB_OFF); } -void InputSDL::InjectMousePos( const Uint16& x, const Uint16& y ) { +void InputSDL::injectMousePos( const Uint16& x, const Uint16& y ) { SDL_WarpMouse( x, y ); } -void InputSDL::Init() { +void InputSDL::init() { Vector2if mTempMouse; SDL_GetMouseState( &mTempMouse.x, &mTempMouse.y ); mMousePos.x = (int)mTempMouse.x; @@ -234,7 +236,7 @@ void InputSDL::Init() { SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); - mJoystickManager->Open(); + mJoystickManager->open(); } }}}} diff --git a/src/eepp/window/backend/SDL/inputsdl.hpp b/src/eepp/window/backend/SDL/inputsdl.hpp index 080ba5e25..95ff6dc14 100644 --- a/src/eepp/window/backend/SDL/inputsdl.hpp +++ b/src/eepp/window/backend/SDL/inputsdl.hpp @@ -14,19 +14,19 @@ class EE_API InputSDL : public Input { public: virtual ~InputSDL(); - void Update(); + void update(); - bool GrabInput(); + bool grabInput(); - void GrabInput( const bool& Grab ); + void grabInput( const bool& Grab ); - void InjectMousePos( const Uint16& x, const Uint16& y ); + void injectMousePos( const Uint16& x, const Uint16& y ); protected: friend class WindowSDL; InputSDL( EE::Window::Window * window ); - virtual void Init(); + virtual void init(); }; }}}} diff --git a/src/eepp/window/backend/SDL/joystickmanagersdl.cpp b/src/eepp/window/backend/SDL/joystickmanagersdl.cpp index 1328f796c..9952c1db9 100644 --- a/src/eepp/window/backend/SDL/joystickmanagersdl.cpp +++ b/src/eepp/window/backend/SDL/joystickmanagersdl.cpp @@ -19,30 +19,30 @@ JoystickManagerSDL::JoystickManagerSDL() : JoystickManagerSDL::~JoystickManagerSDL() { } -void JoystickManagerSDL::Update() { +void JoystickManagerSDL::update() { if ( mInit ) { SDL_JoystickUpdate(); for ( Uint32 i = 0; i < mCount; i++ ) if ( NULL != mJoysticks[i] ) - mJoysticks[i]->Update(); + mJoysticks[i]->update(); } } -void JoystickManagerSDL::Open() { +void JoystickManagerSDL::open() { int error = SDL_InitSubSystem( SDL_INIT_JOYSTICK ); if ( !error ) { mCount = SDL_NumJoysticks(); for ( Uint32 i = 0; i < mCount; i++ ) - Create(i); + create(i); mInit = true; } } -void JoystickManagerSDL::Close() { +void JoystickManagerSDL::close() { if ( SDL_WasInit( SDL_INIT_JOYSTICK ) ) { SDL_QuitSubSystem( SDL_INIT_JOYSTICK ); @@ -50,9 +50,9 @@ void JoystickManagerSDL::Close() { } } -void JoystickManagerSDL::Create( const Uint32& index ) { +void JoystickManagerSDL::create( const Uint32& index ) { if ( NULL != mJoysticks[ index ] ) - mJoysticks[ index ]->ReOpen(); + mJoysticks[ index ]->reOpen(); else mJoysticks[ index ] = eeNew( JoystickSDL, ( index ) ); } diff --git a/src/eepp/window/backend/SDL/joystickmanagersdl.hpp b/src/eepp/window/backend/SDL/joystickmanagersdl.hpp index 889cd3272..79ad9b9c3 100644 --- a/src/eepp/window/backend/SDL/joystickmanagersdl.hpp +++ b/src/eepp/window/backend/SDL/joystickmanagersdl.hpp @@ -16,13 +16,13 @@ class EE_API JoystickManagerSDL : public JoystickManager { virtual ~JoystickManagerSDL(); - void Update(); + void update(); - void Close(); + void close(); - void Open(); + void open(); protected: - void Create( const Uint32& index ); + void create( const Uint32& index ); }; }}}} diff --git a/src/eepp/window/backend/SDL/joysticksdl.cpp b/src/eepp/window/backend/SDL/joysticksdl.cpp index f7568fe34..fa7a8af42 100644 --- a/src/eepp/window/backend/SDL/joysticksdl.cpp +++ b/src/eepp/window/backend/SDL/joysticksdl.cpp @@ -8,14 +8,14 @@ JoystickSDL::JoystickSDL( const Uint32& index ) : Joystick( index ), mJoystick( NULL ) { - Open(); + open(); } JoystickSDL::~JoystickSDL() { - Close(); + close(); } -void JoystickSDL::Open() { +void JoystickSDL::open() { mJoystick = SDL_JoystickOpen( mIndex ); if ( NULL != mJoystick ) { @@ -32,7 +32,7 @@ void JoystickSDL::Open() { } } -void JoystickSDL::Close() { +void JoystickSDL::close() { if( SDL_JoystickOpened( mIndex ) ) SDL_JoystickClose( mJoystick ); @@ -41,25 +41,25 @@ void JoystickSDL::Close() { mHats = mButtons = mAxes = mBalls = 0; } -void JoystickSDL::Update() { +void JoystickSDL::update() { if ( NULL != mJoystick ) { - ClearStates(); + clearStates(); for ( Int32 i = 0; i < mButtons; i++ ) { - UpdateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) ); + updateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) ); } } } -Uint8 JoystickSDL::GetHat( const Int32& index ) { +Uint8 JoystickSDL::getHat( const Int32& index ) { if ( index >= 0 && index < mHats ) return SDL_JoystickGetHat( mJoystick, index ); return HAT_CENTERED; } -Float JoystickSDL::GetAxis( const Int32& axis ) { +Float JoystickSDL::getAxis( const Int32& axis ) { if ( axis >= 0 && axis < mAxes ) { return (Float)SDL_JoystickGetAxis( mJoystick, axis ) / 32768.f; } @@ -67,7 +67,7 @@ Float JoystickSDL::GetAxis( const Int32& axis ) { return 0; } -Vector2i JoystickSDL::GetBallMotion( const Int32& ball ) { +Vector2i JoystickSDL::getBallMotion( const Int32& ball ) { Vector2i v; if ( ball >= 0 && ball < mBalls ) @@ -77,7 +77,7 @@ Vector2i JoystickSDL::GetBallMotion( const Int32& ball ) { } -bool JoystickSDL::Plugged() const { +bool JoystickSDL::isPlugged() const { return NULL != mJoystick; } diff --git a/src/eepp/window/backend/SDL/joysticksdl.hpp b/src/eepp/window/backend/SDL/joysticksdl.hpp index 740adab75..d7e05e7d2 100644 --- a/src/eepp/window/backend/SDL/joysticksdl.hpp +++ b/src/eepp/window/backend/SDL/joysticksdl.hpp @@ -21,19 +21,19 @@ class EE_API JoystickSDL : public Joystick { virtual ~JoystickSDL(); - void Close(); + void close(); - void Open(); + void open(); - void Update(); + void update(); - Uint8 GetHat( const Int32& index ); + Uint8 getHat( const Int32& index ); - Float GetAxis( const Int32& axis ); + Float getAxis( const Int32& axis ); - Vector2i GetBallMotion( const Int32& ball ); + Vector2i getBallMotion( const Int32& ball ); - bool Plugged() const; + bool isPlugged() const; protected: SDL_Joystick * mJoystick; }; diff --git a/src/eepp/window/backend/SDL/windowsdl.cpp b/src/eepp/window/backend/SDL/windowsdl.cpp index a89af4832..8b7721475 100644 --- a/src/eepp/window/backend/SDL/windowsdl.cpp +++ b/src/eepp/window/backend/SDL/windowsdl.cpp @@ -1,13 +1,7 @@ -#include +#include #ifdef EE_BACKEND_SDL_1_2 -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) #if !defined( EE_COMPILER_MSVC ) #include @@ -16,6 +10,14 @@ #endif #endif +#include + +#if !defined( EE_COMPILER_MSVC ) +#include +#else +#include +#endif + #include #include @@ -40,7 +42,7 @@ WindowSDL::WindowSDL( WindowSettings Settings, ContextSettings Context ) : mWMinfo( eeNew( SDL_SysWMinfo, () ) ) #endif { - Create( Settings, Context ); + create( Settings, Context ); } WindowSDL::~WindowSDL() { @@ -49,7 +51,7 @@ WindowSDL::~WindowSDL() { #endif } -bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { +bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { if ( mWindow.Created ) return false; @@ -59,14 +61,14 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { if ( SDL_Init( SDL_INIT_VIDEO ) != 0 ) { eePRINTL( "Unable to initialize SDL: %s", SDL_GetError() ); - LogFailureInit( "WindowSDL", GetVersion() ); + logFailureInit( "WindowSDL", getVersion() ); return false; } if ( "" != mWindow.WindowConfig.Icon ) { mWindow.Created = true; - Icon( mWindow.WindowConfig.Icon ); + icon( mWindow.WindowConfig.Icon ); mWindow.Created = false; } @@ -75,8 +77,8 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { mWindow.DesktopResolution = Sizei( videoInfo->current_w, videoInfo->current_h ); if ( mWindow.WindowConfig.Style & WindowStyle::UseDesktopResolution ) { - mWindow.WindowConfig.Width = mWindow.DesktopResolution.Width(); - mWindow.WindowConfig.Height = mWindow.DesktopResolution.Height(); + mWindow.WindowConfig.Width = mWindow.DesktopResolution.width(); + mWindow.WindowConfig.Height = mWindow.DesktopResolution.height(); } mWindow.Flags = SDL_OPENGL | SDL_HWPALETTE; @@ -89,7 +91,7 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { mWindow.Flags |= SDL_NOFRAME; } - SetGLConfig(); + setGLConfig(); Uint32 mTmpFlags = mWindow.Flags; @@ -102,7 +104,7 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { } else { eePRINTL( "Video Mode Unsopported for this videocard: " ); - LogFailureInit( "WindowSDL", GetVersion() ); + logFailureInit( "WindowSDL", getVersion() ); return false; } @@ -112,7 +114,7 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { if ( NULL == mSurface ) { eePRINTL( "Unable to set video mode: %s", SDL_GetError() ); - LogFailureInit( "WindowSDL", GetVersion() ); + logFailureInit( "WindowSDL", getVersion() ); return false; } @@ -134,42 +136,42 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { cGL::instance()->Init(); } - CreatePlatform(); + createPlatform(); - GetMainContext(); + getMainContext(); - Caption( mWindow.WindowConfig.Caption ); + caption( mWindow.WindowConfig.Caption ); - CreateView(); + createView(); - Setup2D(); + setup2D(); mWindow.Created = true; - LogSuccessfulInit( GetVersion() ); + logSuccessfulInit( getVersion() ); /// Init the clipboard after the window creation - reinterpret_cast ( mClipboard )->Init(); + reinterpret_cast ( mClipboard )->init(); /// Init the input after the window creation - reinterpret_cast ( mInput )->Init(); + reinterpret_cast ( mInput )->init(); - mCursorManager->Set( SYS_CURSOR_ARROW ); + mCursorManager->set( SYS_CURSOR_ARROW ); return true; } -std::string WindowSDL::GetVersion() { +std::string WindowSDL::getVersion() { #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) SDL_version ver = mWMinfo->version; - return String::StrFormated( "SDL %d.%d.%d", ver.major, ver.minor, ver.patch ); + return String::strFormated( "SDL %d.%d.%d", ver.major, ver.minor, ver.patch ); #else - return String::StrFormated( "SDL %d.%d.%d", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL ); + return String::strFormated( "SDL %d.%d.%d", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL ); #endif } -void WindowSDL::CreatePlatform() { +void WindowSDL::createPlatform() { eeSAFE_DELETE( mPlatform ); #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) SDL_VERSION( &mWMinfo->version ); @@ -188,7 +190,7 @@ void WindowSDL::CreatePlatform() { #endif } -void WindowSDL::SetGLConfig() { +void WindowSDL::setGLConfig() { SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE , mWindow.ContextConfig.DepthBufferSize ); // Depth SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, ( mWindow.ContextConfig.DoubleBuffering ? 1 : 0 ) ); // Double Buffering SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, mWindow.ContextConfig.StencilBufferSize ); @@ -198,29 +200,29 @@ void WindowSDL::SetGLConfig() { #endif } -void WindowSDL::ToggleFullscreen() { +void WindowSDL::toggleFullscreen() { bool WasMaximized = mWindow.Maximized; - if ( Windowed() ) { - Size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !Windowed() ); + if ( isWindowed() ) { + size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !isWindowed() ); } else { - Size( mWindow.WindowSize.Width(), mWindow.WindowSize.Height(), !Windowed() ); + size( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !isWindowed() ); } if ( WasMaximized ) { - Maximize(); + maximize(); } - GetCursorManager()->Reload(); + getCursorManager()->reload(); } -void WindowSDL::Caption( const std::string& Caption ) { +void WindowSDL::caption( const std::string& Caption ) { mWindow.WindowConfig.Caption = Caption; SDL_WM_SetCaption( Caption.c_str(), NULL ); } -bool WindowSDL::Icon( const std::string& Path ) { +bool WindowSDL::icon( const std::string& Path ) { int x, y, c; if ( !mWindow.Created ) { @@ -277,24 +279,24 @@ bool WindowSDL::Icon( const std::string& Path ) { return false; } -bool WindowSDL::Active() { +bool WindowSDL::active() { return 0 != ( SDL_GetAppState() & SDL_APPINPUTFOCUS ); } -bool WindowSDL::Visible() { +bool WindowSDL::visible() { return 0 != ( SDL_GetAppState() & SDL_APPACTIVE ); } -void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { - Width = mWindow.DesktopResolution.Width(); - Height = mWindow.DesktopResolution.Height(); + Width = mWindow.DesktopResolution.width(); + Height = mWindow.DesktopResolution.height(); } - if ( this->Windowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) + if ( this->isWindowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) return; - eePRINTL( "Switching from %s to %s. Width: %d Height %d.", this->Windowed() ? "windowed" : "fullscreen", Windowed ? "windowed" : "fullscreen", Width, Height ); + eePRINTL( "Switching from %s to %s. Width: %d Height %d.", this->isWindowed() ? "windowed" : "fullscreen", Windowed ? "windowed" : "fullscreen", Width, Height ); #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX #if EE_PLATFORM == EE_PLATFORM_WIN @@ -319,11 +321,11 @@ void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { mWindow.WindowSize = Sizei( oldWidth, oldHeight ); } - if ( this->Windowed() && !Windowed ) { - mWinPos = Position(); + if ( this->isWindowed() && !Windowed ) { + mWinPos = position(); } - SetGLConfig(); + setGLConfig(); if ( Windowed ) { mSurface = SDL_SetVideoMode( Width, Height, mWindow.WindowConfig.BitsPerPixel, mWindow.Flags ); @@ -344,30 +346,30 @@ void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { } #endif - if ( !this->Windowed() && Windowed ) { - Position( mWinPos.x, mWinPos.y ); + if ( !this->isWindowed() && Windowed ) { + position( mWinPos.x, mWinPos.y ); } - BitOp::SetBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); + BitOp::setBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); - mDefaultView.SetView( 0, 0, Width, Height ); + mDefaultView.setView( 0, 0, Width, Height ); - Setup2D(); + setup2D(); - mCursorManager->Reload(); + mCursorManager->reload(); - SendVideoResizeCb(); + sendVideoResizeCb(); if ( NULL == mSurface ) { mWindow.Created = false; } } -void WindowSDL::SwapBuffers() { +void WindowSDL::swapBuffers() { SDL_GL_SwapBuffers(); } -std::vector WindowSDL::GetDisplayModes() const { +std::vector WindowSDL::getDisplayModes() const { SDL_Rect **modes = SDL_ListModes( NULL, SDL_OPENGL | SDL_HWPALETTE | SDL_HWACCEL | SDL_FULLSCREEN ); if(modes == (SDL_Rect **)0) @@ -381,14 +383,14 @@ std::vector WindowSDL::GetDisplayModes() const { return result; } -void WindowSDL::SetGamma( Float Red, Float Green, Float Blue ) { +void WindowSDL::setGamma( Float Red, Float Green, Float Blue ) { eeclamp( &Red , 0.1f, 10.0f ); eeclamp( &Green , 0.1f, 10.0f ); eeclamp( &Blue , 0.1f, 10.0f ); SDL_SetGamma( Red, Green, Blue ); } -eeWindowHandle WindowSDL::GetWindowHandler() { +eeWindowHandle WindowSDL::getWindowHandler() { #if EE_PLATFORM == EE_PLATFORM_WIN return mWMinfo->window; #elif defined( EE_X11_PLATFORM ) diff --git a/src/eepp/window/backend/SDL/windowsdl.hpp b/src/eepp/window/backend/SDL/windowsdl.hpp index 8c8ad7fb1..0854fcd37 100644 --- a/src/eepp/window/backend/SDL/windowsdl.hpp +++ b/src/eepp/window/backend/SDL/windowsdl.hpp @@ -19,25 +19,25 @@ class EE_API WindowSDL : public Window { virtual ~WindowSDL(); - bool Create( WindowSettings Settings, ContextSettings Context ); + bool create( WindowSettings Settings, ContextSettings Context ); - void ToggleFullscreen(); + void toggleFullscreen(); - void Caption( const std::string& Caption ); + void caption( const std::string& caption ); - bool Icon( const std::string& Path ); + bool icon( const std::string& Path ); - bool Active(); + bool active(); - bool Visible(); + bool visible(); - void Size( Uint32 Width, Uint32 Height, bool Windowed ); + void size( Uint32 Width, Uint32 Height, bool Windowed ); - std::vector GetDisplayModes() const; + std::vector getDisplayModes() const; - void SetGamma( Float Red, Float Green, Float Blue ); + void setGamma( Float Red, Float Green, Float Blue ); - eeWindowHandle GetWindowHandler(); + eeWindowHandle getWindowHandler(); protected: friend class ClipboardSDL; @@ -49,13 +49,13 @@ class EE_API WindowSDL : public Window { Vector2i mWinPos; - void CreatePlatform(); + void createPlatform(); - void SwapBuffers(); + void swapBuffers(); - void SetGLConfig(); + void setGLConfig(); - std::string GetVersion(); + std::string getVersion(); }; }}}} diff --git a/src/eepp/window/backend/SDL2/clipboardsdl2.cpp b/src/eepp/window/backend/SDL2/clipboardsdl2.cpp index a23e5103e..89a5bd3bc 100644 --- a/src/eepp/window/backend/SDL2/clipboardsdl2.cpp +++ b/src/eepp/window/backend/SDL2/clipboardsdl2.cpp @@ -13,21 +13,21 @@ ClipboardSDL::ClipboardSDL( EE::Window::Window * window ) : ClipboardSDL::~ClipboardSDL() { } -void ClipboardSDL::Init() { +void ClipboardSDL::init() { } -void ClipboardSDL::SetText( const std::string& Text ) { +void ClipboardSDL::setText( const std::string& Text ) { SDL_SetClipboardText( Text.c_str() ); } -std::string ClipboardSDL::GetText() { +std::string ClipboardSDL::getText() { char * text = SDL_GetClipboardText(); std::string str( text ); SDL_free(text); return str; } -String ClipboardSDL::GetWideText() { +String ClipboardSDL::getWideText() { char * text = SDL_GetClipboardText(); String str( String::fromUtf8( text ) ); SDL_free(text); diff --git a/src/eepp/window/backend/SDL2/clipboardsdl2.hpp b/src/eepp/window/backend/SDL2/clipboardsdl2.hpp index 6f0aeef1b..77d02391e 100644 --- a/src/eepp/window/backend/SDL2/clipboardsdl2.hpp +++ b/src/eepp/window/backend/SDL2/clipboardsdl2.hpp @@ -15,17 +15,17 @@ class EE_API ClipboardSDL : public Clipboard { public: virtual ~ClipboardSDL(); - std::string GetText(); + std::string getText(); - String GetWideText(); + String getWideText(); - void SetText( const std::string& Text ); + void setText( const std::string& Text ); protected: friend class WindowSDL; ClipboardSDL( EE::Window::Window * window ); - void Init(); + void init(); }; }}}} diff --git a/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp b/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp index d76461927..6038dedda 100644 --- a/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp +++ b/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp @@ -8,7 +8,7 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { static SDL_Cursor * SDL_SYS_CURSORS[ SYS_CURSOR_COUNT ] = {0}; -static SDL_Cursor * GetLoadCursor( const EE_SYSTEM_CURSOR& cursor ) { +static SDL_Cursor * getLoadCursor( const EE_SYSTEM_CURSOR& cursor ) { if ( 0 == SDL_SYS_CURSORS[ cursor ] ) { SDL_SYS_CURSORS[ cursor ] = SDL_CreateSystemCursor( (SDL_SystemCursor)cursor ); } @@ -21,19 +21,19 @@ CursorManagerSDL::CursorManagerSDL( EE::Window::Window * window ) : { } -Cursor * CursorManagerSDL::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorSDL, ( tex, hotspot, name, mWindow ) ); } -Cursor * CursorManagerSDL::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::create( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorSDL, ( img, hotspot, name, mWindow ) ); } -Cursor * CursorManagerSDL::Create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorSDL, ( path, hotspot, name, mWindow ) ); } -void CursorManagerSDL::Set( Cursor * cursor ) { +void CursorManagerSDL::set( Cursor * cursor ) { if ( NULL != cursor && cursor != mCurrent ) { SDL_SetCursor( reinterpret_cast( cursor )->GetCursor() ); @@ -43,9 +43,9 @@ void CursorManagerSDL::Set( Cursor * cursor ) { } } -void CursorManagerSDL::Set( EE_SYSTEM_CURSOR syscurid ) { +void CursorManagerSDL::set( EE_SYSTEM_CURSOR syscurid ) { if ( syscurid != mSysCursor ) { - SDL_SetCursor( GetLoadCursor( syscurid ) ); + SDL_SetCursor( getLoadCursor( syscurid ) ); mCurrent = NULL; mCurSysCursor = true; @@ -53,15 +53,15 @@ void CursorManagerSDL::Set( EE_SYSTEM_CURSOR syscurid ) { } } -void CursorManagerSDL::Show() { - Visible( true ); +void CursorManagerSDL::show() { + visible( true ); } -void CursorManagerSDL::Hide() { - Visible( false ); +void CursorManagerSDL::hide() { + visible( false ); } -void CursorManagerSDL::Visible( bool visible ) { +void CursorManagerSDL::visible( bool visible ) { if ( visible ) { SDL_ShowCursor( SDL_ENABLE ); mVisible = true; @@ -71,21 +71,21 @@ void CursorManagerSDL::Visible( bool visible ) { } } -void CursorManagerSDL::Remove( Cursor * cursor, bool Delete ) { - CursorManager::Remove( cursor, Delete ); +void CursorManagerSDL::remove( Cursor * cursor, bool Delete ) { + CursorManager::remove( cursor, Delete ); } -void CursorManagerSDL::Reload() { +void CursorManagerSDL::reload() { if ( mVisible ) { - Show(); + show(); if ( mCurSysCursor ) { - Set( mSysCursor ); + set( mSysCursor ); } else { - Set( mCurrent ); + set( mCurrent ); } } else { - Hide(); + hide(); } } diff --git a/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp b/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp index e07a02fef..8af3556ac 100644 --- a/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp +++ b/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp @@ -14,25 +14,25 @@ class CursorManagerSDL : public CursorManager { public: CursorManagerSDL( EE::Window::Window * window ); - Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * create( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void Set( Cursor * cursor ); + void set( Cursor * cursor ); - void Set( EE_SYSTEM_CURSOR syscurid ); + void set( EE_SYSTEM_CURSOR syscurid ); - void Show(); + void show(); - void Hide(); + void hide(); - void Visible( bool visible ); + void visible( bool visible ); - void Remove( Cursor * cursor, bool Delete = false ); + void remove( Cursor * cursor, bool Delete = false ); - void Reload(); + void reload(); }; }}}} diff --git a/src/eepp/window/backend/SDL2/cursorsdl2.cpp b/src/eepp/window/backend/SDL2/cursorsdl2.cpp index 855cf8f6b..30abfc79c 100644 --- a/src/eepp/window/backend/SDL2/cursorsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cursorsdl2.cpp @@ -8,21 +8,21 @@ CursorSDL::CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& Cursor( tex, hotspot, name, window ), mCursor( NULL ) { - Create(); + create(); } CursorSDL::CursorSDL( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ), mCursor( NULL ) { - Create(); + create(); } CursorSDL::CursorSDL( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( path, hotspot, name, window ), mCursor( NULL ) { - Create(); + create(); } CursorSDL::~CursorSDL() { @@ -30,7 +30,7 @@ CursorSDL::~CursorSDL() { SDL_FreeCursor( mCursor ); } -void CursorSDL::Create() { +void CursorSDL::create() { if ( NULL == mImage ) return; diff --git a/src/eepp/window/backend/SDL2/cursorsdl2.hpp b/src/eepp/window/backend/SDL2/cursorsdl2.hpp index 203503277..2017fe6da 100644 --- a/src/eepp/window/backend/SDL2/cursorsdl2.hpp +++ b/src/eepp/window/backend/SDL2/cursorsdl2.hpp @@ -26,7 +26,7 @@ class CursorSDL : public Cursor { virtual ~CursorSDL(); - void Create(); + void create(); }; }}}} diff --git a/src/eepp/window/backend/SDL2/inputsdl2.cpp b/src/eepp/window/backend/SDL2/inputsdl2.cpp index 3f378bccc..2b9a7a14d 100644 --- a/src/eepp/window/backend/SDL2/inputsdl2.cpp +++ b/src/eepp/window/backend/SDL2/inputsdl2.cpp @@ -23,11 +23,11 @@ InputSDL::InputSDL( EE::Window::Window * window ) : InputSDL::~InputSDL() { } -void InputSDL::Update() { +void InputSDL::update() { SDL_Event SDLEvent; InputEvent EEEvent; - CleanStates(); + cleanStates(); while ( SDL_PollEvent( &SDLEvent ) ) { switch( SDLEvent.type ) { @@ -101,7 +101,7 @@ void InputSDL::Update() { EEEvent.text.timestamp = SDLEvent.text.timestamp; EEEvent.text.text = txt[0]; - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); EEEvent.Type = InputEvent::KeyDown; EEEvent.key.state = SDLEvent.key.state; @@ -191,7 +191,7 @@ void InputSDL::Update() { EEEvent.Type = InputEvent::MouseButtonDown; EEEvent.button.state = 1; - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); EEEvent.Type = InputEvent::MouseButtonUp; EEEvent.button.state = 0; @@ -304,24 +304,24 @@ void InputSDL::Update() { } if ( InputEvent::NoEvent != EEEvent.Type ) { - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); } } } -bool InputSDL::GrabInput() { +bool InputSDL::grabInput() { return ( SDL_GetWindowGrab( reinterpret_cast ( mWindow )->GetSDLWindow() ) == SDL_TRUE ) ? true : false; } -void InputSDL::GrabInput( const bool& Grab ) { +void InputSDL::grabInput( const bool& Grab ) { SDL_SetWindowGrab( reinterpret_cast ( mWindow )->GetSDLWindow(), Grab ? SDL_TRUE : SDL_FALSE ); } -void InputSDL::InjectMousePos( const Uint16& x, const Uint16& y ) { +void InputSDL::injectMousePos( const Uint16& x, const Uint16& y ) { SDL_WarpMouseInWindow( reinterpret_cast( mWindow )->GetSDLWindow(), x, y ); } -void InputSDL::Init() { +void InputSDL::init() { Vector2if mTempMouse; SDL_GetMouseState( &mTempMouse.x, &mTempMouse.y ); @@ -329,14 +329,14 @@ void InputSDL::Init() { mMousePos.x = (int)mTempMouse.x; mMousePos.y = (int)mTempMouse.y; - InitializeTables(); + initializeTables(); #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - mJoystickManager->Open(); + mJoystickManager->open(); #endif } -void InputSDL::InitializeTables() { +void InputSDL::initializeTables() { if ( KeyCodesTableInit ) return; diff --git a/src/eepp/window/backend/SDL2/inputsdl2.hpp b/src/eepp/window/backend/SDL2/inputsdl2.hpp index e3b7bfeac..7d6acdced 100644 --- a/src/eepp/window/backend/SDL2/inputsdl2.hpp +++ b/src/eepp/window/backend/SDL2/inputsdl2.hpp @@ -14,21 +14,21 @@ class EE_API InputSDL : public Input { public: virtual ~InputSDL(); - void Update(); + void update(); - bool GrabInput(); + bool grabInput(); - void GrabInput( const bool& Grab ); + void grabInput( const bool& Grab ); - void InjectMousePos( const Uint16& x, const Uint16& y ); + void injectMousePos( const Uint16& x, const Uint16& y ); protected: friend class WindowSDL; InputSDL( EE::Window::Window * window ); - virtual void Init(); + virtual void init(); - void InitializeTables(); + void initializeTables(); }; }}}} diff --git a/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp b/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp index 74fdaf97c..a762ba376 100644 --- a/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp +++ b/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp @@ -7,41 +7,41 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { JoystickManagerSDL::JoystickManagerSDL() : JoystickManager(), - mAsyncInit( &JoystickManagerSDL::OpenAsync, this ) + mAsyncInit( &JoystickManagerSDL::openAsync, this ) { } JoystickManagerSDL::~JoystickManagerSDL() { } -void JoystickManagerSDL::Update() { +void JoystickManagerSDL::update() { if ( mInit ) { SDL_JoystickUpdate(); for ( Uint32 i = 0; i < mCount; i++ ) if ( NULL != mJoysticks[i] ) - mJoysticks[i]->Update(); + mJoysticks[i]->update(); } } -void JoystickManagerSDL::OpenAsync() { +void JoystickManagerSDL::openAsync() { int error = SDL_InitSubSystem( SDL_INIT_JOYSTICK ); if ( !error ) { mCount = SDL_NumJoysticks(); for ( Uint32 i = 0; i < mCount; i++ ) - Create(i); + create(i); mInit = true; } } -void JoystickManagerSDL::Open() { +void JoystickManagerSDL::open() { mAsyncInit.launch(); } -void JoystickManagerSDL::Close() { +void JoystickManagerSDL::close() { if ( SDL_WasInit( SDL_INIT_JOYSTICK ) ) { SDL_QuitSubSystem( SDL_INIT_JOYSTICK ); @@ -49,9 +49,9 @@ void JoystickManagerSDL::Close() { } } -void JoystickManagerSDL::Create( const Uint32& index ) { +void JoystickManagerSDL::create( const Uint32& index ) { if ( NULL != mJoysticks[ index ] ) - mJoysticks[ index ]->ReOpen(); + mJoysticks[ index ]->reOpen(); else mJoysticks[ index ] = eeNew( JoystickSDL, ( index ) ); } diff --git a/src/eepp/window/backend/SDL2/joystickmanagersdl2.hpp b/src/eepp/window/backend/SDL2/joystickmanagersdl2.hpp index 58aca72d9..3d8fe97b9 100644 --- a/src/eepp/window/backend/SDL2/joystickmanagersdl2.hpp +++ b/src/eepp/window/backend/SDL2/joystickmanagersdl2.hpp @@ -17,15 +17,15 @@ class EE_API JoystickManagerSDL : public JoystickManager { virtual ~JoystickManagerSDL(); - void Update(); + void update(); - void Close(); + void close(); - void Open(); + void open(); protected: - void Create( const Uint32& index ); + void create( const Uint32& index ); - void OpenAsync(); + void openAsync(); Thread mAsyncInit; }; diff --git a/src/eepp/window/backend/SDL2/joysticksdl2.cpp b/src/eepp/window/backend/SDL2/joysticksdl2.cpp index e60ad8916..1c078acd7 100644 --- a/src/eepp/window/backend/SDL2/joysticksdl2.cpp +++ b/src/eepp/window/backend/SDL2/joysticksdl2.cpp @@ -14,14 +14,14 @@ JoystickSDL::JoystickSDL( const Uint32& index ) : Joystick( index ), mJoystick( NULL ) { - Open(); + open(); } JoystickSDL::~JoystickSDL() { - Close(); + close(); } -void JoystickSDL::Open() { +void JoystickSDL::open() { mJoystick = SDL_JoystickOpen( mIndex ); if ( NULL != mJoystick ) { @@ -40,7 +40,7 @@ void JoystickSDL::Open() { } } -void JoystickSDL::Close() { +void JoystickSDL::close() { if( NULL != mJoystick ) SDL_JoystickClose( mJoystick ); @@ -49,25 +49,25 @@ void JoystickSDL::Close() { mHats = mButtons = mAxes = mBalls = 0; } -void JoystickSDL::Update() { +void JoystickSDL::update() { if ( NULL != mJoystick ) { - ClearStates(); + clearStates(); for ( Int32 i = 0; i < mButtons; i++ ) { - UpdateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) ); + updateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) ); } } } -Uint8 JoystickSDL::GetHat( const Int32& index ) { +Uint8 JoystickSDL::getHat( const Int32& index ) { if ( index >= 0 && index < mHats ) return SDL_JoystickGetHat( mJoystick, index ); return HAT_CENTERED; } -Float JoystickSDL::GetAxis( const Int32& axis ) { +Float JoystickSDL::getAxis( const Int32& axis ) { if ( axis >= 0 && axis < mAxes ) { return (Float)SDL_JoystickGetAxis( mJoystick, axis ) / 32768.f; } @@ -75,7 +75,7 @@ Float JoystickSDL::GetAxis( const Int32& axis ) { return 0; } -Vector2i JoystickSDL::GetBallMotion( const Int32& ball ) { +Vector2i JoystickSDL::getBallMotion( const Int32& ball ) { Vector2i v; if ( ball >= 0 && ball < mBalls ) @@ -84,7 +84,7 @@ Vector2i JoystickSDL::GetBallMotion( const Int32& ball ) { return v; } -bool JoystickSDL::Plugged() const { +bool JoystickSDL::isPlugged() const { return NULL != mJoystick; } diff --git a/src/eepp/window/backend/SDL2/joysticksdl2.hpp b/src/eepp/window/backend/SDL2/joysticksdl2.hpp index 0fc73edb4..6ca51a4b1 100644 --- a/src/eepp/window/backend/SDL2/joysticksdl2.hpp +++ b/src/eepp/window/backend/SDL2/joysticksdl2.hpp @@ -16,19 +16,19 @@ class EE_API JoystickSDL : public Joystick { virtual ~JoystickSDL(); - void Close(); + void close(); - void Open(); + void open(); - void Update(); + void update(); - Uint8 GetHat( const Int32& index ); + Uint8 getHat( const Int32& index ); - Float GetAxis( const Int32& axis ); + Float getAxis( const Int32& axis ); - Vector2i GetBallMotion( const Int32& ball ); + Vector2i getBallMotion( const Int32& ball ); - bool Plugged() const; + bool isPlugged() const; protected: SDL_Joystick * mJoystick; }; diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 9e2b27db0..866271808 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -22,7 +22,7 @@ #include #include -static std::string SDL_AndroidGetApkPath() { +static std::string SDL_AndroidgetApkPath() { static std::string apkPath = ""; if ( "" == apkPath ) { @@ -31,9 +31,9 @@ static std::string SDL_AndroidGetApkPath() { jobject fileObject; const char *path; - JNIEnv *env = (JNIEnv*)SDL_AndroidGetJNIEnv(); + JNIEnv *env = (JNIEnv*)SDL_AndroidgetJNIEnv(); - jclass ActivityClass = env->GetObjectClass((jobject)SDL_AndroidGetActivity()); + jclass ActivityClass = env->GetObjectClass((jobject)SDL_AndroidgetActivity()); // context = SDLActivity.getContext(); mid = env->GetStaticMethodID(ActivityClass,"getContext","()Landroid/content/Context;"); @@ -72,7 +72,7 @@ WindowSDL::WindowSDL( WindowSettings Settings, ContextSettings Context ) : mZip( eeNew( Zip, () ) ) #endif { - Create( Settings, Context ); + create( Settings, Context ); } WindowSDL::~WindowSDL() { @@ -97,7 +97,7 @@ WindowSDL::~WindowSDL() { #endif } -bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { +bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { if ( mWindow.Created ) return false; @@ -107,7 +107,7 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { if ( SDL_Init( SDL_INIT_VIDEO ) != 0 ) { eePRINTL( "Unable to initialize SDL: %s", SDL_GetError() ); - LogFailureInit( "WindowSDL", GetVersion() ); + logFailureInit( "WindowSDL", GetVersion() ); return false; } @@ -149,7 +149,7 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { if ( NULL == mSDLWindow ) { eePRINTL( "Unable to create window: %s", SDL_GetError() ); - LogFailureInit( "WindowSDL", GetVersion() ); + logFailureInit( "WindowSDL", GetVersion() ); return false; } @@ -218,7 +218,7 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { { eePRINTL( "Unable to create context: %s", SDL_GetError() ); - LogFailureInit( "WindowSDL", GetVersion() ); + logFailureInit( "WindowSDL", GetVersion() ); return false; } @@ -232,32 +232,32 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { cGL::instance()->Init(); } - CreatePlatform(); + createPlatform(); - GetMainContext(); + getMainContext(); - Caption( mWindow.WindowConfig.Caption ); + caption( mWindow.WindowConfig.Caption ); - CreateView(); + createView(); - Setup2D(); + setup2D(); mWindow.Created = true; if ( "" != mWindow.WindowConfig.Icon ) { - Icon( mWindow.WindowConfig.Icon ); + icon( mWindow.WindowConfig.Icon ); } /// Init the clipboard after the window creation - reinterpret_cast ( mClipboard )->Init(); + reinterpret_cast ( mClipboard )->init(); /// Init the input after the window creation - reinterpret_cast ( mInput )->Init(); + reinterpret_cast ( mInput )->init(); - mCursorManager->Set( SYS_CURSOR_ARROW ); + mCursorManager->set( SYS_CURSOR_ARROW ); #if EE_PLATFORM == EE_PLATFORM_ANDROID - std::string apkPath( SDL_AndroidGetApkPath() ); + std::string apkPath( SDL_AndroidgetApkPath() ); eePRINTL( "Opening application APK in: %s", apkPath.c_str() ); @@ -268,13 +268,13 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { LogSuccessfulInit( GetVersion(), apkPath ); #else - LogSuccessfulInit( GetVersion() ); + logSuccessfulInit( GetVersion() ); #endif return true; } -bool WindowSDL::IsThreadedGLContext() { +bool WindowSDL::isThreadedGLContext() { #ifdef SDL2_THREADED_GLCONTEXT return true; #else @@ -282,11 +282,11 @@ bool WindowSDL::IsThreadedGLContext() { #endif } -void WindowSDL::SetGLContextThread() { +void WindowSDL::setGLContextThread() { SDL_GL_MakeCurrent( mSDLWindow, mGLContextThread ); } -void WindowSDL::UnsetGLContextThread() { +void WindowSDL::unsetGLContextThread() { SDL_GL_MakeCurrent( mSDLWindow, NULL ); } @@ -298,7 +298,7 @@ std::string WindowSDL::GetVersion() { return String::strFormated( "SDL %d.%d.%d", ver.major, ver.minor, ver.patch ); } -void WindowSDL::CreatePlatform() { +void WindowSDL::createPlatform() { eeSAFE_DELETE( mPlatform ); #ifdef EE_USE_WMINFO @@ -306,9 +306,9 @@ void WindowSDL::CreatePlatform() { #endif #if defined( EE_X11_PLATFORM ) - mPlatform = eeNew( Platform::X11Impl, ( this, mWMinfo->GetWindowHandler(), mWMinfo->GetWindow(), mWMinfo->GetWindow(), NULL, NULL ) ); + mPlatform = eeNew( Platform::X11Impl, ( this, mWMinfo->getWindowHandler(), mWMinfo->getWindow(), mWMinfo->getWindow(), NULL, NULL ) ); #elif EE_PLATFORM == EE_PLATFORM_WIN - mPlatform = eeNew( Platform::WinImpl, ( this, GetWindowHandler() ) ); + mPlatform = eeNew( Platform::WinImpl, ( this, getWindowHandler() ) ); #elif EE_PLATFORM == EE_PLATFORM_MACOSX mPlatform = eeNew( Platform::OSXImpl, ( this ) ); #else @@ -334,29 +334,29 @@ void WindowSDL::SetGLConfig() { } } -void WindowSDL::ToggleFullscreen() { +void WindowSDL::toggleFullscreen() { bool WasMaximized = mWindow.Maximized; - if ( Windowed() ) { - Size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !Windowed() ); + if ( isWindowed() ) { + size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !isWindowed() ); } else { - Size( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !Windowed() ); + size( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !isWindowed() ); } if ( WasMaximized ) { - Maximize(); + maximize(); } - GetCursorManager()->Reload(); + getCursorManager()->reload(); } -void WindowSDL::Caption( const std::string& Caption ) { +void WindowSDL::caption( const std::string& Caption ) { mWindow.WindowConfig.Caption = Caption; SDL_SetWindowTitle( mSDLWindow, Caption.c_str() ); } -bool WindowSDL::Active() { +bool WindowSDL::active() { Uint32 flags = 0; flags = SDL_GetWindowFlags( mSDLWindow ); @@ -364,7 +364,7 @@ bool WindowSDL::Active() { return 0 != ( ( flags & SDL_WINDOW_INPUT_FOCUS ) && ( flags & SDL_WINDOW_MOUSE_FOCUS ) ); } -bool WindowSDL::Visible() { +bool WindowSDL::visible() { Uint32 flags = 0; flags = SDL_GetWindowFlags( mSDLWindow ); @@ -372,16 +372,16 @@ bool WindowSDL::Visible() { return 0 != ( ( flags & SDL_WINDOW_SHOWN ) && !( flags & SDL_WINDOW_MINIMIZED ) ); } -void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { Width = mWindow.DesktopResolution.width(); Height = mWindow.DesktopResolution.height(); } - if ( this->Windowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) + if ( this->isWindowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) return; - eePRINTL( "Switching from %s to %s. Width: %d Height %d.", this->Windowed() ? "windowed" : "fullscreen", Windowed ? "windowed" : "fullscreen", Width, Height ); + eePRINTL( "Switching from %s to %s. Width: %d Height %d.", this->isWindowed() ? "windowed" : "fullscreen", Windowed ? "windowed" : "fullscreen", Width, Height ); Uint32 oldWidth = mWindow.WindowConfig.Width; Uint32 oldHeight = mWindow.WindowConfig.Height; @@ -395,46 +395,46 @@ void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { mWindow.WindowSize = Sizei( oldWidth, oldHeight ); } - if ( this->Windowed() && !Windowed ) { - mWinPos = Position(); + if ( this->isWindowed() && !Windowed ) { + mWinPos = position(); } else { SDL_SetWindowFullscreen( mSDLWindow, Windowed ? 0 : SDL_WINDOW_FULLSCREEN ); } SDL_SetWindowSize( mSDLWindow, Width, Height ); - if ( this->Windowed() && !Windowed ) { - mWinPos = Position(); + if ( this->isWindowed() && !Windowed ) { + mWinPos = position(); SetGLConfig(); SDL_SetWindowFullscreen( mSDLWindow, Windowed ? 0 : SDL_WINDOW_FULLSCREEN ); } - if ( !this->Windowed() && Windowed ) { - Position( mWinPos.x, mWinPos.y ); + if ( !this->isWindowed() && Windowed ) { + position( mWinPos.x, mWinPos.y ); } BitOp::setBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); - mDefaultView.SetView( 0, 0, Width, Height ); + mDefaultView.setView( 0, 0, Width, Height ); - Setup2D(); + setup2D(); SDL_PumpEvents(); SDL_FlushEvent( SDL_WINDOWEVENT ); - mCursorManager->Reload(); + mCursorManager->reload(); - SendVideoResizeCb(); + sendVideoResizeCb(); } -void WindowSDL::SwapBuffers() { +void WindowSDL::swapBuffers() { SDL_GL_SwapWindow( mSDLWindow ); } -std::vector WindowSDL::GetDisplayModes() const { +std::vector WindowSDL::getDisplayModes() const { std::vector result; int displays = SDL_GetNumVideoDisplays(); @@ -453,7 +453,7 @@ std::vector WindowSDL::GetDisplayModes() const { return result; } -void WindowSDL::SetGamma( Float Red, Float Green, Float Blue ) { +void WindowSDL::setGamma( Float Red, Float Green, Float Blue ) { eeclamp( &Red , (Float)0.1f, (Float)10.0f ); eeclamp( &Green , (Float)0.1f, (Float)10.0f ); eeclamp( &Blue , (Float)0.1f, (Float)10.0f ); @@ -481,15 +481,15 @@ void WindowSDL::SetGamma( Float Red, Float Green, Float Blue ) { SDL_SetWindowGammaRamp( mSDLWindow, red_ramp, green_ramp, blue_ramp ); } -eeWindowHandle WindowSDL::GetWindowHandler() { +eeWindowHandle WindowSDL::getWindowHandler() { if ( NULL != mWMinfo ) { - return mWMinfo->GetWindowHandler(); + return mWMinfo->getWindowHandler(); } return 0; } -bool WindowSDL::Icon( const std::string& Path ) { +bool WindowSDL::icon( const std::string& Path ) { int x, y, c; if ( !mWindow.Created ) { @@ -546,31 +546,31 @@ bool WindowSDL::Icon( const std::string& Path ) { return false; } -void WindowSDL::Minimize() { +void WindowSDL::minimize() { SDL_MinimizeWindow( mSDLWindow ); } -void WindowSDL::Maximize() { +void WindowSDL::maximize() { SDL_MaximizeWindow( mSDLWindow ); } -void WindowSDL::Hide() { +void WindowSDL::hide() { SDL_HideWindow( mSDLWindow ); } -void WindowSDL::Raise() { +void WindowSDL::raise() { SDL_RaiseWindow( mSDLWindow ); } -void WindowSDL::Show() { +void WindowSDL::show() { SDL_ShowWindow( mSDLWindow ); } -void WindowSDL::Position( Int16 Left, Int16 Top ) { +void WindowSDL::position( Int16 Left, Int16 Top ) { SDL_SetWindowPosition( mSDLWindow, Left, Top ); } -Vector2i WindowSDL::Position() { +Vector2i WindowSDL::position() { Vector2i p; SDL_GetWindowPosition( mSDLWindow, &p.x, &p.y ); @@ -585,28 +585,28 @@ void WindowSDL::UpdateDesktopResolution() { mWindow.DesktopResolution = Sizei( dpm.w, dpm.h ); } -const Sizei& WindowSDL::GetDesktopResolution() { +const Sizei& WindowSDL::getDesktopResolution() { UpdateDesktopResolution(); - return Window::GetDesktopResolution(); + return Window::getDesktopResolution(); } SDL_Window * WindowSDL::GetSDLWindow() const { return mSDLWindow; } -void WindowSDL::StartTextInput() { +void WindowSDL::startTextInput() { SDL_StartTextInput(); } -bool WindowSDL::IsTextInputActive() { +bool WindowSDL::isTextInputActive() { return SDL_TRUE == SDL_IsTextInputActive(); } -void WindowSDL::StopTextInput() { +void WindowSDL::stopTextInput() { SDL_StopTextInput(); } -void WindowSDL::SetTextInputRect( Recti& rect ) { +void WindowSDL::setTextInputRect( Recti& rect ) { SDL_Rect r; r.x = rect.Left; @@ -622,37 +622,37 @@ void WindowSDL::SetTextInputRect( Recti& rect ) { rect.Bottom = rect.Top + r.h; } -bool WindowSDL::HasScreenKeyboardSupport() { +bool WindowSDL::hasScreenKeyboardSupport() { return SDL_TRUE == SDL_HasScreenKeyboardSupport(); } -bool WindowSDL::IsScreenKeyboardShown() { +bool WindowSDL::isScreenKeyboardShown() { return SDL_TRUE == SDL_IsScreenKeyboardShown( mSDLWindow ); } #if EE_PLATFORM == EE_PLATFORM_ANDROID -void * WindowSDL::GetJNIEnv() { - return SDL_AndroidGetJNIEnv(); +void * WindowSDL::getJNIEnv() { + return SDL_AndroidgetJNIEnv(); } -void * WindowSDL::GetActivity() { - return SDL_AndroidGetActivity(); +void * WindowSDL::getActivity() { + return SDL_AndroidgetActivity(); } -int WindowSDL::GetExternalStorageState() { - return SDL_AndroidGetExternalStorageState(); +int WindowSDL::getExternalStorageState() { + return SDL_AndroidgetExternalStorageState(); } -std::string WindowSDL::GetInternalStoragePath() { - return std::string( SDL_AndroidGetInternalStoragePath() ); +std::string WindowSDL::getInternalStoragePath() { + return std::string( SDL_AndroidgetInternalStoragePath() ); } -std::string WindowSDL::GetExternalStoragePath() { - return std::string( SDL_AndroidGetExternalStoragePath() ); +std::string WindowSDL::getExternalStoragePath() { + return std::string( SDL_AndroidgetExternalStoragePath() ); } -std::string WindowSDL::GetApkPath() { - return SDL_AndroidGetApkPath(); +std::string WindowSDL::getApkPath() { + return SDL_AndroidgetApkPath(); } #endif diff --git a/src/eepp/window/backend/SDL2/windowsdl2.hpp b/src/eepp/window/backend/SDL2/windowsdl2.hpp index 27ae83a2b..f65637b9e 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.hpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.hpp @@ -23,75 +23,75 @@ class EE_API WindowSDL : public Window { virtual ~WindowSDL(); - bool Create( WindowSettings Settings, ContextSettings Context ); + bool create( WindowSettings Settings, ContextSettings Context ); - void ToggleFullscreen(); + void toggleFullscreen(); - void Caption( const std::string& Caption ); + void caption( const std::string& caption ); - bool Icon( const std::string& Path ); + bool icon( const std::string& Path ); - bool Active(); + bool active(); - bool Visible(); + bool visible(); - void Size( Uint32 Width, Uint32 Height, bool Windowed ); + void size( Uint32 Width, Uint32 Height, bool isWindowed ); - std::vector GetDisplayModes() const; + std::vector getDisplayModes() const; - void SetGamma( Float Red, Float Green, Float Blue ); + void setGamma( Float Red, Float Green, Float Blue ); - eeWindowHandle GetWindowHandler(); + eeWindowHandle getWindowHandler(); - virtual void Minimize(); + virtual void minimize(); - virtual void Maximize(); + virtual void maximize(); - virtual void Hide(); + virtual void hide(); - virtual void Raise(); + virtual void raise(); - virtual void Show(); + virtual void show(); - virtual void Position( Int16 Left, Int16 Top ); + virtual void position( Int16 Left, Int16 Top ); - virtual Vector2i Position(); + virtual Vector2i position(); - const Sizei& GetDesktopResolution(); + const Sizei& getDesktopResolution(); SDL_Window * GetSDLWindow() const; - void StartTextInput(); + void startTextInput(); - bool IsTextInputActive(); + bool isTextInputActive(); - void StopTextInput(); + void stopTextInput(); - void SetTextInputRect( Recti& rect ); + void setTextInputRect( Recti& rect ); - bool HasScreenKeyboardSupport(); + bool hasScreenKeyboardSupport(); - bool IsScreenKeyboardShown(); + bool isScreenKeyboardShown(); #if EE_PLATFORM == EE_PLATFORM_ANDROID - void * GetJNIEnv(); + void * getJNIEnv(); - void * GetActivity(); + void * getActivity(); - int GetExternalStorageState(); + int getExternalStorageState(); - std::string GetInternalStoragePath(); + std::string getInternalStoragePath(); - std::string GetExternalStoragePath(); + std::string getExternalStoragePath(); - std::string GetApkPath(); + std::string getApkPath(); #endif - bool IsThreadedGLContext(); + bool isThreadedGLContext(); - void SetGLContextThread(); + void setGLContextThread(); - void UnsetGLContextThread(); + void unsetGLContextThread(); protected: friend class ClipboardSDL; @@ -109,9 +109,9 @@ class EE_API WindowSDL : public Window { Vector2i mWinPos; - void CreatePlatform(); + void createPlatform(); - void SwapBuffers(); + void swapBuffers(); void SetGLConfig(); diff --git a/src/eepp/window/backend/SDL2/wminfo.cpp b/src/eepp/window/backend/SDL2/wminfo.cpp index 319382f07..a883f0739 100644 --- a/src/eepp/window/backend/SDL2/wminfo.cpp +++ b/src/eepp/window/backend/SDL2/wminfo.cpp @@ -26,13 +26,13 @@ WMInfo::~WMInfo() { } #if defined( EE_X11_PLATFORM ) -X11Window WMInfo::GetWindow() { +X11Window WMInfo::getWindow() { SDL_SysWMinfo * info = static_cast ( mWMInfo ); return info->info.x11.window; } #endif -eeWindowHandle WMInfo::GetWindowHandler() { +eeWindowHandle WMInfo::getWindowHandler() { #if EE_PLATFORM == EE_PLATFORM_WIN || defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_MACOSX SDL_SysWMinfo * info = static_cast ( mWMInfo ); #endif diff --git a/src/eepp/window/backend/SDL2/wminfo.hpp b/src/eepp/window/backend/SDL2/wminfo.hpp index c9fdad065..bcd3ac4c2 100644 --- a/src/eepp/window/backend/SDL2/wminfo.hpp +++ b/src/eepp/window/backend/SDL2/wminfo.hpp @@ -13,10 +13,10 @@ class WMInfo { ~WMInfo(); #if defined( EE_X11_PLATFORM ) - X11Window GetWindow(); + X11Window getWindow(); #endif - eeWindowHandle GetWindowHandler(); + eeWindowHandle getWindowHandler(); protected: void * mWMInfo; }; diff --git a/src/eepp/window/backend/SFML/cursormanagersfml.cpp b/src/eepp/window/backend/SFML/cursormanagersfml.cpp index da7e64f43..db5544e48 100644 --- a/src/eepp/window/backend/SFML/cursormanagersfml.cpp +++ b/src/eepp/window/backend/SFML/cursormanagersfml.cpp @@ -19,7 +19,7 @@ CursorManagerSFML::CursorManagerSFML( EE::Window::Window * window ) : Cursor * CursorManagerSFML::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->GetPlatform()->CreateMouseCursor( tex, hotspot, name ); + return mWindow->getPlatform()->createMouseCursor( tex, hotspot, name ); #else return eeNew( CursorSFML, ( tex, hotspot, name, mWindow ) ); #endif @@ -27,7 +27,7 @@ Cursor * CursorManagerSFML::Create( Texture * tex, const Vector2i& hotspot, cons Cursor * CursorManagerSFML::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->GetPlatform()->CreateMouseCursor( img, hotspot, name ); + return mWindow->getPlatform()->createMouseCursor( img, hotspot, name ); #else return eeNew( CursorSFML, ( img, hotspot, name, mWindow ) ); #endif @@ -35,18 +35,18 @@ Cursor * CursorManagerSFML::Create( Image * img, const Vector2i& hotspot, const Cursor * CursorManagerSFML::Create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->GetPlatform()->CreateMouseCursor( path, hotspot, name ); + return mWindow->getPlatform()->createMouseCursor( path, hotspot, name ); #else return eeNew( CursorSFML, ( path, hotspot, name, mWindow ) ); #endif } void CursorManagerSFML::Set( Cursor * cursor ) { - mWindow->GetPlatform()->SetMouseCursor( cursor ); + mWindow->getPlatform()->setMouseCursor( cursor ); } void CursorManagerSFML::Set( EE_SYSTEM_CURSOR syscurid ) { - mWindow->GetPlatform()->SetSystemMouseCursor( syscurid ); + mWindow->getPlatform()->setSystemMouseCursor( syscurid ); } void CursorManagerSFML::Show() { @@ -61,13 +61,13 @@ void CursorManagerSFML::Visible( bool visible ) { if ( visible ) { reinterpret_cast(mWindow)->GetSFMLWindow()->setMouseCursorVisible( true ); - mWindow->GetPlatform()->ShowMouseCursor(); + mWindow->getPlatform()->showMouseCursor(); mVisible = true; } else { reinterpret_cast(mWindow)->GetSFMLWindow()->setMouseCursorVisible( false ); - mWindow->GetPlatform()->HideMouseCursor(); + mWindow->getPlatform()->hideMouseCursor(); mVisible = false; } @@ -81,7 +81,7 @@ void CursorManagerSFML::Reload() { if ( mVisible ) { Show(); - mWindow->GetPlatform()->RestoreCursor(); + mWindow->getPlatform()->restoreCursor(); } else { Hide(); } diff --git a/src/eepp/window/backend/SFML/windowsfml.cpp b/src/eepp/window/backend/SFML/windowsfml.cpp index a34b0af83..52d13e4c1 100644 --- a/src/eepp/window/backend/SFML/windowsfml.cpp +++ b/src/eepp/window/backend/SFML/windowsfml.cpp @@ -1,12 +1,19 @@ -#include +#include #ifdef EE_BACKEND_SFML_ACTIVE #if defined( EE_X11_PLATFORM ) #include #endif + #undef None +#endif + +#include + +#ifdef EE_BACKEND_SFML_ACTIVE + #include #include diff --git a/src/eepp/window/backend/null/clipboardnull.cpp b/src/eepp/window/backend/null/clipboardnull.cpp index e17b59520..e3506841e 100644 --- a/src/eepp/window/backend/null/clipboardnull.cpp +++ b/src/eepp/window/backend/null/clipboardnull.cpp @@ -11,17 +11,17 @@ ClipboardNull::ClipboardNull( EE::Window::Window * window ) : ClipboardNull::~ClipboardNull() { } -void ClipboardNull::Init() { +void ClipboardNull::init() { } -void ClipboardNull::SetText( const std::string& Text ) { +void ClipboardNull::setText( const std::string& Text ) { } -std::string ClipboardNull::GetText() { +std::string ClipboardNull::getText() { return std::string(); } -String ClipboardNull::GetWideText() { +String ClipboardNull::getWideText() { return String(); } diff --git a/src/eepp/window/backend/null/clipboardnull.hpp b/src/eepp/window/backend/null/clipboardnull.hpp index fdec729d3..76d7630d7 100644 --- a/src/eepp/window/backend/null/clipboardnull.hpp +++ b/src/eepp/window/backend/null/clipboardnull.hpp @@ -10,17 +10,17 @@ class EE_API ClipboardNull : public Clipboard { public: virtual ~ClipboardNull(); - std::string GetText(); + std::string getText(); - String GetWideText(); + String getWideText(); - void SetText( const std::string& Text ); + void setText( const std::string& Text ); protected: friend class WindowNull; ClipboardNull( EE::Window::Window * window ); - void Init(); + void init(); }; }}}} diff --git a/src/eepp/window/backend/null/cursormanagernull.cpp b/src/eepp/window/backend/null/cursormanagernull.cpp index 5c3f4f8a5..4ad9ca8b2 100644 --- a/src/eepp/window/backend/null/cursormanagernull.cpp +++ b/src/eepp/window/backend/null/cursormanagernull.cpp @@ -8,38 +8,38 @@ CursorManagerNull::CursorManagerNull( EE::Window::Window * window ) : { } -Cursor * CursorManagerNull::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerNull::create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorNull, ( tex, hotspot, name, mWindow ) ); } -Cursor * CursorManagerNull::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerNull::create( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorNull, ( img, hotspot, name, mWindow ) ); } -Cursor * CursorManagerNull::Create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerNull::create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorNull, ( path, hotspot, name, mWindow ) ); } -void CursorManagerNull::Set( Cursor * cursor ) { +void CursorManagerNull::set( Cursor * cursor ) { } -void CursorManagerNull::Set( EE_SYSTEM_CURSOR syscurid ) { +void CursorManagerNull::set( EE_SYSTEM_CURSOR syscurid ) { } -void CursorManagerNull::Show() { +void CursorManagerNull::show() { } -void CursorManagerNull::Hide() { +void CursorManagerNull::hide() { } -void CursorManagerNull::Visible( bool visible ) { +void CursorManagerNull::visible( bool visible ) { } -void CursorManagerNull::Remove( Cursor * cursor, bool Delete ) { - CursorManager::Remove( cursor, Delete ); +void CursorManagerNull::remove( Cursor * cursor, bool Delete ) { + CursorManager::remove( cursor, Delete ); } -void CursorManagerNull::Reload() { +void CursorManagerNull::reload() { } }}}} diff --git a/src/eepp/window/backend/null/cursormanagernull.hpp b/src/eepp/window/backend/null/cursormanagernull.hpp index 115cdacfd..b987d6b66 100644 --- a/src/eepp/window/backend/null/cursormanagernull.hpp +++ b/src/eepp/window/backend/null/cursormanagernull.hpp @@ -11,25 +11,25 @@ class CursorManagerNull : public CursorManager { public: CursorManagerNull( EE::Window::Window * window ); - Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * create( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void Set( Cursor * cursor ); + void set( Cursor * cursor ); - void Set( EE_SYSTEM_CURSOR syscurid ); + void set( EE_SYSTEM_CURSOR syscurid ); - void Show(); + void show(); - void Hide(); + void hide(); - void Visible( bool visible ); + void visible( bool visible ); - void Remove( Cursor * cursor, bool Delete = false ); + void remove( Cursor * cursor, bool Delete = false ); - void Reload(); + void reload(); }; }}}} diff --git a/src/eepp/window/backend/null/cursornull.cpp b/src/eepp/window/backend/null/cursornull.cpp index c5a613984..e87e72279 100644 --- a/src/eepp/window/backend/null/cursornull.cpp +++ b/src/eepp/window/backend/null/cursornull.cpp @@ -7,7 +7,7 @@ CursorNull::CursorNull( Texture * tex, const Vector2i& hotspot, const std::strin { } -CursorNull::CursorNull( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorNull::CursorNull( getImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ) { } @@ -17,7 +17,7 @@ CursorNull::CursorNull( const std::string& path, const Vector2i& hotspot, const { } -void CursorNull::Create() { +void CursorNull::create() { } }}}} diff --git a/src/eepp/window/backend/null/cursornull.hpp b/src/eepp/window/backend/null/cursornull.hpp index 4ef6e347e..4b210e8e0 100644 --- a/src/eepp/window/backend/null/cursornull.hpp +++ b/src/eepp/window/backend/null/cursornull.hpp @@ -11,13 +11,13 @@ class CursorNull : public Cursor { protected: friend class CursorManagerNull; - CursorNull( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorNull( Texture * tex, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - CursorNull( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorNull( getImage * img, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - CursorNull( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorNull( const std::string& path, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - void Create(); + void create(); }; }}}} diff --git a/src/eepp/window/backend/null/inputnull.cpp b/src/eepp/window/backend/null/inputnull.cpp index da494aefe..ba5403acf 100644 --- a/src/eepp/window/backend/null/inputnull.cpp +++ b/src/eepp/window/backend/null/inputnull.cpp @@ -11,20 +11,20 @@ InputNull::InputNull( EE::Window::Window * window ) : InputNull::~InputNull() { } -void InputNull::Update() { +void InputNull::update() { } -bool InputNull::GrabInput() { +bool InputNull::grabInput() { return false; } -void InputNull::GrabInput( const bool& Grab ) { +void InputNull::grabInput( const bool& Grab ) { } -void InputNull::InjectMousePos( const Uint16& x, const Uint16& y ) { +void InputNull::injectMousePos( const Uint16& x, const Uint16& y ) { } -void InputNull::Init() { +void InputNull::init() { } }}}} diff --git a/src/eepp/window/backend/null/inputnull.hpp b/src/eepp/window/backend/null/inputnull.hpp index 06c0c4445..170e23e8a 100644 --- a/src/eepp/window/backend/null/inputnull.hpp +++ b/src/eepp/window/backend/null/inputnull.hpp @@ -9,19 +9,19 @@ class EE_API InputNull : public Input { public: virtual ~InputNull(); - void Update(); + void update(); - bool GrabInput(); + bool grabInput(); - void GrabInput( const bool& Grab ); + void grabInput( const bool& Grab ); - void InjectMousePos( const Uint16& x, const Uint16& y ); + void injectMousePos( const Uint16& x, const Uint16& y ); protected: friend class WindowNull; InputNull( EE::Window::Window * window ); - virtual void Init(); + virtual void init(); }; }}}} diff --git a/src/eepp/window/backend/null/joystickmanagernull.cpp b/src/eepp/window/backend/null/joystickmanagernull.cpp index a5e64962e..0b103a251 100644 --- a/src/eepp/window/backend/null/joystickmanagernull.cpp +++ b/src/eepp/window/backend/null/joystickmanagernull.cpp @@ -11,16 +11,16 @@ JoystickManagerNull::JoystickManagerNull() : JoystickManagerNull::~JoystickManagerNull() { } -void JoystickManagerNull::Update() { +void JoystickManagerNull::update() { } -void JoystickManagerNull::Open() { +void JoystickManagerNull::open() { } -void JoystickManagerNull::Close() { +void JoystickManagerNull::close() { } -void JoystickManagerNull::Create( const Uint32& index ) { +void JoystickManagerNull::create( const Uint32& index ) { } }}}} diff --git a/src/eepp/window/backend/null/joystickmanagernull.hpp b/src/eepp/window/backend/null/joystickmanagernull.hpp index b5fdee54f..33b3ec532 100644 --- a/src/eepp/window/backend/null/joystickmanagernull.hpp +++ b/src/eepp/window/backend/null/joystickmanagernull.hpp @@ -11,13 +11,13 @@ class EE_API JoystickManagerNull : public JoystickManager { virtual ~JoystickManagerNull(); - void Update(); + void update(); - void Close(); + void close(); - void Open(); + void open(); protected: - void Create( const Uint32& index ); + void create( const Uint32& index ); }; }}}} diff --git a/src/eepp/window/backend/null/joysticknull.cpp b/src/eepp/window/backend/null/joysticknull.cpp index dc7e12560..461c55443 100644 --- a/src/eepp/window/backend/null/joysticknull.cpp +++ b/src/eepp/window/backend/null/joysticknull.cpp @@ -10,28 +10,28 @@ JoystickNull::JoystickNull( const Uint32& index ) : JoystickNull::~JoystickNull() { } -void JoystickNull::Open() { +void JoystickNull::open() { } -void JoystickNull::Close() { +void JoystickNull::close() { } -void JoystickNull::Update() { +void JoystickNull::update() { } -Uint8 JoystickNull::GetHat( const Int32& index ) { +Uint8 JoystickNull::getHat( const Int32& index ) { return 0; } -Float JoystickNull::GetAxis( const Int32& axis ) { +Float JoystickNull::getAxis( const Int32& axis ) { return 0; } -Vector2i JoystickNull::GetBallMotion( const Int32& ball ) { +Vector2i JoystickNull::getBallMotion( const Int32& ball ) { return Vector2i(); } -bool JoystickNull::Plugged() const { +bool JoystickNull::isPlugged() const { return false; } diff --git a/src/eepp/window/backend/null/joysticknull.hpp b/src/eepp/window/backend/null/joysticknull.hpp index 684b53e6b..d8c86abdc 100644 --- a/src/eepp/window/backend/null/joysticknull.hpp +++ b/src/eepp/window/backend/null/joysticknull.hpp @@ -11,19 +11,19 @@ class EE_API JoystickNull : public Joystick { virtual ~JoystickNull(); - void Close(); + void close(); - void Open(); + void open(); - void Update(); + void update(); - Uint8 GetHat( const Int32& index ); + Uint8 getHat( const Int32& index ); - Float GetAxis( const Int32& axis ); + Float getAxis( const Int32& axis ); - Vector2i GetBallMotion( const Int32& ball ); + Vector2i getBallMotion( const Int32& ball ); - bool Plugged() const; + bool isPlugged() const; protected: }; diff --git a/src/eepp/window/backend/null/windownull.cpp b/src/eepp/window/backend/null/windownull.cpp index e02d684b0..09f713837 100644 --- a/src/eepp/window/backend/null/windownull.cpp +++ b/src/eepp/window/backend/null/windownull.cpp @@ -8,85 +8,85 @@ namespace EE { namespace Window { namespace Backend { namespace Null { WindowNull::WindowNull( WindowSettings Settings, ContextSettings Context ) : Window( Settings, Context, eeNew( ClipboardNull, ( this ) ), eeNew( InputNull, ( this ) ), eeNew( CursorManagerNull, ( this ) ) ) { - Create( Settings, Context ); + create( Settings, Context ); } WindowNull::~WindowNull() { } -bool WindowNull::Create( WindowSettings Settings, ContextSettings Context ) { +bool WindowNull::create( WindowSettings Settings, ContextSettings Context ) { return false; } -void WindowNull::ToggleFullscreen() { +void WindowNull::toggleFullscreen() { } -void WindowNull::Caption( const std::string& Caption ) { +void WindowNull::caption( const std::string& Caption ) { } -std::string WindowNull::Caption() { +std::string WindowNull::caption() { return std::string(); } -bool WindowNull::Icon( const std::string& Path ) { +bool WindowNull::icon( const std::string& Path ) { return false; } -void WindowNull::Minimize() { +void WindowNull::minimize() { } -void WindowNull::Maximize() { +void WindowNull::maximize() { } -void WindowNull::Hide() { +void WindowNull::hide() { } -void WindowNull::Raise() { +void WindowNull::raise() { } -void WindowNull::Show() { +void WindowNull::show() { } -void WindowNull::Position( Int16 Left, Int16 Top ) { +void WindowNull::position( Int16 Left, Int16 Top ) { } -bool WindowNull::Active() { +bool WindowNull::active() { return true; } -bool WindowNull::Visible() { +bool WindowNull::visible() { return true; } -Vector2i WindowNull::Position() { +Vector2i WindowNull::position() { return Vector2i(); } -void WindowNull::Size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowNull::size( Uint32 Width, Uint32 Height, bool Windowed ) { } -void WindowNull::SwapBuffers() { +void WindowNull::swapBuffers() { } -std::vector WindowNull::GetDisplayModes() const { +std::vector WindowNull::getDisplayModes() const { return std::vector(); } -void WindowNull::SetGamma( Float Red, Float Green, Float Blue ) { +void WindowNull::setGamma( Float Red, Float Green, Float Blue ) { } -eeWindowContex WindowNull::GetContext() const { +eeWindowContex WindowNull::getContext() const { return 0; } -void WindowNull::GetMainContext() { +void WindowNull::getMainContext() { } -eeWindowHandle WindowNull::GetWindowHandler() { +eeWindowHandle WindowNull::getWindowHandler() { return 0; } -void WindowNull::SetDefaultContext() { +void WindowNull::setDefaultContext() { } }}}} diff --git a/src/eepp/window/backend/null/windownull.hpp b/src/eepp/window/backend/null/windownull.hpp index d529d4518..7f20862db 100644 --- a/src/eepp/window/backend/null/windownull.hpp +++ b/src/eepp/window/backend/null/windownull.hpp @@ -11,51 +11,51 @@ class EE_API WindowNull : public Window { virtual ~WindowNull(); - bool Create( WindowSettings Settings, ContextSettings Context ); + bool create( WindowSettings Settings, ContextSettings Context ); - void ToggleFullscreen(); + void toggleFullscreen(); - void Caption( const std::string& Caption ); + void caption( const std::string& caption ); - std::string Caption(); + std::string caption(); - bool Icon( const std::string& Path ); + bool icon( const std::string& Path ); - void Minimize(); + void minimize(); - void Maximize(); + void maximize(); - void Hide(); + void hide(); - void Raise(); + void raise(); - void Show(); + void show(); - void Position( Int16 Left, Int16 Top ); + void position( Int16 Left, Int16 Top ); - bool Active(); + bool active(); - bool Visible(); + bool visible(); - Vector2i Position(); + Vector2i position(); - void Size( Uint32 Width, Uint32 Height, bool Windowed ); + void size( Uint32 Width, Uint32 Height, bool isWindowed ); - std::vector GetDisplayModes() const; + std::vector getDisplayModes() const; - void SetGamma( Float Red, Float Green, Float Blue ); + void setGamma( Float Red, Float Green, Float Blue ); - eeWindowContex GetContext() const; + eeWindowContex getContext() const; - eeWindowHandle GetWindowHandler(); + eeWindowHandle getWindowHandler(); - void SetDefaultContext(); + void setDefaultContext(); protected: friend class ClipboardNull; - void SwapBuffers(); + void swapBuffers(); - void GetMainContext(); + void getMainContext(); }; }}}} diff --git a/src/eepp/window/clipboard.cpp b/src/eepp/window/clipboard.cpp index bab681e71..63e990f32 100644 --- a/src/eepp/window/clipboard.cpp +++ b/src/eepp/window/clipboard.cpp @@ -8,7 +8,7 @@ Clipboard::Clipboard( EE::Window::Window * window ) : Clipboard::~Clipboard() {} -EE::Window::Window * Clipboard::GetWindow() const { +EE::Window::Window * Clipboard::getWindow() const { return mWindow; } diff --git a/src/eepp/window/cursor.cpp b/src/eepp/window/cursor.cpp index 5dbd8c163..e6ff3cdab 100644 --- a/src/eepp/window/cursor.cpp +++ b/src/eepp/window/cursor.cpp @@ -50,19 +50,19 @@ Cursor::~Cursor() { eeSAFE_DELETE( mImage ); } -const Vector2i& Cursor::HotSpot() const { +const Vector2i& Cursor::getHotSpot() const { return mHotSpot; } -const Uint32& Cursor::Id() const { +const Uint32& Cursor::getId() const { return mId; } -const std::string& Cursor::Name() const { +const std::string& Cursor::getName() const { return mName; } -Graphics::Image * Cursor::Image() const { +Graphics::Image * Cursor::getImage() const { return mImage; } diff --git a/src/eepp/window/cursormanager.cpp b/src/eepp/window/cursormanager.cpp index 96ba799b5..1ea7ea4fb 100644 --- a/src/eepp/window/cursormanager.cpp +++ b/src/eepp/window/cursormanager.cpp @@ -10,7 +10,7 @@ CursorManager::CursorManager( EE::Window::Window * window ) : mCurSysCursor( SYS_CURSOR_NONE ), mVisible( true ) { - InitGlobalCursors(); + initGlobalCursors(); } CursorManager::~CursorManager() { @@ -20,38 +20,38 @@ CursorManager::~CursorManager() { } } -Cursor * CursorManager::Add( Cursor * cursor ) { +Cursor * CursorManager::add( Cursor * cursor ) { mCursors.insert( cursor ); return cursor; } -void CursorManager::Remove( Cursor * cursor, bool Delete ) { +void CursorManager::remove( Cursor * cursor, bool Delete ) { mCursors.erase( cursor ); if ( Delete ) eeSAFE_DELETE( cursor ); } -void CursorManager::Remove( const std::string& name, bool Delete ) { - Remove( String::hash( name ), Delete ); +void CursorManager::remove( const std::string& name, bool Delete ) { + remove( String::hash( name ), Delete ); } -void CursorManager::Remove( const Uint32& id, bool Delete ) { +void CursorManager::remove( const Uint32& id, bool Delete ) { for ( CursorsList::iterator it = mCursors.begin(); it != mCursors.end(); ++it ) { - if ( (*it)->Id() == id ) { - Remove( (*it), Delete ); + if ( (*it)->getId() == id ) { + remove( (*it), Delete ); break; } } } -Cursor * CursorManager::Get( const std::string& name ) { - return GetById( String::hash( name ) ); +Cursor * CursorManager::get( const std::string& name ) { + return getById( String::hash( name ) ); } -Cursor * CursorManager::GetById( const Uint32& id ) { +Cursor * CursorManager::getById( const Uint32& id ) { for ( CursorsList::iterator it = mCursors.begin(); it != mCursors.end(); ++it ) { - if ( (*it)->Id() == id ) { + if ( (*it)->getId() == id ) { return (*it); } } @@ -59,62 +59,62 @@ Cursor * CursorManager::GetById( const Uint32& id ) { return NULL; } -void CursorManager::Set( const std::string& name ) { - SetById( String::hash( name ) ); +void CursorManager::set( const std::string& name ) { + setById( String::hash( name ) ); } -void CursorManager::SetById( const Uint32& id ) { +void CursorManager::setById( const Uint32& id ) { for ( CursorsList::iterator it = mCursors.begin(); it != mCursors.end(); ++it ) { - if ( (*it)->Id() == id ) { - Set( *it ); + if ( (*it)->getId() == id ) { + set( *it ); break; } } } -void CursorManager::SetGlobalCursor( EE_CURSOR_TYPE cursor, Cursor * fromCursor ) { +void CursorManager::setGlobalCursor( EE_CURSOR_TYPE cursor, Cursor * fromCursor ) { if ( cursor < EE_CURSOR_COUNT ) { mGlobalCursors[ cursor ].SysCur = SYS_CURSOR_NONE; mGlobalCursors[ cursor ].Cur = fromCursor; } } -void CursorManager::SetGlobalCursor( EE_CURSOR_TYPE cursor, EE_SYSTEM_CURSOR fromCursor ) { +void CursorManager::setGlobalCursor( EE_CURSOR_TYPE cursor, EE_SYSTEM_CURSOR fromCursor ) { if ( cursor < EE_CURSOR_COUNT ) { mGlobalCursors[ cursor ].SysCur = fromCursor; mGlobalCursors[ cursor ].Cur = NULL; } } -void CursorManager::Set( EE_CURSOR_TYPE cursor ) { +void CursorManager::set( EE_CURSOR_TYPE cursor ) { if ( cursor < EE_CURSOR_COUNT ) { GlobalCursor& Cursor = mGlobalCursors[ cursor ]; if ( SYS_CURSOR_NONE != Cursor.SysCur ) { - Set( Cursor.SysCur ); + set( Cursor.SysCur ); } else if ( NULL != Cursor.Cur ) { - Set( Cursor.Cur ); + set( Cursor.Cur ); } } } -bool CursorManager::Visible() { +bool CursorManager::visible() { return mVisible; } -Cursor * CursorManager::Current() const { +Cursor * CursorManager::getCurrent() const { return mCurrent; } -EE_SYSTEM_CURSOR CursorManager::CurrentSysCursor() const { +EE_SYSTEM_CURSOR CursorManager::getCurrentSysCursor() const { return mSysCursor; } -bool CursorManager::CurrentIsSysCursor() const { +bool CursorManager::currentIsSysCursor() const { return mCurSysCursor; } -void CursorManager::InitGlobalCursors() { +void CursorManager::initGlobalCursors() { for ( int i = 0; i < EE_CURSOR_COUNT; i++ ) { mGlobalCursors[ i ].SysCur = static_cast( i ); } diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 1ed8f8900..c82400268 100755 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -79,12 +79,12 @@ Engine::~Engine() { Network::SSL::SSLSocket::end(); #endif - Destroy(); + destroy(); eeSAFE_DELETE( mBackend ); } -void Engine::Destroy() { +void Engine::destroy() { std::list::iterator it; for ( it = mWindows.begin(); it != mWindows.end(); it++ ) { @@ -94,7 +94,7 @@ void Engine::Destroy() { mWindow = NULL; } -Backend::WindowBackend * Engine::CreateSDLBackend( const WindowSettings &Settings ) { +Backend::WindowBackend * Engine::createSDLBackend( const WindowSettings &Settings ) { #if defined( EE_SDL_VERSION_1_2 ) return eeNew( Backend::SDL::WindowBackendSDL, () ); #else @@ -102,7 +102,7 @@ Backend::WindowBackend * Engine::CreateSDLBackend( const WindowSettings &Setting #endif } -Backend::WindowBackend * Engine::CreateSDL2Backend( const WindowSettings &Settings ) { +Backend::WindowBackend * Engine::createSDL2Backend( const WindowSettings &Settings ) { #if defined( EE_SDL_VERSION_2 ) return eeNew( Backend::SDL2::WindowBackendSDL2, () ); #else @@ -110,7 +110,7 @@ Backend::WindowBackend * Engine::CreateSDL2Backend( const WindowSettings &Settin #endif } -Backend::WindowBackend * Engine::CreateSFMLBackend( const WindowSettings &Settings ) { +Backend::WindowBackend * Engine::createSFMLBackend( const WindowSettings &Settings ) { #if defined( EE_BACKEND_SFML_ACTIVE ) return eeNew( Backend::SFML::WindowBackendSFML, () ); #else @@ -118,10 +118,10 @@ Backend::WindowBackend * Engine::CreateSFMLBackend( const WindowSettings &Settin #endif } -EE::Window::Window * Engine::CreateSDLWindow( const WindowSettings& Settings, const ContextSettings& Context ) { +EE::Window::Window * Engine::createSDLWindow( const WindowSettings& Settings, const ContextSettings& Context ) { #if defined( EE_SDL_VERSION_1_2 ) if ( NULL == mBackend ) { - mBackend = CreateSDLBackend( Settings ); + mBackend = createSDLBackend( Settings ); } return eeNew( Backend::SDL::WindowSDL, ( Settings, Context ) ); @@ -130,10 +130,10 @@ EE::Window::Window * Engine::CreateSDLWindow( const WindowSettings& Settings, co #endif } -EE::Window::Window * Engine::CreateSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ) { +EE::Window::Window * Engine::createSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ) { #if defined( EE_SDL_VERSION_2 ) if ( NULL == mBackend ) { - mBackend = CreateSDL2Backend( Settings ); + mBackend = createSDL2Backend( Settings ); } return eeNew( Backend::SDL2::WindowSDL, ( Settings, Context ) ); @@ -142,7 +142,7 @@ EE::Window::Window * Engine::CreateSDL2Window( const WindowSettings& Settings, c #endif } -EE::Window::Window * Engine::CreateSFMLWindow( const WindowSettings& Settings, const ContextSettings& Context ) { +EE::Window::Window * Engine::createSFMLWindow( const WindowSettings& Settings, const ContextSettings& Context ) { #if defined( EE_BACKEND_SFML_ACTIVE ) if ( NULL == mBackend ) { @@ -155,35 +155,35 @@ EE::Window::Window * Engine::CreateSFMLWindow( const WindowSettings& Settings, c #endif } -EE::Window::Window * Engine::CreateDefaultWindow( const WindowSettings& Settings, const ContextSettings& Context ) { +EE::Window::Window * Engine::createDefaultWindow( const WindowSettings& Settings, const ContextSettings& Context ) { #if DEFAULT_BACKEND == BACKEND_SDL - return CreateSDLWindow( Settings, Context ); + return createSDLWindow( Settings, Context ); #elif DEFAULT_BACKEND == BACKEND_SDL2 - return CreateSDL2Window( Settings, Context ); + return createSDL2Window( Settings, Context ); #elif DEFAULT_BACKEND == BACKEND_SFML return CreateSFMLWindow( Settings, Context ); #endif } -EE::Window::Window * Engine::CreateWindow( WindowSettings Settings, ContextSettings Context ) { +EE::Window::Window * Engine::createWindow( WindowSettings Settings, ContextSettings Context ) { EE::Window::Window * window = NULL; if ( NULL != mWindow ) { - Settings.Backend = mWindow->GetWindowInfo()->WindowConfig.Backend; + Settings.Backend = mWindow->getWindowInfo()->WindowConfig.Backend; } else { mMainThreadId = Thread::getCurrentThreadId(); } switch ( Settings.Backend ) { - case WindowBackend::SDL: window = CreateSDLWindow( Settings, Context ); break; - case WindowBackend::SDL2: window = CreateSDL2Window( Settings, Context ); break; - case WindowBackend::SFML: window = CreateSFMLWindow( Settings, Context ); break; + case WindowBackend::SDL: window = createSDLWindow( Settings, Context ); break; + case WindowBackend::SDL2: window = createSDL2Window( Settings, Context ); break; + case WindowBackend::SFML: window = createSFMLWindow( Settings, Context ); break; case WindowBackend::Default: - default: window = CreateDefaultWindow( Settings, Context ); break; + default: window = createDefaultWindow( Settings, Context ); break; } if ( NULL == window ) { - window = CreateDefaultWindow( Settings, Context ); + window = createDefaultWindow( Settings, Context ); } if ( NULL == mWindow ) { @@ -195,7 +195,7 @@ EE::Window::Window * Engine::CreateWindow( WindowSettings Settings, ContextSetti return window; } -void Engine::DestroyWindow( EE::Window::Window * window ) { +void Engine::destroyWindow( EE::Window::Window * window ) { mWindows.remove( window ); if ( window == mWindow ) { @@ -209,7 +209,7 @@ void Engine::DestroyWindow( EE::Window::Window * window ) { eeSAFE_DELETE( window ); } -bool Engine::ExistsWindow( EE::Window::Window * window ) { +bool Engine::existsWindow( EE::Window::Window * window ) { std::list::iterator it; for ( it = mWindows.begin(); it != mWindows.end(); it++ ) { @@ -220,45 +220,45 @@ bool Engine::ExistsWindow( EE::Window::Window * window ) { return false; } -EE::Window::Window * Engine::GetCurrentWindow() const { +EE::Window::Window * Engine::getCurrentWindow() const { return mWindow; } -void Engine::SetCurrentWindow( EE::Window::Window * window ) { +void Engine::setCurrentWindow( EE::Window::Window * window ) { if ( NULL != window && window != mWindow ) { mWindow = window; - mWindow->SetCurrent(); + mWindow->setCurrent(); } } -Uint32 Engine::GetWindowCount() const { +Uint32 Engine::getWindowCount() const { return mWindows.size(); } -bool Engine::Running() const { +bool Engine::isRunning() const { return NULL != mWindow; } -Time Engine::Elapsed() const { - eeASSERT( Running() ); +Time Engine::elapsed() const { + eeASSERT( isRunning() ); - return mWindow->Elapsed(); + return mWindow->elapsed(); } -const Uint32& Engine::GetWidth() const { - eeASSERT( Running() ); +const Uint32& Engine::getWidth() const { + eeASSERT( isRunning() ); - return mWindow->GetWidth(); + return mWindow->getWidth(); } -const Uint32& Engine::GetHeight() const { - eeASSERT( Running() ); +const Uint32& Engine::getHeight() const { + eeASSERT( isRunning() ); - return mWindow->GetHeight(); + return mWindow->getHeight(); } -Uint32 Engine::GetDefaultBackend() const { +Uint32 Engine::getDefaultBackend() const { #if DEFAULT_BACKEND == BACKEND_SDL return WindowBackend::SDL; #elif DEFAULT_BACKEND == BACKEND_SDL2 @@ -268,7 +268,7 @@ Uint32 Engine::GetDefaultBackend() const { #endif } -WindowSettings Engine::CreateWindowSettings( IniFile * ini, std::string iniKeyName ) { +WindowSettings Engine::createWindowSettings( IniFile * ini, std::string iniKeyName ) { eeASSERT ( NULL != ini ); ini->readFile(); @@ -280,7 +280,7 @@ WindowSettings Engine::CreateWindowSettings( IniFile * ini, std::string iniKeyNa bool Resizeable = ini->getValueB( iniKeyName, "Resizeable", true ); std::string Backend = ini->getValue( iniKeyName, "Backend", "" ); - Uint32 WinBackend = GetDefaultBackend(); + Uint32 WinBackend = getDefaultBackend(); String::toLowerInPlace( Backend ); @@ -311,13 +311,13 @@ WindowSettings Engine::CreateWindowSettings( IniFile * ini, std::string iniKeyNa return WinSettings; } -WindowSettings Engine::CreateWindowSettings( std::string iniPath, std::string iniKeyName ) { +WindowSettings Engine::createWindowSettings( std::string iniPath, std::string iniKeyName ) { IniFile Ini( iniPath ); - return CreateWindowSettings( &Ini, iniKeyName ); + return createWindowSettings( &Ini, iniKeyName ); } -ContextSettings Engine::CreateContextSettings( IniFile * ini, std::string iniKeyName ) { +ContextSettings Engine::createContextSettings( IniFile * ini, std::string iniKeyName ) { eeASSERT ( NULL != ini ); ini->readFile(); @@ -345,25 +345,25 @@ ContextSettings Engine::CreateContextSettings( IniFile * ini, std::string iniKey return ContextSettings( VSync, GLVer, doubleBuffering, depthBufferSize, stencilBufferSize ); } -ContextSettings Engine::CreateContextSettings( std::string iniPath, std::string iniKeyName ) { +ContextSettings Engine::createContextSettings( std::string iniPath, std::string iniKeyName ) { IniFile Ini( iniPath ); - return CreateContextSettings( &Ini ); + return createContextSettings( &Ini ); } -void Engine::EnableSharedGLContext() { +void Engine::enableSharedGLContext() { mSharedGLContext = true; } -void Engine::DisableSharedGLContext() { +void Engine::disableSharedGLContext() { mSharedGLContext = false; } -bool Engine::IsSharedGLContextEnabled() { +bool Engine::isSharedGLContextEnabled() { return mSharedGLContext; } -Uint32 Engine::GetMainThreadId() { +Uint32 Engine::getMainThreadId() { return mMainThreadId; } diff --git a/src/eepp/window/input.cpp b/src/eepp/window/input.cpp index f7033f694..d3d569ebe 100644 --- a/src/eepp/window/input.cpp +++ b/src/eepp/window/input.cpp @@ -22,7 +22,7 @@ Input::~Input() { eeSAFE_DELETE( mJoystickManager ); } -void Input::CleanStates() { +void Input::cleanStates() { memset( mKeysUp, 0, EE_KEYS_SPACE ); mReleaseTrigger = 0; @@ -30,16 +30,16 @@ void Input::CleanStates() { mClickTrigger = 0; mDoubleClickTrigger = 0; - ResetFingerWasDown(); + resetFingerWasDown(); } -void Input::SendEvent( InputEvent * Event ) { +void Input::sendEvent( InputEvent * Event ) { for ( std::map::iterator i = mCallbacks.begin(); i != mCallbacks.end(); i++ ) { i->second( Event ); } } -void Input::ProcessEvent( InputEvent * Event ) { +void Input::processEvent( InputEvent * Event ) { switch( Event->Type ) { case InputEvent::KeyDown: { @@ -71,14 +71,14 @@ void Input::ProcessEvent( InputEvent * Event ) { mMousePos.y += static_cast( (Float)Event->motion.yrel * mMouseSpeed ); } - if ( mMousePos.x >= (int)mWindow->GetWidth() ) { - mMousePos.x = mWindow->GetWidth(); + if ( mMousePos.x >= (int)mWindow->getWidth() ) { + mMousePos.x = mWindow->getWidth(); } else if ( mMousePos.x < 0 ) { mMousePos.x = 0; } - if ( mMousePos.y >= (int)mWindow->GetHeight() ) { - mMousePos.y = mWindow->GetHeight(); + if ( mMousePos.y >= (int)mWindow->getHeight() ) { + mMousePos.y = mWindow->getHeight(); } else if ( mMousePos.y < 0 ) { mMousePos.y = 0; } @@ -136,11 +136,11 @@ void Input::ProcessEvent( InputEvent * Event ) { } case InputEvent::FingerDown: { - InputFinger * Finger = GetFingerId( Event->finger.fingerId ); + InputFinger * Finger = getFingerId( Event->finger.fingerId ); - Finger->WriteLast(); - Finger->x = (Uint16)( Event->finger.x * (Float)mWindow->GetWidth() ); - Finger->y = (Uint16)( Event->finger.y * (Float)mWindow->GetHeight() ); + Finger->writeLast(); + Finger->x = (Uint16)( Event->finger.x * (Float)mWindow->getWidth() ); + Finger->y = (Uint16)( Event->finger.y * (Float)mWindow->getHeight() ); Finger->pressure = Event->finger.pressure; Finger->down = true; Finger->xdelta = Event->finger.dx; @@ -150,11 +150,11 @@ void Input::ProcessEvent( InputEvent * Event ) { } case InputEvent::FingerUp: { - InputFinger * Finger = GetFingerId( Event->finger.fingerId ); + InputFinger * Finger = getFingerId( Event->finger.fingerId ); - Finger->WriteLast(); - Finger->x = (Uint16)( Event->finger.x * (Float)mWindow->GetWidth() ); - Finger->y = (Uint16)( Event->finger.y * (Float)mWindow->GetHeight() ); + Finger->writeLast(); + Finger->x = (Uint16)( Event->finger.x * (Float)mWindow->getWidth() ); + Finger->y = (Uint16)( Event->finger.y * (Float)mWindow->getHeight() ); Finger->pressure = Event->finger.pressure; Finger->down = false; Finger->was_down = true; @@ -165,11 +165,11 @@ void Input::ProcessEvent( InputEvent * Event ) { } case InputEvent::FingerMotion: { - InputFinger * Finger = GetFingerId( Event->finger.fingerId ); + InputFinger * Finger = getFingerId( Event->finger.fingerId ); - Finger->WriteLast(); - Finger->x = (Uint16)( Event->finger.x * (Float)mWindow->GetWidth() ); - Finger->y = (Uint16)( Event->finger.y * (Float)mWindow->GetHeight() ); + Finger->writeLast(); + Finger->x = (Uint16)( Event->finger.x * (Float)mWindow->getWidth() ); + Finger->y = (Uint16)( Event->finger.y * (Float)mWindow->getHeight() ); Finger->pressure = Event->finger.pressure; Finger->down = true; Finger->xdelta = Event->finger.dx; @@ -179,20 +179,20 @@ void Input::ProcessEvent( InputEvent * Event ) { } case InputEvent::VideoResize: { - mWindow->Size( Event->resize.w, Event->resize.h, mWindow->Windowed() ); + mWindow->size( Event->resize.w, Event->resize.h, mWindow->isWindowed() ); break; } case InputEvent::Quit: { - mWindow->Close(); + mWindow->close(); break; } } - SendEvent( Event ); + sendEvent( Event ); } -InputFinger * Input::GetFingerId( const Int64 &fingerId ) { +InputFinger * Input::getFingerId( const Int64 &fingerId ) { Uint32 i; for ( i = 0; i < EE_MAX_FINGERS; i++ ) { @@ -220,35 +220,35 @@ InputFinger * Input::GetFingerId( const Int64 &fingerId ) { return NULL; } -void Input::ResetFingerWasDown() { +void Input::resetFingerWasDown() { for ( Uint32 i = 0; i < EE_MAX_FINGERS; i++ ) { mFingers[i].was_down = false; } } -bool Input::IsKeyDown( const EE_KEY& Key ) { +bool Input::isKeyDown( const EE_KEY& Key ) { return 0 != BitOp::readBitKey( &mKeysDown[ Key / 8 ], Key % 8 ); } -bool Input::IsKeyUp( const EE_KEY& Key ) { +bool Input::isKeyUp( const EE_KEY& Key ) { return 0 != BitOp::readBitKey( &mKeysUp[ Key / 8 ], Key % 8 ); } -void Input::InjectKeyDown( const EE_KEY& Key ) { +void Input::injectKeyDown( const EE_KEY& Key ) { BitOp::writeBitKey( &mKeysDown [ Key / 8 ], Key % 8, 1 ); } -void Input::InjectKeyUp( const EE_KEY& Key ) { +void Input::injectKeyUp( const EE_KEY& Key ) { BitOp::writeBitKey( &mKeysUp [ Key / 8 ], Key % 8, 1 ); } -void Input::InjectButtonPress( const Uint32& Button ) { +void Input::injectButtonPress( const Uint32& Button ) { if ( Button < 8 ) if ( !( mPressTrigger & EE_BUTTON_MASK( Button ) ) ) mPressTrigger |= EE_BUTTON_MASK( Button ); } -void Input::InjectButtonRelease( const Uint32& Button ) { +void Input::injectButtonRelease( const Uint32& Button ) { if ( Button < 8 ) { if ( mPressTrigger & EE_BUTTON_MASK( Button ) ) mPressTrigger &= ~EE_BUTTON_MASK( Button ); @@ -261,157 +261,157 @@ void Input::InjectButtonRelease( const Uint32& Button ) { } } -Vector2i Input::GetMousePos() const { +Vector2i Input::getMousePos() const { return mMousePos; } -void Input::SetMousePos( const Vector2i& Pos ) { +void Input::setMousePos( const Vector2i& Pos ) { mMousePos = Pos; } -Vector2f Input::GetMousePosf() { +Vector2f Input::getMousePosf() { return Vector2f( (Float)mMousePos.x, (Float)mMousePos.y ); } -Vector2i Input::GetMousePosFromView( const View& View ) { - Vector2i RealMousePos = GetMousePos(); - Recti RView = View.GetView(); +Vector2i Input::getMousePosFromView( const View& View ) { + Vector2i RealMousePos = getMousePos(); + Recti RView = View.getView(); return Vector2i( RealMousePos.x - RView.Left, RealMousePos.y - RView.Top ); } -Uint16 Input::MouseX() const { +Uint16 Input::mouseX() const { return mMousePos.x; } -Uint16 Input::MouseY() const { +Uint16 Input::mouseY() const { return mMousePos.y; } -Uint32 Input::PushCallback( const InputCallback& cb ) { +Uint32 Input::pushCallback( const InputCallback& cb ) { mNumCallBacks++; mCallbacks[ mNumCallBacks ] = cb; return mNumCallBacks; } -void Input::PopCallback( const Uint32& CallbackId ) { +void Input::popCallback( const Uint32& CallbackId ) { mCallbacks[ CallbackId ] = 0; mCallbacks.erase( mCallbacks.find(CallbackId) ); } -void Input::InjectMousePos( const Vector2i& Pos ) { - InjectMousePos( Pos.x, Pos.y ); +void Input::injectMousePos( const Vector2i& Pos ) { + injectMousePos( Pos.x, Pos.y ); } -bool Input::ControlPressed() const { +bool Input::controlPressed() const { return ( mInputMod & KEYMOD_CTRL ) != 0; } -bool Input::ShiftPressed() const { +bool Input::shiftPressed() const { return ( mInputMod & KEYMOD_SHIFT ) != 0; } -bool Input::AltPressed() const { +bool Input::altPressed() const { return ( mInputMod & KEYMOD_ALT ) != 0; } -bool Input::MetaPressed() const { +bool Input::metaPressed() const { return ( mInputMod & KEYMOD_META ) != 0; } -bool Input::MouseLeftPressed() const { +bool Input::mouseLeftPressed() const { return ( mPressTrigger & EE_BUTTON_LMASK ) != 0; } -bool Input::MouseRightPressed() const { +bool Input::mouseRightPressed() const { return ( mPressTrigger & EE_BUTTON_RMASK ) != 0; } -bool Input::MouseMiddlePressed() const { +bool Input::mouseMiddlePressed() const { return ( mPressTrigger & EE_BUTTON_MMASK ) != 0; } -bool Input::MouseLeftClick() const { +bool Input::mouseLeftClick() const { return ( mClickTrigger & EE_BUTTON_LMASK ) != 0; } -bool Input::MouseRightClick() const { +bool Input::mouseRightClick() const { return ( mClickTrigger & EE_BUTTON_RMASK ) != 0; } -bool Input::MouseMiddleClick() const { +bool Input::mouseMiddleClick() const { return ( mClickTrigger & EE_BUTTON_MMASK ) != 0; } -bool Input::MouseLeftDoubleClick() const { +bool Input::mouseLeftDoubleClick() const { return ( mDoubleClickTrigger & EE_BUTTON_LMASK ) != 0; } -bool Input::MouseRightDoubleClick() const { +bool Input::mouseRightDoubleClick() const { return ( mDoubleClickTrigger & EE_BUTTON_RMASK ) != 0; } -bool Input::MouseMiddleDoubleClick() const { +bool Input::mouseMiddleDoubleClick() const { return ( mDoubleClickTrigger & EE_BUTTON_MMASK ) != 0; } -bool Input::MouseWheelUp() const { +bool Input::mouseWheelUp() const { return ( mReleaseTrigger & EE_BUTTON_WUMASK ) != 0; } -bool Input::MouseWheelDown() const { +bool Input::mouseWheelDown() const { return ( mReleaseTrigger & EE_BUTTON_WDMASK ) != 0; } -void Input::MouseSpeed( const Float& Speed ) { +void Input::mouseSpeed( const Float& Speed ) { mMouseSpeed = Speed; } -const Float& Input::MouseSpeed() const { +const Float& Input::mouseSpeed() const { return mMouseSpeed; } -const Uint32& Input::LastPressTrigger() const { +const Uint32& Input::lastPressTrigger() const { return mLastPressTrigger; } -const Uint32& Input::PressTrigger() const { +const Uint32& Input::pressTrigger() const { return mPressTrigger; } -const Uint32& Input::ReleaseTrigger() const { +const Uint32& Input::releaseTrigger() const { return mReleaseTrigger; } -const Uint32& Input::ClickTrigger() const { +const Uint32& Input::clickTrigger() const { return mClickTrigger; } -const Uint32& Input::DoubleClickTrigger() const { +const Uint32& Input::doubleClickTrigger() const { return mDoubleClickTrigger; } -const Uint32& Input::DoubleClickInterval() const { +const Uint32& Input::doubleClickInterval() const { return mDoubleClickInterval; } -void Input::DoubleClickInterval( const Uint32& Interval ) { +void Input::doubleClickInterval( const Uint32& Interval ) { mDoubleClickInterval = Interval; } -JoystickManager * Input::GetJoystickManager() const { +JoystickManager * Input::getJoystickManager() const { return mJoystickManager; } -Uint32 Input::GetFingerCount() { +Uint32 Input::getFingerCount() { return EE_MAX_FINGERS; } -InputFinger * Input::GetFingerIndex( const Uint32 &Index ) { +InputFinger * Input::getFingerIndex( const Uint32 &Index ) { eeASSERT( Index < EE_MAX_FINGERS ); return &mFingers[Index]; } -InputFinger * Input::GetFinger( const Int64 &fingerId ) { +InputFinger * Input::getFinger( const Int64 &fingerId ) { for ( Uint32 i = 0; i < EE_MAX_FINGERS; i++ ) { if ( mFingers[i].id == fingerId ) { return &mFingers[i]; @@ -421,7 +421,7 @@ InputFinger * Input::GetFinger( const Int64 &fingerId ) { return NULL; } -std::list Input::GetFingersDown() { +std::list Input::getFingersDown() { std::list fDown; for ( Uint32 i = 0; i < EE_MAX_FINGERS; i++ ) { @@ -433,7 +433,7 @@ std::list Input::GetFingersDown() { return fDown; } -std::list Input::GetFingersWasDown() { +std::list Input::getFingersWasDown() { std::list fDown; for ( Uint32 i = 0; i < EE_MAX_FINGERS; i++ ) { diff --git a/src/eepp/window/inputfinger.cpp b/src/eepp/window/inputfinger.cpp index 20cfac4bc..4c0b23ab1 100644 --- a/src/eepp/window/inputfinger.cpp +++ b/src/eepp/window/inputfinger.cpp @@ -17,19 +17,19 @@ InputFinger::InputFinger() : { } -bool InputFinger::IsDown() { +bool InputFinger::isDown() { return down; } -bool InputFinger::WasDown() { +bool InputFinger::wasDown() { return was_down; } -Vector2i InputFinger::Pos() { +Vector2i InputFinger::pos() { return Vector2i( x, y ); } -void InputFinger::WriteLast() { +void InputFinger::writeLast() { last_x = x; last_y = y; last_pressure = pressure; diff --git a/src/eepp/window/inputtextbuffer.cpp b/src/eepp/window/inputtextbuffer.cpp index f2c34926f..418a54367 100755 --- a/src/eepp/window/inputtextbuffer.cpp +++ b/src/eepp/window/inputtextbuffer.cpp @@ -14,18 +14,18 @@ InputTextBuffer::InputTextBuffer( const bool& active, const bool& supportNewLine mSelCurEnd(-1) { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } - Active( active ); + this->active( active ); - SupportFreeEditing( supportFreeEditing ); + this->supportFreeEditing( supportFreeEditing ); - SupportNewLine( supportNewLine ); + this->supportNewLine( supportNewLine ); - AutoPrompt( true ); + autoPrompt( true ); - SupportCopyPaste( true ); + supportCopyPaste( true ); mMaxLength = maxLength; } @@ -40,44 +40,44 @@ InputTextBuffer::InputTextBuffer( EE::Window::Window * window ) : mSelCurEnd(-1) { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } - Active( true ); + active( true ); - SupportFreeEditing( true ); + supportFreeEditing( true ); - SupportNewLine( false ); + supportNewLine( false ); - AutoPrompt( true ); + autoPrompt( true ); - TextSelectionEnabled( false ); + textSelectionEnabled( false ); - SupportCopyPaste( true ); + supportCopyPaste( true ); } InputTextBuffer::~InputTextBuffer() { if ( 0 != mCallback && Engine::existsSingleton() && - Engine::instance()->ExistsWindow( mWindow ) ) + Engine::instance()->existsWindow( mWindow ) ) { - mWindow->GetInput()->PopCallback( mCallback ); + mWindow->getInput()->popCallback( mCallback ); } mText.clear(); } -void InputTextBuffer::Start() { +void InputTextBuffer::start() { if ( NULL == mWindow ) { - mWindow = Engine::instance()->GetCurrentWindow(); + mWindow = Engine::instance()->getCurrentWindow(); } - if ( Engine::instance()->ExistsWindow( mWindow ) ) { - mCallback = mWindow->GetInput()->PushCallback( cb::Make1( this, &InputTextBuffer::Update ) ); + if ( Engine::instance()->existsWindow( mWindow ) ) { + mCallback = mWindow->getInput()->pushCallback( cb::Make1( this, &InputTextBuffer::update ) ); } } -void InputTextBuffer::PromptToLeftFirstNoChar() { +void InputTextBuffer::promptToLeftFirstNoChar() { if ( !mText.size() ) return; @@ -95,10 +95,10 @@ void InputTextBuffer::PromptToLeftFirstNoChar() { mPromptPos = 0; } - ResetSelection(); + resetSelection(); } -void InputTextBuffer::PromptToRightFirstNoChar() { +void InputTextBuffer::promptToRightFirstNoChar() { Int32 s = static_cast ( mText.size() ); if ( 0 == s ) @@ -113,17 +113,17 @@ void InputTextBuffer::PromptToRightFirstNoChar() { } } - ResetSelection(); + resetSelection(); } -void InputTextBuffer::ResetSelection() { - if ( TextSelectionEnabled() ) { - SelCurInit( -1 ); - SelCurEnd( -1 ); +void InputTextBuffer::resetSelection() { + if ( textSelectionEnabled() ) { + selCurInit( -1 ); + selCurEnd( -1 ); } } -void InputTextBuffer::EraseToPrevNoChar() { +void InputTextBuffer::eraseToPrevNoChar() { if ( !mText.size() || !mPromptPos ) return; @@ -146,12 +146,12 @@ void InputTextBuffer::EraseToPrevNoChar() { c = mText[ mPromptPos - 1 ]; } while ( String::isLetter( c ) || String::isNumber( c ) ); - ResetSelection(); + resetSelection(); - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); } -void InputTextBuffer::EraseToNextNoChar() { +void InputTextBuffer::eraseToNextNoChar() { if ( !mText.size() ) return; @@ -173,13 +173,13 @@ void InputTextBuffer::EraseToNextNoChar() { String iniStr( mText.substr( 0, mPromptPos ) ); String endStr( mText.substr( tPromptPos ) ); - Buffer( iniStr + endStr ); + buffer( iniStr + endStr ); - ResetSelection(); + resetSelection(); } } -bool InputTextBuffer::IsIgnoredChar( const Uint32& c ) { +bool InputTextBuffer::isIgnoredChar( const Uint32& c ) { if ( mIgnoredChars.size() ) { for ( std::size_t i = 0; i < mIgnoredChars.size(); i++ ) { if ( mIgnoredChars[i] == c ) @@ -190,15 +190,15 @@ bool InputTextBuffer::IsIgnoredChar( const Uint32& c ) { return false; } -bool InputTextBuffer::ValidChar( const Uint32& c ) { - if ( CanAdd() && String::isCharacter( c ) ) { +bool InputTextBuffer::validChar( const Uint32& c ) { + if ( canAdd() && String::isCharacter( c ) ) { bool Ignored = false; - if ( AllowOnlyNumbers() && !String::isNumber( c, AllowDotsInNumbers() ) ) { + if ( allowOnlyNumbers() && !String::isNumber( c, allowDotsInNumbers() ) ) { Ignored = true; } - if ( IsIgnoredChar( c ) ) { + if ( isIgnoredChar( c ) ) { Ignored = true; } @@ -210,14 +210,14 @@ bool InputTextBuffer::ValidChar( const Uint32& c ) { return false; } -void InputTextBuffer::TryAddChar( const Uint32& c ) { - if ( SupportFreeEditing() ) { - if ( ValidChar( c ) ) { - RemoveSelection(); +void InputTextBuffer::tryAddChar( const Uint32& c ) { + if ( supportFreeEditing() ) { + if ( validChar( c ) ) { + removeSelection(); - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); - if ( AutoPrompt() ) { + if ( autoPrompt() ) { mText += c; mPromptPos = (int)mText.size(); } else { @@ -226,11 +226,11 @@ void InputTextBuffer::TryAddChar( const Uint32& c ) { } } } else { - if ( CanAdd() && String::isCharacter(c) ) { - Input * Input = mWindow->GetInput(); + if ( canAdd() && String::isCharacter(c) ) { + Input * Input = mWindow->getInput(); - if ( !Input->MetaPressed() && !Input->AltPressed() && !Input->ControlPressed() ) { - if ( !( AllowOnlyNumbers() && !String::isNumber( c, AllowDotsInNumbers() ) ) ) { + if ( !Input->metaPressed() && !Input->altPressed() && !Input->controlPressed() ) { + if ( !( allowOnlyNumbers() && !String::isNumber( c, allowDotsInNumbers() ) ) ) { mText += c; } } @@ -238,8 +238,8 @@ void InputTextBuffer::TryAddChar( const Uint32& c ) { } } -void InputTextBuffer::RemoveSelection() { - if ( TextSelectionEnabled() && -1 != mSelCurInit && -1 != mSelCurEnd ) { +void InputTextBuffer::removeSelection() { + if ( textSelectionEnabled() && -1 != mSelCurInit && -1 != mSelCurEnd ) { Int32 size = (Int32)mText.size(); if ( mSelCurInit <= size && mSelCurInit <= size ) { @@ -248,44 +248,44 @@ void InputTextBuffer::RemoveSelection() { String iniStr( mText.substr( 0, init ) ); String endStr( mText.substr( end ) ); - Buffer( iniStr + endStr ); + buffer( iniStr + endStr ); - CurPos( init ); + curPos( init ); - ResetSelection(); + resetSelection(); } else { - ResetSelection(); + resetSelection(); } } } -void InputTextBuffer::Update( InputEvent* Event ) { - if ( Active() ) { - Input * Input = mWindow->GetInput(); +void InputTextBuffer::update( InputEvent* Event ) { + if ( active() ) { + Input * Input = mWindow->getInput(); Uint32 c = eeConvertKeyCharacter( Event->key.keysym.sym, Event->key.keysym.unicode, Event->key.keysym.mod ); - if ( SupportFreeEditing() ) { + if ( supportFreeEditing() ) { switch ( Event->Type ) { case InputEvent::TextInput: { - TryAddChar( Event->text.text ); + tryAddChar( Event->text.text ); break; } case InputEvent::KeyDown: { - if ( TextSelectionEnabled() ) { + if ( textSelectionEnabled() ) { if ( mSelCurInit >= 0 && mSelCurInit != mSelCurEnd ) { if ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && ( Event->key.keysym.sym == KEY_C || Event->key.keysym.sym == KEY_X ) ) { Int32 init = eemin( mSelCurInit, mSelCurEnd ); Int32 end = eemax( mSelCurInit, mSelCurEnd ); std::string clipStr( mText.substr( init, end - init ).toUtf8() ); - mWindow->GetClipboard()->SetText( clipStr ); + mWindow->getClipboard()->setText( clipStr ); } else if ( ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) && !( Event->key.keysym.sym >= KEY_NUMLOCK && Event->key.keysym.sym <= KEY_COMPOSE ) ) { - if ( ! ( Input->ShiftPressed() && ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) ) ) { - ResetSelection(); + if ( ! ( Input->shiftPressed() && ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) ) ) { + resetSelection(); } } @@ -293,26 +293,26 @@ void InputTextBuffer::Update( InputEvent* Event ) { ( Event->key.keysym.sym == KEY_X || Event->key.keysym.sym == KEY_V ) ) || Event->key.keysym.sym == KEY_DELETE ) { - RemoveSelection(); + removeSelection(); } } if ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && Event->key.keysym.sym == KEY_A ) { - SelCurInit( 0 ); - SelCurEnd( mText.size() ); - CurPos( mSelCurEnd ); + selCurInit( 0 ); + selCurEnd( mText.size() ); + curPos( mSelCurEnd ); } } - if ( Input->ShiftPressed() || Input->ControlPressed() ) { - if ( !AllowOnlyNumbers() && + if ( Input->shiftPressed() || Input->controlPressed() ) { + if ( !allowOnlyNumbers() && ( ( ( Event->key.keysym.mod & KEYMOD_SHIFT ) && c == KEY_INSERT ) || ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && Event->key.keysym.sym == KEY_V ) ) ) { - String txt = mWindow->GetClipboard()->GetWideText(); + String txt = mWindow->getClipboard()->getWideText(); - if ( !SupportNewLine() ) { + if ( !supportNewLine() ) { size_t pos = txt.find_first_of( '\n' ); if ( pos != std::string::npos ) @@ -320,10 +320,10 @@ void InputTextBuffer::Update( InputEvent* Event ) { } if ( txt.size() ) { - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); if ( mText.size() + txt.size() < mMaxLength ) { - if ( AutoPrompt() ) { + if ( autoPrompt() ) { mText += txt; mPromptPos = (int)mText.size(); } else { @@ -331,23 +331,23 @@ void InputTextBuffer::Update( InputEvent* Event ) { mPromptPos += txt.size(); } - AutoPrompt( false ); + autoPrompt( false ); } } } - if ( Input->ControlPressed() ) { + if ( Input->controlPressed() ) { if ( c == KEY_LEFT ) { - PromptToLeftFirstNoChar(); + promptToLeftFirstNoChar(); break; } else if ( c == KEY_RIGHT ) { - PromptToRightFirstNoChar(); + promptToRightFirstNoChar(); break; } else if ( c == KEY_BACKSPACE ) { - EraseToPrevNoChar(); + eraseToPrevNoChar(); break; } else if ( c == KEY_DELETE ) { - EraseToNextNoChar(); + eraseToNextNoChar(); break; } } @@ -355,7 +355,7 @@ void InputTextBuffer::Update( InputEvent* Event ) { if ( ( c == KEY_BACKSPACE || c == KEY_DELETE ) ) { if ( mText.size() ) { - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); if ( mPromptPos < (int)mText.size() ) { if ( c == KEY_BACKSPACE ) { @@ -368,20 +368,20 @@ void InputTextBuffer::Update( InputEvent* Event ) { } } else if ( c == KEY_BACKSPACE ) { mText.resize( mText.size() - 1 ); - AutoPrompt( true ); + autoPrompt( true ); } - ResetSelection(); + resetSelection(); } } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) ) { - if ( SupportNewLine() && CanAdd() ) { + if ( supportNewLine() && canAdd() ) { String::insertChar( mText, mPromptPos, '\n' ); mPromptPos++; - ResetSelection(); + resetSelection(); - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); } if ( mEnterCall.IsSet() ) @@ -390,51 +390,51 @@ void InputTextBuffer::Update( InputEvent* Event ) { } else if ( c == KEY_LEFT ) { if ( ( mPromptPos - 1 ) >= 0 ) { mPromptPos--; - AutoPrompt( false ); - ShiftSelection( mPromptPos + 1 ); + autoPrompt( false ); + shiftSelection( mPromptPos + 1 ); } } else if ( c == KEY_RIGHT ) { if ( ( mPromptPos + 1 ) < (int)mText.size() ) { mPromptPos++; - AutoPrompt(false); - ShiftSelection( mPromptPos - 1 ); + autoPrompt(false); + shiftSelection( mPromptPos - 1 ); } else if ( ( mPromptPos + 1 ) == (int)mText.size() ) { - AutoPrompt( true ); + autoPrompt( true ); } } else if ( c == KEY_UP ) { - MovePromptRowUp( false ); + movePromptRowUp( false ); } else if ( c == KEY_DOWN ) { - MovePromptRowDown( true ); + movePromptRowDown( true ); } else if ( c == KEY_PAGEUP ) { - MovePromptRowUp( true ); + movePromptRowUp( true ); } else if ( c == KEY_PAGEDOWN ) { - MovePromptRowDown( false ); + movePromptRowDown( false ); } else if ( c == KEY_TAB ) { - TryAddChar( c ); + tryAddChar( c ); } break; } case InputEvent::KeyUp: { - if ( SupportNewLine() ) { + if ( supportNewLine() ) { int lPromtpPos = mPromptPos; if ( c == KEY_END ) { for ( Uint32 i = mPromptPos; i < mText.size(); i++ ) { if ( mText[i] == '\n' ) { mPromptPos = i; - AutoPrompt( false ); + autoPrompt( false ); break; } if ( i == ( mText.size() - 1 ) ) { mPromptPos = mText.size(); - AutoPrompt( false ); + autoPrompt( false ); } } - ShiftSelection( lPromtpPos ); + shiftSelection( lPromtpPos ); } if ( c == KEY_HOME ) { @@ -443,34 +443,34 @@ void InputTextBuffer::Update( InputEvent* Event ) { if ( i >= 0 ) { if ( mText[i] == '\n' ) { mPromptPos = i + 1; - AutoPrompt( false ); + autoPrompt( false ); break; } if ( i == 0 ) { mPromptPos = 0; - AutoPrompt( false ); + autoPrompt( false ); } } } } - ShiftSelection( lPromtpPos ); + shiftSelection( lPromtpPos ); } } else { int lPromtpPos = mPromptPos; if ( c == KEY_END ) { - AutoPrompt( true ); + autoPrompt( true ); - ShiftSelection( lPromtpPos ); + shiftSelection( lPromtpPos ); } if ( c == KEY_HOME ) { mPromptPos = 0; - AutoPrompt(false); + autoPrompt(false); - ShiftSelection( lPromtpPos ); + shiftSelection( lPromtpPos ); } } break; @@ -478,14 +478,14 @@ void InputTextBuffer::Update( InputEvent* Event ) { } } else { if ( Event->Type == InputEvent::TextInput ) { - TryAddChar( Event->text.text ); + tryAddChar( Event->text.text ); } else if ( Event->Type == InputEvent::KeyDown ) { - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); if ( c == KEY_BACKSPACE && mText.size() > 0 ) { mText.resize( mText.size() - 1 ); - } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) && !Input->MetaPressed() && !Input->AltPressed() && !Input->ControlPressed() ) { - if ( SupportNewLine() && CanAdd() ) + } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) && !Input->metaPressed() && !Input->altPressed() && !Input->controlPressed() ) { + if ( supportNewLine() && canAdd() ) mText += '\n'; if ( mEnterCall.IsSet() ) @@ -496,40 +496,40 @@ void InputTextBuffer::Update( InputEvent* Event ) { } } -void InputTextBuffer::ShiftSelection( const int& lastPromtpPos ) { - if ( !TextSelectionEnabled() ) +void InputTextBuffer::shiftSelection( const int& lastPromtpPos ) { + if ( !textSelectionEnabled() ) return; - Input * Input = mWindow->GetInput(); + Input * Input = mWindow->getInput(); - if ( Input->ShiftPressed() && !Input->ControlPressed() ) { - if ( SelCurInit() != CurPos() ) { - SelCurEnd( CurPos() ); + if ( Input->shiftPressed() && !Input->controlPressed() ) { + if ( selCurInit() != curPos() ) { + selCurEnd( curPos() ); } else { - if ( SelCurInit() != CurPos() ) { - SelCurInit( CurPos() ); + if ( selCurInit() != curPos() ) { + selCurInit( curPos() ); } else { - ResetSelection(); + resetSelection(); return; } } - if ( -1 == SelCurInit() ) { - SelCurInit( lastPromtpPos ); + if ( -1 == selCurInit() ) { + selCurInit( lastPromtpPos ); } - if ( -1 == SelCurEnd() ) { - SelCurEnd( lastPromtpPos ); + if ( -1 == selCurEnd() ) { + selCurEnd( lastPromtpPos ); } } } -void InputTextBuffer::MovePromptRowDown( const bool& breakit ) { - if ( SupportFreeEditing() && SupportNewLine() ) { +void InputTextBuffer::movePromptRowDown( const bool& breakit ) { + if ( supportFreeEditing() && supportNewLine() ) { int lPromtpPos = mPromptPos; Uint32 dNLPos = 0; - GetCurPosLinePos( dNLPos ); + getCurPosLinePos( dNLPos ); Uint32 dCharsTo = mPromptPos - dNLPos; Uint32 dLastLinePos = 0; @@ -562,19 +562,19 @@ void InputTextBuffer::MovePromptRowDown( const bool& breakit ) { mPromptPos = dLastLinePos + dCharsTo; } - AutoPrompt( false ); + autoPrompt( false ); } - ShiftSelection( lPromtpPos ); + shiftSelection( lPromtpPos ); } } -void InputTextBuffer::MovePromptRowUp( const bool& breakit ) { - if ( SupportFreeEditing() && SupportNewLine() ) { +void InputTextBuffer::movePromptRowUp( const bool& breakit ) { + if ( supportFreeEditing() && supportNewLine() ) { int lPromtpPos = mPromptPos; Uint32 uNLPos = 0; - Uint32 uLineNum = GetCurPosLinePos( uNLPos ); + Uint32 uLineNum = getCurPosLinePos( uNLPos ); Uint32 uCharsTo = mPromptPos - uNLPos; if ( uLineNum >= 1 ) { @@ -602,46 +602,46 @@ void InputTextBuffer::MovePromptRowUp( const bool& breakit ) { mPromptPos = uLastLinePos + uCharsTo; } - AutoPrompt( false ); + autoPrompt( false ); } - ShiftSelection( lPromtpPos ); + shiftSelection( lPromtpPos ); } } -void InputTextBuffer::Clear() { +void InputTextBuffer::clear() { mText.clear(); - AutoPrompt( true ); + autoPrompt( true ); } -void InputTextBuffer::SetReturnCallback( EnterCallback EC ) { +void InputTextBuffer::setReturnCallback( EnterCallback EC ) { mEnterCall = EC; } -void InputTextBuffer::Buffer( const String& str ) { +void InputTextBuffer::buffer( const String& str ) { if ( mText != str ) { mText = str; - ChangedSinceLastUpdate( true ); + changedSinceLastUpdate( true ); } } -int InputTextBuffer::CurPos() const { +int InputTextBuffer::curPos() const { return mPromptPos; } -void InputTextBuffer::CurPos( const Uint32& pos ) { - if ( SupportFreeEditing() ) { +void InputTextBuffer::curPos( const Uint32& pos ) { + if ( supportFreeEditing() ) { if ( pos < mText.size() ) { mPromptPos = pos; - AutoPrompt( false ); + autoPrompt( false ); } else { - CursorToEnd(); + cursorToEnd(); } } } -Uint32 InputTextBuffer::GetCurPosLinePos( Uint32& LastNewLinePos ) { - if ( SupportFreeEditing() ) { +Uint32 InputTextBuffer::getCurPosLinePos( Uint32& LastNewLinePos ) { + if ( supportFreeEditing() ) { Uint32 nl = 0; LastNewLinePos = 0; for ( int i = 0; i < mPromptPos; i++ ) { @@ -655,38 +655,38 @@ Uint32 InputTextBuffer::GetCurPosLinePos( Uint32& LastNewLinePos ) { return 0; } -void InputTextBuffer::PushIgnoredChar( const Uint32& ch ) { +void InputTextBuffer::pushIgnoredChar( const Uint32& ch ) { mIgnoredChars.push_back( ch ); } -bool InputTextBuffer::CanAdd() { +bool InputTextBuffer::canAdd() { return mText.size() < mMaxLength; } -void InputTextBuffer::MaxLength( const Uint32& Max ) { +void InputTextBuffer::maxLength( const Uint32& Max ) { mMaxLength = Max; if ( mText.size() > mMaxLength ) mText.resize( mMaxLength ); } -const Uint32& InputTextBuffer::MaxLength() const { +const Uint32& InputTextBuffer::maxLength() const { return mMaxLength; } -String InputTextBuffer::Buffer() const { +String InputTextBuffer::buffer() const { return mText; } -bool InputTextBuffer::ChangedSinceLastUpdate() { +bool InputTextBuffer::changedSinceLastUpdate() { return 0 != ( mFlags & ( 1 << INPUT_TB_CHANGE_SINCE_LAST_UPDATE ) ); } -void InputTextBuffer::ChangedSinceLastUpdate( const bool& Changed ) { +void InputTextBuffer::changedSinceLastUpdate( const bool& Changed ) { BitOp::writeBitKey( &mFlags, INPUT_TB_CHANGE_SINCE_LAST_UPDATE, Changed == true ); } -void InputTextBuffer::AutoPrompt( const bool& set ) { +void InputTextBuffer::autoPrompt( const bool& set ) { BitOp::writeBitKey( &mFlags, INPUT_TB_PROMPT_AUTO_POS, set == true ); if ( set ) { @@ -694,80 +694,80 @@ void InputTextBuffer::AutoPrompt( const bool& set ) { } } -bool InputTextBuffer::AutoPrompt() { +bool InputTextBuffer::autoPrompt() { return 0 != ( mFlags & ( 1 << INPUT_TB_PROMPT_AUTO_POS ) ); } -bool InputTextBuffer::Active() const { +bool InputTextBuffer::active() const { return 0 != ( mFlags & ( 1 << INPUT_TB_ACTIVE ) ); } -void InputTextBuffer::Active( const bool& Active ) { +void InputTextBuffer::active( const bool& Active ) { BitOp::writeBitKey( &mFlags, INPUT_TB_ACTIVE, Active == true ); } -bool InputTextBuffer::SupportNewLine() { +bool InputTextBuffer::supportNewLine() { return 0 != ( mFlags & ( 1 << INPUT_TB_SUPPORT_NEW_LINE ) ); } -void InputTextBuffer::SupportNewLine( const bool& SupportNewLine ) { +void InputTextBuffer::supportNewLine( const bool& SupportNewLine ) { BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_NEW_LINE, SupportNewLine == true ); } -void InputTextBuffer::AllowOnlyNumbers( const bool& onlynums, const bool& allowdots ) { +void InputTextBuffer::allowOnlyNumbers( const bool& onlynums, const bool& allowdots ) { BitOp::writeBitKey( &mFlags, INPUT_TB_ALLOW_ONLY_NUMBERS, onlynums == true ); BitOp::writeBitKey( &mFlags, INPUT_TB_ALLOW_DOT_IN_NUMBERS, allowdots == true ); } -bool InputTextBuffer::AllowOnlyNumbers() { +bool InputTextBuffer::allowOnlyNumbers() { return 0 != ( mFlags & ( 1 << INPUT_TB_ALLOW_ONLY_NUMBERS ) ); } -bool InputTextBuffer::AllowDotsInNumbers() { +bool InputTextBuffer::allowDotsInNumbers() { return 0 != ( mFlags & ( 1 << INPUT_TB_ALLOW_DOT_IN_NUMBERS ) ); } -bool InputTextBuffer::SupportFreeEditing() const { +bool InputTextBuffer::supportFreeEditing() const { return 0 != ( mFlags & ( 1 << INPUT_TB_FREE_EDITING ) ); } -void InputTextBuffer::SupportFreeEditing( const bool& Support ) { +void InputTextBuffer::supportFreeEditing( const bool& Support ) { BitOp::writeBitKey( &mFlags, INPUT_TB_FREE_EDITING, Support == true ); } -void InputTextBuffer::SupportCopyPaste( const bool& support ) { +void InputTextBuffer::supportCopyPaste( const bool& support ) { BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_COPY_PASTE, support == true ); } -bool InputTextBuffer::SupportCopyPaste() { +bool InputTextBuffer::supportCopyPaste() { return 0 != ( mFlags & ( 1 << INPUT_TB_SUPPORT_COPY_PASTE ) ); } -bool InputTextBuffer::TextSelectionEnabled() { +bool InputTextBuffer::textSelectionEnabled() { return 0 != ( mFlags & ( 1 << INPUT_TB_TEXT_SELECTION_ENABLED ) ); } -void InputTextBuffer::TextSelectionEnabled( const bool& enabled ) { +void InputTextBuffer::textSelectionEnabled( const bool& enabled ) { BitOp::writeBitKey( &mFlags, INPUT_TB_TEXT_SELECTION_ENABLED, enabled == true ); } -void InputTextBuffer::CursorToEnd() { +void InputTextBuffer::cursorToEnd() { mPromptPos = mText.size(); } -void InputTextBuffer::SelCurInit( const Int32& init ) { +void InputTextBuffer::selCurInit( const Int32& init ) { mSelCurInit = init; } -void InputTextBuffer::SelCurEnd( const Int32& end ) { +void InputTextBuffer::selCurEnd( const Int32& end ) { mSelCurEnd = end; } -const Int32& InputTextBuffer::SelCurInit() const { +const Int32& InputTextBuffer::selCurInit() const { return mSelCurInit; } -const Int32& InputTextBuffer::SelCurEnd() const { +const Int32& InputTextBuffer::selCurEnd() const { return mSelCurEnd; } diff --git a/src/eepp/window/joystick.cpp b/src/eepp/window/joystick.cpp index f47b68758..4a1a701a1 100644 --- a/src/eepp/window/joystick.cpp +++ b/src/eepp/window/joystick.cpp @@ -13,25 +13,25 @@ Joystick::Joystick( const Uint32& index ) : mButtonDownLast(0), mButtonUp(0) { - Open(); + open(); } Joystick::~Joystick() { - Close(); + close(); } -void Joystick::ReOpen() { - Close(); +void Joystick::reOpen() { + close(); - Open(); + open(); } -void Joystick::ClearStates() { +void Joystick::clearStates() { mButtonUp = 0; mButtonDownLast = mButtonDown; } -void Joystick::UpdateButton( const Uint32& index, const bool& down ) { +void Joystick::updateButton( const Uint32& index, const bool& down ) { if ( down ) { mButtonDown |= ( 1 << index ); } else { @@ -44,48 +44,48 @@ void Joystick::UpdateButton( const Uint32& index, const bool& down ) { } } -const Int32& Joystick::GetNumHats() const { +const Int32& Joystick::getNumHats() const { return mHats; } -const Int32& Joystick::GetNumButtons() const { +const Int32& Joystick::getNumButtons() const { return mButtons; } -const Int32& Joystick::GetNumAxes() const { +const Int32& Joystick::getNumAxes() const { return mAxes; } -const Int32& Joystick::GetNumBalls() const { +const Int32& Joystick::getNumBalls() const { return mBalls; } -const Uint32& Joystick::GetButtonTrigger() const { +const Uint32& Joystick::getButtonTrigger() const { return mButtonDown; } -const Uint32& Joystick::GetButtonUpTrigger() const { +const Uint32& Joystick::getButtonUpTrigger() const { return mButtonUp; } -bool Joystick::IsButtonDown( const Int32& index ) { +bool Joystick::isButtonDown( const Int32& index ) { if ( index >= 0 && index < mButtons ) return 0 != ( mButtonDown & ( 1 << index ) ); return false; } -bool Joystick::IsButtonUp( const Int32& index ) { +bool Joystick::isButtonUp( const Int32& index ) { if ( index >= 0 && index < mButtons ) return 0 != ( mButtonUp & ( 1 << index ) ); return false; } -void Joystick::Close() { +void Joystick::close() { } -void Joystick::Open() { +void Joystick::open() { } }} diff --git a/src/eepp/window/joystickmanager.cpp b/src/eepp/window/joystickmanager.cpp index 6c0fd4169..dbac85325 100644 --- a/src/eepp/window/joystickmanager.cpp +++ b/src/eepp/window/joystickmanager.cpp @@ -9,37 +9,37 @@ JoystickManager::JoystickManager() : for ( Uint32 i = 0; i < MAX_JOYSTICKS; i++ ) mJoysticks[i] = NULL; - Open(); + open(); } JoystickManager::~JoystickManager() { - for ( Uint32 i = 0; i < Count(); i++ ) + for ( Uint32 i = 0; i < count(); i++ ) eeSAFE_DELETE( mJoysticks[i] ); - Close(); + close(); } -Uint32 JoystickManager::Count() { +Uint32 JoystickManager::count() { return mCount; } -Joystick * JoystickManager::GetJoystick( const Uint32& index ) { +Joystick * JoystickManager::getJoystick( const Uint32& index ) { if ( index < MAX_JOYSTICKS ) return mJoysticks[ index ]; return NULL; } -void JoystickManager::Rescan() { - Close(); +void JoystickManager::rescan() { + close(); - Open(); + open(); } -void JoystickManager::Close() { +void JoystickManager::close() { } -void JoystickManager::Open() { +void JoystickManager::open() { } }} diff --git a/src/eepp/window/platform/null/nullimpl.cpp b/src/eepp/window/platform/null/nullimpl.cpp index 8f0888e52..9120c7af0 100644 --- a/src/eepp/window/platform/null/nullimpl.cpp +++ b/src/eepp/window/platform/null/nullimpl.cpp @@ -10,63 +10,63 @@ NullImpl::NullImpl( EE::Window::Window * window ) : NullImpl::~NullImpl() { } -void NullImpl::MinimizeWindow() { +void NullImpl::minimizeWindow() { } -void NullImpl::MaximizeWindow() { +void NullImpl::maximizeWindow() { } -bool NullImpl::IsWindowMaximized() { +bool NullImpl::isWindowMaximized() { return false; } -void NullImpl::HideWindow() { +void NullImpl::hideWindow() { } -void NullImpl::RaiseWindow() { +void NullImpl::raiseWindow() { } -void NullImpl::ShowWindow() { +void NullImpl::showWindow() { } -void NullImpl::MoveWindow( int left, int top ) { +void NullImpl::moveWindow( int left, int top ) { } -void NullImpl::SetContext( eeWindowContex Context ) { +void NullImpl::setContext( eeWindowContex Context ) { } -Vector2i NullImpl::Position() { +Vector2i NullImpl::getPosition() { return Vector2i(0,0); } -void NullImpl::ShowMouseCursor() { +void NullImpl::showMouseCursor() { } -void NullImpl::HideMouseCursor() { +void NullImpl::hideMouseCursor() { } -Cursor * NullImpl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * NullImpl::createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return NULL; } -Cursor * NullImpl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * NullImpl::createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return NULL; } -Cursor * NullImpl::CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * NullImpl::createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { return NULL; } -void NullImpl::SetMouseCursor( Cursor * cursor ) { +void NullImpl::setMouseCursor( Cursor * cursor ) { } -void NullImpl::SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { +void NullImpl::setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { } -void NullImpl::RestoreCursor() { +void NullImpl::restoreCursor() { } -eeWindowContex NullImpl::GetWindowContext() { +eeWindowContex NullImpl::getWindowContext() { return 0; } diff --git a/src/eepp/window/platform/null/nullimpl.hpp b/src/eepp/window/platform/null/nullimpl.hpp index d6f776153..7740dcf04 100644 --- a/src/eepp/window/platform/null/nullimpl.hpp +++ b/src/eepp/window/platform/null/nullimpl.hpp @@ -14,41 +14,41 @@ class NullImpl : public PlatformImpl { ~NullImpl(); - void MinimizeWindow(); + void minimizeWindow(); - void MaximizeWindow(); + void maximizeWindow(); - bool IsWindowMaximized(); + bool isWindowMaximized(); - void HideWindow(); + void hideWindow(); - void RaiseWindow(); + void raiseWindow(); - void ShowWindow(); + void showWindow(); - void MoveWindow( int left, int top ); + void moveWindow( int left, int top ); - void SetContext( eeWindowContex Context ); + void setContext( eeWindowContex Context ); - Vector2i Position(); + Vector2i getPosition(); - void ShowMouseCursor(); + void showMouseCursor(); - void HideMouseCursor(); + void hideMouseCursor(); - Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void SetMouseCursor( Cursor * cursor ); + void setMouseCursor( Cursor * cursor ); - void SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); + void setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); - void RestoreCursor(); + void restoreCursor(); - eeWindowContex GetWindowContext(); + eeWindowContex getWindowContext(); }; }}} diff --git a/src/eepp/window/platform/osx/osximpl.cpp b/src/eepp/window/platform/osx/osximpl.cpp index 2a94c65c1..74f795518 100644 --- a/src/eepp/window/platform/osx/osximpl.cpp +++ b/src/eepp/window/platform/osx/osximpl.cpp @@ -16,64 +16,64 @@ OSXImpl::OSXImpl( EE::Window::Window * window ) : OSXImpl::~OSXImpl() { } -void OSXImpl::MinimizeWindow() { +void OSXImpl::minimizeWindow() { } -void OSXImpl::MaximizeWindow() { +void OSXImpl::maximizeWindow() { } -bool OSXImpl::IsWindowMaximized() { +bool OSXImpl::isWindowMaximized() { return false; } -void OSXImpl::HideWindow() { +void OSXImpl::hideWindow() { } -void OSXImpl::RaiseWindow() { +void OSXImpl::raiseWindow() { } -void OSXImpl::ShowWindow() { +void OSXImpl::showWindow() { } -void OSXImpl::MoveWindow( int left, int top ) { +void OSXImpl::moveWindow( int left, int top ) { } -void OSXImpl::SetContext( eeWindowContex Context ) { +void OSXImpl::setContext( eeWindowContex Context ) { aglSetCurrentContext( Context ); } -Vector2i OSXImpl::Position() { +Vector2i OSXImpl::getPosition() { return Vector2i(0,0); } -void OSXImpl::ShowMouseCursor() { +void OSXImpl::showMouseCursor() { } -void OSXImpl::HideMouseCursor() { +void OSXImpl::hideMouseCursor() { } -Cursor * OSXImpl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * OSXImpl::createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return NULL; } -Cursor * OSXImpl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * OSXImpl::createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return NULL; } -Cursor * OSXImpl::CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * OSXImpl::createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { return NULL; } -void OSXImpl::SetMouseCursor( Cursor * cursor ) { +void OSXImpl::setMouseCursor( Cursor * cursor ) { } -void OSXImpl::SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { +void OSXImpl::setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { } -void OSXImpl::RestoreCursor() { +void OSXImpl::restoreCursor() { } -eeWindowContex OSXImpl::GetWindowContext() { +eeWindowContex OSXImpl::getWindowContext() { return aglGetCurrentContext(); } diff --git a/src/eepp/window/platform/osx/osximpl.hpp b/src/eepp/window/platform/osx/osximpl.hpp index 876373c85..fe8825afe 100644 --- a/src/eepp/window/platform/osx/osximpl.hpp +++ b/src/eepp/window/platform/osx/osximpl.hpp @@ -17,41 +17,41 @@ class OSXImpl : public PlatformImpl { ~OSXImpl(); - void MinimizeWindow(); + void minimizeWindow(); - void MaximizeWindow(); + void maximizeWindow(); - bool IsWindowMaximized(); + bool isWindowMaximized(); - void HideWindow(); + void hideWindow(); - void RaiseWindow(); + void raiseWindow(); - void ShowWindow(); + void showWindow(); - void MoveWindow( int left, int top ); + void moveWindow( int left, int top ); - void SetContext( eeWindowContex Context ); + void setContext( eeWindowContex Context ); - Vector2i Position(); + Vector2i getPosition(); - void ShowMouseCursor(); + void showMouseCursor(); - void HideMouseCursor(); + void hideMouseCursor(); - Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void SetMouseCursor( Cursor * cursor ); + void setMouseCursor( Cursor * cursor ); - void SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); + void setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); - void RestoreCursor(); + void restoreCursor(); - eeWindowContex GetWindowContext(); + eeWindowContex getWindowContext(); }; }}} diff --git a/src/eepp/window/platform/win/cursorwin.cpp b/src/eepp/window/platform/win/cursorwin.cpp index 1e2f08110..1d86c1ca6 100644 --- a/src/eepp/window/platform/win/cursorwin.cpp +++ b/src/eepp/window/platform/win/cursorwin.cpp @@ -17,19 +17,19 @@ namespace EE { namespace Window { namespace Platform { CursorWin::CursorWin( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ) { - Create(); + create(); } CursorWin::CursorWin( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ) { - Create(); + create(); } CursorWin::CursorWin( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( path, hotspot, name, window ) { - Create(); + create(); } CursorWin::~CursorWin() { @@ -128,7 +128,7 @@ static void local_draw_to_hdc( HDC dc, Image * bitmap, int x, int y ) { local_stretch_blit_to_hdc(bitmap, dc, 0, 0, w, h, x, y, w, h); } -void CursorWin::Create() { +void CursorWin::create() { if ( NULL == mImage && mImage->MemSize() ) return; @@ -153,7 +153,7 @@ void CursorWin::Create() { } /* Create bitmap */ - h_dc = GetDC( GetPlatform()->GetHandler() ); + h_dc = GetDC( getPlatform()->getHandler() ); h_xor_dc = CreateCompatibleDC(h_dc); h_and_dc = CreateCompatibleDC(h_dc); @@ -192,7 +192,7 @@ void CursorWin::Create() { SelectObject(h_xor_dc, hOldXorMaskBitmap); DeleteDC(h_and_dc); DeleteDC(h_xor_dc); - ReleaseDC( GetPlatform()->GetHandler() , h_dc ); + ReleaseDC( getPlatform()->getHandler() , h_dc ); iconinfo.fIcon = false; iconinfo.xHotspot = mHotSpot.x; @@ -208,11 +208,11 @@ void CursorWin::Create() { mCursor = (void*)icon; } -WinImpl * CursorWin::GetPlatform() { - return reinterpret_cast( mWindow->GetPlatform() ); +WinImpl * CursorWin::getPlatform() { + return reinterpret_cast( mWindow->getPlatform() ); } -void * CursorWin::GetCursor() const { +void * CursorWin::getCursor() const { return mCursor; } diff --git a/src/eepp/window/platform/win/cursorwin.hpp b/src/eepp/window/platform/win/cursorwin.hpp index 4dac51357..b55953e8b 100644 --- a/src/eepp/window/platform/win/cursorwin.hpp +++ b/src/eepp/window/platform/win/cursorwin.hpp @@ -13,7 +13,7 @@ class WinImpl; class CursorWin : public Cursor { public: - void * GetCursor() const; + void * getCursor() const; protected: friend class WinImpl; @@ -27,9 +27,9 @@ class CursorWin : public Cursor { ~CursorWin(); - void Create(); + void create(); - WinImpl * GetPlatform(); + WinImpl * getPlatform(); }; }}} diff --git a/src/eepp/window/platform/win/winimpl.cpp b/src/eepp/window/platform/win/winimpl.cpp index dc757692d..174e6593a 100644 --- a/src/eepp/window/platform/win/winimpl.cpp +++ b/src/eepp/window/platform/win/winimpl.cpp @@ -11,7 +11,7 @@ #include #undef CreateWindow -static BOOL WIN_ShowWindow( HWND hWnd, int nCmdShow ) { +static BOOL WIN_showWindow( HWND hWnd, int nCmdShow ) { return ShowWindow( hWnd, nCmdShow ); } @@ -42,26 +42,26 @@ WinImpl::WinImpl( EE::Window::Window * window, eeWindowHandle handler ) : WinImpl::~WinImpl() { } -void WinImpl::MinimizeWindow() { - WIN_ShowWindow( mHandler, SW_MINIMIZE ); +void WinImpl::minimizeWindow() { + WIN_showWindow( mHandler, SW_MINIMIZE ); } -void WinImpl::MaximizeWindow() { - WIN_ShowWindow( mHandler, SW_MAXIMIZE ); +void WinImpl::maximizeWindow() { + WIN_showWindow( mHandler, SW_MAXIMIZE ); } -bool WinImpl::IsWindowMaximized() { +bool WinImpl::isWindowMaximized() { return 0 != IsZoomed( mHandler ); } -void WinImpl::HideWindow() { - WIN_ShowWindow( mHandler, SW_HIDE ); +void WinImpl::hideWindow() { + WIN_showWindow( mHandler, SW_HIDE ); } -void WinImpl::RaiseWindow() { +void WinImpl::raiseWindow() { HWND top; - if ( !mWindow->Windowed() ) + if ( !mWindow->isWindowed() ) top = HWND_TOPMOST; else top = HWND_NOTOPMOST; @@ -69,32 +69,32 @@ void WinImpl::RaiseWindow() { SetWindowPos( mHandler, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE) ); } -void WinImpl::ShowWindow() { - WIN_ShowWindow( mHandler, SW_SHOW ); +void WinImpl::showWindow() { + WIN_showWindow( mHandler, SW_SHOW ); } -void WinImpl::MoveWindow( int left, int top ) { +void WinImpl::moveWindow( int left, int top ) { SetWindowPos( mHandler, NULL, left, top, 0, 0, SWP_NOSIZE | SWP_NOZORDER ); } -void WinImpl::SetContext( eeWindowContex Context ) { +void WinImpl::setContext( eeWindowContex Context ) { wglMakeCurrent( (HDC)GetDC( mHandler ), (HGLRC)Context ); } -Vector2i WinImpl::Position() { +Vector2i WinImpl::getPosition() { RECT r; GetWindowRect( mHandler, &r ); return Vector2i( r.left, r.top ); } -void WinImpl::ShowMouseCursor() { +void WinImpl::showMouseCursor() { mCursorHidden = false; if ( !mCursorCurrent ) { - SetSystemMouseCursor( SYS_CURSOR_ARROW ); + setSystemMouseCursor( SYS_CURSOR_ARROW ); } else { SetCursor( (HCURSOR)mCursorCurrent ); - SetClassLong( GetHandler(), GCL_HCURSOR, (DWORD)mCursorCurrent ); + SetClassLong( getHandler(), GCL_HCURSOR, (DWORD)mCursorCurrent ); POINT p; GetCursorPos( &p ); @@ -102,7 +102,7 @@ void WinImpl::ShowMouseCursor() { } } -void WinImpl::HideMouseCursor() { +void WinImpl::hideMouseCursor() { if ( mCursorHidden ) return; @@ -111,24 +111,24 @@ void WinImpl::HideMouseCursor() { PostMessage( mHandler, WM_SETCURSOR, 0, 0 ); } -Cursor * WinImpl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * WinImpl::createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorWin, ( tex, hotspot, name, mWindow ) ); } -Cursor * WinImpl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * WinImpl::createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorWin, ( img, hotspot, name, mWindow ) ); } -Cursor * WinImpl::CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * WinImpl::createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorWin, ( path, hotspot, name, mWindow ) ); } -void WinImpl::SetMouseCursor( Cursor * cursor ) { - mCursorCurrent = reinterpret_cast ( cursor )->GetCursor(); +void WinImpl::setMouseCursor( Cursor * cursor ) { + mCursorCurrent = reinterpret_cast ( cursor )->getCursor(); if ( !mCursorHidden ) { SetCursor( (HCURSOR)mCursorCurrent ); - SetClassLong( GetHandler(), GCL_HCURSOR, (DWORD)mCursorCurrent ); + SetClassLong( getHandler(), GCL_HCURSOR, (DWORD)mCursorCurrent ); POINT p; GetCursorPos( &p ); @@ -136,7 +136,7 @@ void WinImpl::SetMouseCursor( Cursor * cursor ) { } } -void WinImpl::SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { +void WinImpl::setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { HCURSOR mc; switch ( syscursor ) { @@ -172,7 +172,7 @@ void WinImpl::SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { if ( !mCursorHidden ) { SetCursor( mc ); - SetClassLong( GetHandler(), GCL_HCURSOR, (DWORD)mc ); + SetClassLong( getHandler(), GCL_HCURSOR, (DWORD)mc ); POINT p; GetCursorPos( &p ); @@ -180,19 +180,19 @@ void WinImpl::SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { } } -void WinImpl::RestoreCursor() { +void WinImpl::restoreCursor() { if ( !mCursorHidden ) { - ShowMouseCursor(); + showMouseCursor(); } else { - HideMouseCursor(); + hideMouseCursor(); } } -eeWindowHandle WinImpl::GetHandler() const { +eeWindowHandle WinImpl::getHandler() const { return mHandler; } -eeWindowContex WinImpl::GetWindowContext() { +eeWindowContex WinImpl::getWindowContext() { return wglGetCurrentContext(); } diff --git a/src/eepp/window/platform/win/winimpl.hpp b/src/eepp/window/platform/win/winimpl.hpp index 10952b88f..34a31e119 100644 --- a/src/eepp/window/platform/win/winimpl.hpp +++ b/src/eepp/window/platform/win/winimpl.hpp @@ -17,43 +17,43 @@ class WinImpl : public PlatformImpl { ~WinImpl(); - void MinimizeWindow(); + void minimizeWindow(); - void MaximizeWindow(); + void maximizeWindow(); - bool IsWindowMaximized(); + bool isWindowMaximized(); - void HideWindow(); + void hideWindow(); - void RaiseWindow(); + void raiseWindow(); - void ShowWindow(); + void showWindow(); - void MoveWindow( int left, int top ); + void moveWindow( int left, int top ); - void SetContext( eeWindowContex Context ); + void setContext( eeWindowContex Context ); - Vector2i Position(); + Vector2i getPosition(); - void ShowMouseCursor(); + void showMouseCursor(); - void HideMouseCursor(); + void hideMouseCursor(); - Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void SetMouseCursor( Cursor * cursor ); + void setMouseCursor( Cursor * cursor ); - void SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); + void setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); - void RestoreCursor(); + void restoreCursor(); - eeWindowHandle GetHandler() const; + eeWindowHandle getHandler() const; - eeWindowContex GetWindowContext(); + eeWindowContex getWindowContext(); protected: eeWindowHandle mHandler; void * mCursorCurrent; diff --git a/src/eepp/window/platform/x11/cursorx11.cpp b/src/eepp/window/platform/x11/cursorx11.cpp index 33aa9d77a..be4587292 100644 --- a/src/eepp/window/platform/x11/cursorx11.cpp +++ b/src/eepp/window/platform/x11/cursorx11.cpp @@ -19,29 +19,29 @@ CursorX11::CursorX11( Texture * tex, const Vector2i& hotspot, const std::string& Cursor( tex, hotspot, name, window ), mCursor( None ) { - Create(); + create(); } CursorX11::CursorX11( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ), mCursor( None ) { - Create(); + create(); } CursorX11::CursorX11( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( path, hotspot, name, window ), mCursor( None ) { - Create(); + create(); } CursorX11::~CursorX11() { if ( None != mCursor ) - XFreeCursor( GetPlatform()->GetDisplay(), mCursor ); + XFreeCursor( getPlatform()->GetDisplay(), mCursor ); } -void CursorX11::Create() { +void CursorX11::create() { if ( NULL == mImage || 0 == mImage->MemSize() ) return; @@ -65,17 +65,17 @@ void CursorX11::Create() { image->xhot = mHotSpot.x; image->yhot = mHotSpot.y; - GetPlatform()->Lock(); + getPlatform()->Lock(); - mCursor = XcursorImageLoadCursor( GetPlatform()->GetDisplay(), image ); + mCursor = XcursorImageLoadCursor( getPlatform()->GetDisplay(), image ); - GetPlatform()->Unlock(); + getPlatform()->Unlock(); XcursorImageDestroy( image ); } -X11Impl * CursorX11::GetPlatform() { - return reinterpret_cast( mWindow->GetPlatform() ); +X11Impl * CursorX11::getPlatform() { + return reinterpret_cast( mWindow->getPlatform() ); } X11Cursor CursorX11::GetCursor() const { diff --git a/src/eepp/window/platform/x11/cursorx11.hpp b/src/eepp/window/platform/x11/cursorx11.hpp index 6a2fb615a..0b7811033 100644 --- a/src/eepp/window/platform/x11/cursorx11.hpp +++ b/src/eepp/window/platform/x11/cursorx11.hpp @@ -19,17 +19,17 @@ class CursorX11 : public Cursor { X11Cursor mCursor; - CursorX11( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorX11( Texture * tex, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - CursorX11( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorX11( Graphics::Image * img, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); - CursorX11( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorX11( const std::string& path, const Vector2i& hotspot, const std::string& getName, EE::Window::Window * window ); ~CursorX11(); - void Create(); + void create(); - X11Impl * GetPlatform(); + X11Impl * getPlatform(); }; }}} diff --git a/src/eepp/window/platform/x11/x11impl.cpp b/src/eepp/window/platform/x11/x11impl.cpp index c976dc6f1..9dc071378 100644 --- a/src/eepp/window/platform/x11/x11impl.cpp +++ b/src/eepp/window/platform/x11/x11impl.cpp @@ -39,7 +39,7 @@ X11Impl::~X11Impl() { XFreeCursor( mDisplay, mCursorSystemLast ); } -void X11Impl::MinimizeWindow() { +void X11Impl::minimizeWindow() { Lock(); XIconifyWindow( mDisplay, mX11Window, 0 ); @@ -49,7 +49,7 @@ void X11Impl::MinimizeWindow() { Unlock(); } -void X11Impl::MaximizeWindow() { +void X11Impl::maximizeWindow() { // coded by Rafał Maj, idea from Måns Rullgård http://tinyurl.com/68mvk3 Lock(); @@ -74,7 +74,7 @@ void X11Impl::MaximizeWindow() { Unlock(); } -bool X11Impl::IsWindowMaximized() { +bool X11Impl::isWindowMaximized() { Lock(); //bool minimized = false; @@ -126,7 +126,7 @@ bool X11Impl::IsWindowMaximized() { return false; } -void X11Impl::HideWindow() { +void X11Impl::hideWindow() { Lock(); XUnmapWindow( mDisplay, mX11Window ); @@ -134,7 +134,7 @@ void X11Impl::HideWindow() { Unlock(); } -void X11Impl::RaiseWindow() { +void X11Impl::raiseWindow() { Lock(); XRaiseWindow( mDisplay, mX11Window ); @@ -142,7 +142,7 @@ void X11Impl::RaiseWindow() { Unlock(); } -void X11Impl::ShowWindow() { +void X11Impl::showWindow() { Lock(); XMapRaised( mDisplay, mX11Window ); @@ -150,7 +150,7 @@ void X11Impl::ShowWindow() { Unlock(); } -void X11Impl::MoveWindow( int left, int top ) { +void X11Impl::moveWindow( int left, int top ) { Lock(); XMoveWindow( mDisplay, mX11Window, left, top ); @@ -160,7 +160,7 @@ void X11Impl::MoveWindow( int left, int top ) { Unlock(); } -void X11Impl::SetContext( eeWindowContex Context ) { +void X11Impl::setContext( eeWindowContex Context ) { Lock(); glXMakeCurrent( mDisplay, mX11Window, Context ); @@ -168,7 +168,7 @@ void X11Impl::SetContext( eeWindowContex Context ) { Unlock(); } -Vector2i X11Impl::Position() { +Vector2i X11Impl::getPosition() { int x, y; X11Window child_return; @@ -177,7 +177,7 @@ Vector2i X11Impl::Position() { return Vector2i( x, y ); } -void X11Impl::ShowMouseCursor() { +void X11Impl::showMouseCursor() { if ( !mCursorHidden ) return; @@ -190,7 +190,7 @@ void X11Impl::ShowMouseCursor() { Unlock(); } -void X11Impl::HideMouseCursor() { +void X11Impl::hideMouseCursor() { if ( mCursorHidden ) return; @@ -228,19 +228,19 @@ void X11Impl::HideMouseCursor() { Unlock(); } -Cursor * X11Impl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * X11Impl::createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorX11, ( tex, hotspot, name, mWindow ) ); } -Cursor * X11Impl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * X11Impl::createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorX11, ( img, hotspot, name, mWindow ) ); } -Cursor * X11Impl::CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * X11Impl::createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorX11, ( path, hotspot, name, mWindow ) ); } -void X11Impl::SetMouseCursor( Cursor * cursor ) { +void X11Impl::setMouseCursor( Cursor * cursor ) { mCursorCurrent = reinterpret_cast( cursor )->GetCursor(); if ( !mCursorHidden ) { @@ -252,7 +252,7 @@ void X11Impl::SetMouseCursor( Cursor * cursor ) { } } -void X11Impl::RestoreCursor() { +void X11Impl::restoreCursor() { if ( !mCursorHidden ) { Lock(); @@ -260,11 +260,11 @@ void X11Impl::RestoreCursor() { Unlock(); } else { - HideMouseCursor(); + hideMouseCursor(); } } -void X11Impl::SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { +void X11Impl::setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ) { unsigned int cursor_shape; switch ( syscursor ) { @@ -313,7 +313,7 @@ void X11Impl::Unlock() { mUnlock(); } -eeWindowContex X11Impl::GetWindowContext() { +eeWindowContex X11Impl::getWindowContext() { return glXGetCurrentContext(); } diff --git a/src/eepp/window/platform/x11/x11impl.hpp b/src/eepp/window/platform/x11/x11impl.hpp index 15c887e9e..71edaeabf 100644 --- a/src/eepp/window/platform/x11/x11impl.hpp +++ b/src/eepp/window/platform/x11/x11impl.hpp @@ -20,39 +20,39 @@ class X11Impl : public PlatformImpl { ~X11Impl(); - void MinimizeWindow(); + void minimizeWindow(); - void MaximizeWindow(); + void maximizeWindow(); - bool IsWindowMaximized(); + bool isWindowMaximized(); - void HideWindow(); + void hideWindow(); - void RaiseWindow(); + void raiseWindow(); - void ShowWindow(); + void showWindow(); - void MoveWindow( int left, int top ); + void moveWindow( int left, int top ); - void SetContext( eeWindowContex Context ); + void setContext( eeWindowContex Context ); - Vector2i Position(); + Vector2i getPosition(); - void ShowMouseCursor(); + void showMouseCursor(); - void HideMouseCursor(); + void hideMouseCursor(); - Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * createMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void SetMouseCursor( Cursor * cursor ); + void setMouseCursor( Cursor * cursor ); - void SetSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); + void setSystemMouseCursor( EE_SYSTEM_CURSOR syscursor ); - void RestoreCursor(); + void restoreCursor(); eeWindowHandle GetDisplay() const; @@ -60,7 +60,7 @@ class X11Impl : public PlatformImpl { void Unlock(); - eeWindowContex GetWindowContext(); + eeWindowContex getWindowContext(); protected: eeWindowHandle mDisplay; X11Window mX11Window; diff --git a/src/eepp/window/view.cpp b/src/eepp/window/view.cpp index 8e01be32e..e14afdad6 100755 --- a/src/eepp/window/view.cpp +++ b/src/eepp/window/view.cpp @@ -8,41 +8,41 @@ View::View() : mNeedUpdate(true) { mView.Top = 0; mView.Bottom = 0; - CalcCenter(); + calcCenter(); } View::View( const int& X, const int& Y, const int& Width, const int& Height ) : mNeedUpdate(true) { - SetView( X, Y, Width, Height ); + setView( X, Y, Width, Height ); } View::View( const Recti& View ) : mNeedUpdate(true) { mView = View; - CalcCenter(); + calcCenter(); } View::~View() { } -void View::SetView( const int& X, const int& Y, const int& Width, const int& Height ) { +void View::setView( const int& X, const int& Y, const int& Width, const int& Height ) { mView.Left = X; mView.Top = Y; mView.Right = Width; mView.Bottom = Height; - CalcCenter(); + calcCenter(); mNeedUpdate = true; } -void View::CalcCenter() { +void View::calcCenter() { mCenter.x = ( ( mView.Left + mView.Right ) - mView.Left ) * 0.5f; mCenter.y = ( ( mView.Top + mView.Bottom ) - mView.Top ) * 0.5f; } -Vector2i View::Center() const { +Vector2i View::center() const { return Vector2i( (int)mCenter.x, (Int32)mCenter.y ); } -void View::Center( const Vector2i& Center ) { +void View::center( const Vector2i& Center ) { mCenter.x = (Float)Center.x; mCenter.y = (Float)Center.y; mView.Left = static_cast ( mCenter.x - (Float)mView.Right * 0.5f ); @@ -51,19 +51,19 @@ void View::Center( const Vector2i& Center ) { mNeedUpdate = true; } -void View::Move( const int& OffsetX, const int& OffsetY ) { +void View::move( const int& OffsetX, const int& OffsetY ) { mView.Left += OffsetX; mView.Top += OffsetY; - CalcCenter(); + calcCenter(); mNeedUpdate = true; } -void View::Move( const Vector2i& Offset ) { - Move( Offset.x, Offset.y ); +void View::move( const Vector2i& Offset ) { + move( Offset.x, Offset.y ); } -void View::Scale( const Vector2f& Factor ) { +void View::scale( const Vector2f& Factor ) { Vector2f v( mView.Right * 0.5f, mView.Bottom * 0.5f ); mView.Left = mView.Left + static_cast ( v.x - v.x * Factor.x ); @@ -71,31 +71,31 @@ void View::Scale( const Vector2f& Factor ) { mView.Right = static_cast( (Float)mView.Right * Factor.x ); mView.Bottom = static_cast( (Float)mView.Bottom * Factor.y ); - CalcCenter(); + calcCenter(); mNeedUpdate = true; } -void View::Scale( const Float& Factor ) { - Scale( Vector2f( Factor, Factor ) ); +void View::scale( const Float& Factor ) { + scale( Vector2f( Factor, Factor ) ); } -void View::SetPosition( const int& X, const int& Y ) { +void View::setPosition( const int& X, const int& Y ) { mView.Left = X; mView.Top = Y; - CalcCenter(); + calcCenter(); mNeedUpdate = true; } -void View::SetSize( const int& Width, const int& Height ) { +void View::setSize( const int& Width, const int& Height ) { mView.Right = Width; mView.Bottom = Height; - CalcCenter(); + calcCenter(); mNeedUpdate = true; } -bool View::NeedUpdate() const { +bool View::needUpdate() const { bool Need = mNeedUpdate; if ( Need ) diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 483a38034..594938a73 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -62,35 +62,35 @@ Window::~Window() { eeSAFE_DELETE( mPlatform ); } -Sizei Window::Size() { +Sizei Window::size() { return Sizei( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); } -const Uint32& Window::GetWidth() const { +const Uint32& Window::getWidth() const { return mWindow.WindowConfig.Width; } -const Uint32& Window::GetHeight() const { +const Uint32& Window::getHeight() const { return mWindow.WindowConfig.Height; } -const Sizei& Window::GetDesktopResolution() { +const Sizei& Window::getDesktopResolution() { return mWindow.DesktopResolution; } -void Window::Size( Uint32 Width, Uint32 Height ) { - Size( Width, Height, Windowed() ); +void Window::size( Uint32 Width, Uint32 Height ) { + size( Width, Height, isWindowed() ); } -bool Window::Windowed() const { +bool Window::isWindowed() const { return 0 != !( mWindow.WindowConfig.Style & WindowStyle::Fullscreen ); } -bool Window::Resizeable() const { +bool Window::isResizeable() const { return 0 != ( mWindow.WindowConfig.Style & WindowStyle::Resize ); } -void Window::Set2DProjection( const Uint32& Width, const Uint32& Height ) { +void Window::set2DProjection( const Uint32& Width, const Uint32& Height ) { GLi->MatrixMode( GL_PROJECTION ); GLi->LoadIdentity(); @@ -100,39 +100,39 @@ void Window::Set2DProjection( const Uint32& Width, const Uint32& Height ) { GLi->LoadIdentity(); } -void Window::SetViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix ) { - GLi->Viewport( x, GetHeight() - ( y + Height ), Width, Height ); +void Window::setViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix ) { + GLi->Viewport( x, getHeight() - ( y + Height ), Width, Height ); if ( UpdateProjectionMatrix ) { - Set2DProjection( Width, Height ); + set2DProjection( Width, Height ); } } -void Window::SetView( const View& View ) { +void Window::setView( const View& View ) { mCurrentView = &View; - Recti RView = mCurrentView->GetView(); - SetViewport( RView.Left, RView.Top, RView.Right, RView.Bottom ); + Recti RView = mCurrentView->getView(); + setViewport( RView.Left, RView.Top, RView.Right, RView.Bottom ); } -const View& Window::GetDefaultView() const { +const View& Window::getDefaultView() const { return mDefaultView; } -const View& Window::GetView() const { +const View& Window::getView() const { return *mCurrentView; } -void Window::CreateView() { - mDefaultView.SetView( 0, 0, mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); +void Window::createView() { + mDefaultView.setView( 0, 0, mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); mCurrentView = &mDefaultView; } -void Window::Setup2D( const bool& KeepView ) { +void Window::setup2D( const bool& KeepView ) { GLi->PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); GLi->PixelStorei( GL_PACK_ALIGNMENT, 1 ); - BackColor( mWindow.BackgroundColor ); + backColor( mWindow.BackgroundColor ); GLi->LineSmooth(); @@ -144,9 +144,9 @@ void Window::Setup2D( const bool& KeepView ) { } if ( !KeepView ) { - SetView( mDefaultView ); + setView( mDefaultView ); - mCurrentView->NeedUpdate(); + mCurrentView->needUpdate(); } BlendMode::SetMode( ALPHA_NORMAL, true ); @@ -165,20 +165,20 @@ void Window::Setup2D( const bool& KeepView ) { } } -const WindowInfo * Window::GetWindowInfo() const { +const WindowInfo * Window::getWindowInfo() const { return &mWindow; } -void Window::BackColor( const RGB& Color ) { +void Window::backColor( const RGB& Color ) { mWindow.BackgroundColor = Color; GLi->ClearColor( static_cast( mWindow.BackgroundColor.r() ) / 255.0f, static_cast( mWindow.BackgroundColor.g() ) / 255.0f, static_cast( mWindow.BackgroundColor.b() ) / 255.0f, 255.0f ); } -const RGB& Window::BackColor() const { +const RGB& Window::backColor() const { return mWindow.BackgroundColor; } -bool Window::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) { +bool Window::takeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) { GlobalBatchRenderer::instance()->Draw(); bool CreateNewFile = false; @@ -228,23 +228,23 @@ bool Window::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) } } -bool Window::Running() const { +bool Window::isRunning() const { return mWindow.Created; } -bool Window::Created() const { +bool Window::created() const { return mWindow.Created; } -void Window::Close() { +void Window::close() { mWindow.Created = false; } -void Window::FrameRateLimit( const Uint32& FrameRateLimit ) { +void Window::frameRateLimit( const Uint32& FrameRateLimit ) { mFrameData.FPS.Limit = (Float)FrameRateLimit; } -Uint32 Window::FrameRateLimit() { +Uint32 Window::frameRateLimit() { return static_cast( mFrameData.FPS.Limit ); } @@ -252,11 +252,11 @@ Uint32 Window::FPS() const { return mFrameData.FPS.Current; } -Time Window::Elapsed() const { +Time Window::elapsed() const { return mFrameData.ElapsedTime; } -void Window::GetElapsedTime() { +void Window::getElapsedTime() { if ( NULL == mFrameData.FrameElapsed ) { mFrameData.FrameElapsed = eeNew( Clock, () ); } @@ -264,7 +264,7 @@ void Window::GetElapsedTime() { mFrameData.ElapsedTime = mFrameData.FrameElapsed->elapsed(); } -void Window::CalculateFps() { +void Window::calculateFps() { if ( Sys::getTicks() - mFrameData.FPS.LastCheck >= 1000 ) { mFrameData.FPS.Current = mFrameData.FPS.Count; mFrameData.FPS.Count = 0; @@ -274,7 +274,7 @@ void Window::CalculateFps() { mFrameData.FPS.Count++; } -void Window::LimitFps() { +void Window::limitFps() { if ( mFrameData.FPS.Limit > 0 ) { mFrameData.FPS.Error = 0; double RemainT = 1000.0 / mFrameData.FPS.Limit - ( mFrameData.ElapsedTime.asMilliseconds() * 0.1f ); @@ -296,87 +296,87 @@ void Window::LimitFps() { } } -void Window::ViewCheckUpdate() { - if ( mCurrentView->NeedUpdate() ) { - SetView( *mCurrentView ); +void Window::viewCheckUpdate() { + if ( mCurrentView->needUpdate() ) { + setView( *mCurrentView ); } } -void Window::Clear() { +void Window::clear() { GLi->Clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); } -void Window::Display( bool clear ) { +void Window::display( bool clear ) { GlobalBatchRenderer::instance()->Draw(); - if ( mCurrentView->NeedUpdate() ) - SetView( *mCurrentView ); + if ( mCurrentView->needUpdate() ) + setView( *mCurrentView ); - SwapBuffers(); + swapBuffers(); #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN if ( clear ) - Clear(); + this->clear(); #endif - GetElapsedTime(); + getElapsedTime(); - CalculateFps(); + calculateFps(); - LimitFps(); + limitFps(); } -void Window::ClipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ) { +void Window::clipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ) { GlobalBatchRenderer::instance()->Draw(); - GLi->Scissor( x, GetHeight() - ( y + Height ), Width, Height ); + GLi->Scissor( x, getHeight() - ( y + Height ), Width, Height ); GLi->Enable( GL_SCISSOR_TEST ); } -void Window::ClipDisable() { +void Window::clipDisable() { GlobalBatchRenderer::instance()->Draw(); GLi->Disable( GL_SCISSOR_TEST ); } -void Window::ClipPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { +void Window::clipPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { GlobalBatchRenderer::instance()->Draw(); GLi->Clip2DPlaneEnable( x, y, Width, Height ); } -void Window::ClipPlaneDisable() { +void Window::clipPlaneDisable() { GlobalBatchRenderer::instance()->Draw(); GLi->Clip2DPlaneDisable(); } -Clipboard * Window::GetClipboard() const { +Clipboard * Window::getClipboard() const { return mClipboard; } -Input * Window::GetInput() const { +Input * Window::getInput() const { return mInput; } -CursorManager * Window::GetCursorManager() const { +CursorManager * Window::getCursorManager() const { return mCursorManager; } -Uint32 Window::PushResizeCallback( const WindowResizeCallback& cb ) { +Uint32 Window::pushResizeCallback( const WindowResizeCallback& cb ) { mNumCallBacks++; mCallbacks[ mNumCallBacks ] = cb; return mNumCallBacks; } -void Window::PopResizeCallback( const Uint32& CallbackId ) { +void Window::popResizeCallback( const Uint32& CallbackId ) { mCallbacks[ CallbackId ] = 0; mCallbacks.erase( mCallbacks.find(CallbackId) ); } -void Window::SendVideoResizeCb() { +void Window::sendVideoResizeCb() { for ( std::map::iterator i = mCallbacks.begin(); i != mCallbacks.end(); i++ ) { i->second( this ); } } -void Window::LogSuccessfulInit(const std::string& BackendName , const std::string&ProcessPath ) { +void Window::logSuccessfulInit(const std::string& BackendName , const std::string&ProcessPath ) { std::string msg( "Engine Initialized Succesfully.\n\tVersion: " + Version::getVersionName() + " (codename: \"" + Version::getCodename() + "\")" + "\n\tBuild time: " + Version::getBuildTime() + "\n\tOS: " + Sys::getOSName(true) + @@ -390,7 +390,7 @@ void Window::LogSuccessfulInit(const std::string& BackendName , const std::strin "\n\tGL Renderer: " + GLi->GetRenderer() + "\n\tGL Version: " + GLi->GetVersion() + "\n\tGL Shading Language Version: " + GLi->GetShadingLanguageVersion() + - "\n\tResolution: " + String::toStr( GetWidth() ) + "x" + String::toStr( GetHeight() ) + + "\n\tResolution: " + String::toStr( getWidth() ) + "x" + String::toStr( getHeight() ) + "\n\tGL extensions supported:\n\t\t" + GLi->GetExtensions() ); @@ -401,15 +401,15 @@ void Window::LogSuccessfulInit(const std::string& BackendName , const std::strin #endif } -void Window::LogFailureInit( const std::string& ClassName, const std::string& BackendName ) { +void Window::logFailureInit( const std::string& ClassName, const std::string& BackendName ) { eePRINTL( "Error on %s::Init. Backend %s failed to start.", ClassName.c_str(), BackendName.c_str() ); } -std::string Window::Caption() { +std::string Window::caption() { return mWindow.WindowConfig.Caption; } -eeWindowContex Window::GetContext() const { +eeWindowContex Window::getContext() const { #if defined( EE_GLEW_AVAILABLE ) && ( EE_PLATFORM == EE_PLATFORM_WIN || defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_MACOSX ) return mWindow.Context; #else @@ -417,152 +417,152 @@ eeWindowContex Window::GetContext() const { #endif } -void Window::GetMainContext() { +void Window::getMainContext() { #ifdef EE_GLEW_AVAILABLE if ( NULL != mPlatform ) - mWindow.Context = mPlatform->GetWindowContext(); + mWindow.Context = mPlatform->getWindowContext(); #endif } -void Window::SetDefaultContext() { +void Window::setDefaultContext() { #if defined( EE_GLEW_AVAILABLE ) && ( EE_PLATFORM == EE_PLATFORM_WIN || defined( EE_X11_PLATFORM ) ) - SetCurrentContext( mWindow.Context ); + setCurrentContext( mWindow.Context ); #endif } -void Window::Minimize() { +void Window::minimize() { if ( NULL != mPlatform ) - mPlatform->MinimizeWindow(); + mPlatform->minimizeWindow(); } -void Window::Maximize() { +void Window::maximize() { if ( NULL != mPlatform ) - mPlatform->MaximizeWindow(); + mPlatform->maximizeWindow(); } -bool Window::IsMaximized() { +bool Window::isMaximized() { if ( NULL != mPlatform ) - return mPlatform->IsWindowMaximized(); + return mPlatform->isWindowMaximized(); return false; } -void Window::Hide() { +void Window::hide() { if ( NULL != mPlatform ) - mPlatform->HideWindow(); + mPlatform->hideWindow(); } -void Window::Raise() { +void Window::raise() { if ( NULL != mPlatform ) - mPlatform->RaiseWindow(); + mPlatform->raiseWindow(); } -void Window::Show() { +void Window::show() { if ( NULL != mPlatform ) - mPlatform->ShowWindow(); + mPlatform->showWindow(); } -void Window::Position( Int16 Left, Int16 Top ) { +void Window::position( Int16 Left, Int16 Top ) { if ( NULL != mPlatform ) - mPlatform->MoveWindow( Left, Top ); + mPlatform->moveWindow( Left, Top ); } -Vector2i Window::Position() { +Vector2i Window::position() { if ( NULL != mPlatform ) - return mPlatform->Position(); + return mPlatform->getPosition(); return Vector2i(); } -void Window::SetCurrentContext( eeWindowContex Context ) { +void Window::setCurrentContext( eeWindowContex Context ) { if ( NULL != mPlatform ) - mPlatform->SetContext( Context ); + mPlatform->setContext( Context ); } -void Window::CreatePlatform() { +void Window::createPlatform() { eeSAFE_DELETE( mPlatform ); mPlatform = eeNew( Platform::NullImpl, ( this ) ); } -void Window::SetCurrent() { +void Window::setCurrent() { } -void Window::Center() { - if ( Windowed() ) { - Position( mWindow.DesktopResolution.width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.height() / 2 - mWindow.WindowConfig.Height / 2 ); +void Window::center() { + if ( isWindowed() ) { + position( mWindow.DesktopResolution.width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.height() / 2 - mWindow.WindowConfig.Height / 2 ); } } -Platform::PlatformImpl * Window::GetPlatform() const { +Platform::PlatformImpl * Window::getPlatform() const { return mPlatform; } -void Window::StartTextInput() { +void Window::startTextInput() { } -bool Window::IsTextInputActive() { +bool Window::isTextInputActive() { return false; } -void Window::StopTextInput() { +void Window::stopTextInput() { } -void Window::SetTextInputRect( Recti& rect ) { +void Window::setTextInputRect( Recti& rect ) { } -bool Window::HasScreenKeyboardSupport() +bool Window::hasScreenKeyboardSupport() { return false; } -bool Window::IsScreenKeyboardShown() { +bool Window::isScreenKeyboardShown() { return false; } -bool Window::IsThreadedGLContext() { +bool Window::isThreadedGLContext() { return false; } -void Window::SetGLContextThread() { +void Window::setGLContextThread() { } -void Window::UnsetGLContextThread() { +void Window::unsetGLContextThread() { } -void Window::RunMainLoop( void (*func)(), int fps ) { +void Window::runMainLoop( void (*func)(), int fps ) { #if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN emscripten_set_main_loop(func, fps, 1); #else - FrameRateLimit( fps ); + frameRateLimit( fps ); - while ( Running() ) { + while ( isRunning() ) { func(); } #endif } #if EE_PLATFORM == EE_PLATFORM_ANDROID -void * Window::GetJNIEnv() { +void * Window::getJNIEnv() { return NULL; } -void * Window::GetActivity() { +void * Window::getActivity() { return NULL; } -int Window::GetExternalStorageState() { +int Window::getExternalStorageState() { return 0; } -std::string Window::GetInternalStoragePath() { +std::string Window::getInternalStoragePath() { return std::string(""); } -std::string Window::GetExternalStoragePath() { +std::string Window::getExternalStoragePath() { return std::string(""); } -std::string Window::GetApkPath() { +std::string Window::getApkPath() { return std::string(""); } #endif diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index 0fba62fe7..a2db988c9 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -13,7 +13,7 @@ int op = 1; void MainLoop() { // Clear the screen buffer - win->Clear(); + win->clear(); // Create an instance of the primitive renderer Primitives p; @@ -22,16 +22,16 @@ void MainLoop() p.SetColor( ColorA( 0, 255, 0, 150 ) ); // Update the input - win->GetInput()->Update(); + win->getInput()->update(); // Check if ESCAPE key is pressed - if ( win->GetInput()->IsKeyDown( KEY_ESCAPE ) ) { + if ( win->getInput()->isKeyDown( KEY_ESCAPE ) ) { // Close the window - win->Close(); + win->close(); } - circ += win->Elapsed().asMilliseconds() * 0.5f * op; - circ2 += win->Elapsed().asMilliseconds() * 0.75f; + circ += win->elapsed().asMilliseconds() * 0.5f * op; + circ2 += win->elapsed().asMilliseconds() * 0.75f; if ( op == 1 && circ > 340 ) { @@ -42,7 +42,7 @@ void MainLoop() op = 1; } - Vector2f winCenter( win->GetWidth() * 0.5f, win->GetHeight() * 0.5f ); + Vector2f winCenter( win->getWidth() * 0.5f, win->getHeight() * 0.5f ); GLi->Enable(GL_STENCIL_TEST); @@ -81,19 +81,19 @@ void MainLoop() */ // Draw frame - win->Display(); + win->display(); } // EE_MAIN_FUNC is needed by some platforms to be able to find the real application main EE_MAIN_FUNC int main (int argc, char * argv []) { // Create a new window with vsync enabled - win = Engine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - Empty Window" ), ContextSettings( true ) ); + win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - Empty Window" ), ContextSettings( true ) ); // Check if created - if ( win->Created() ) { + if ( win->created() ) { // Set window background color - win->BackColor( RGB( 50, 50, 50 ) ); + win->backColor( RGB( 50, 50, 50 ) ); GLi->PolygonMode( ); @@ -105,7 +105,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // { // MainLoop(); // } - win->RunMainLoop( &MainLoop ); + win->runMainLoop( &MainLoop ); } // Destroy the engine instance. Destroys all the windows and engine singletons. diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index cf4fd456c..6ab06feaf 100644 --- a/src/examples/external_shader/external_shader.cpp +++ b/src/examples/external_shader/external_shader.cpp @@ -23,9 +23,9 @@ ColorAf * colors = eeNewArray( ColorAf, ParticlesNum ); void videoResize( EE::Window::Window * w ) { /// Video Resize event will re-setup the 2D projection and states, so we must rebuild them. - aspectRatio = (Float)win->GetWidth() / (Float)win->GetHeight(); - tw = (Float)win->GetWidth() / 2; - th = (Float)win->GetHeight() / 2; + aspectRatio = (Float)win->getWidth() / (Float)win->getHeight(); + tw = (Float)win->getWidth() / 2; + th = (Float)win->getHeight() / 2; float fieldOfView = 30.0; float nearPlane = 1.0; @@ -93,31 +93,31 @@ using namespace Demo_ExternalShader; void MainLoop() { - win->Clear(); + win->clear(); - imp->Update(); + imp->update(); - if ( imp->IsKeyDown( KEY_ESCAPE ) ) + if ( imp->isKeyDown( KEY_ESCAPE ) ) { - win->Close(); + win->close(); } - if ( imp->IsKeyUp( KEY_F ) ) + if ( imp->isKeyUp( KEY_F ) ) { - if ( win->Windowed() ) { - win->Size( win->GetDesktopResolution().width(), win->GetDesktopResolution().height(), false ); + if ( win->isWindowed() ) { + win->size( win->getDesktopResolution().width(), win->getDesktopResolution().height(), false ); } else { - win->Size( 960, 640, true ); - win->Center(); + win->size( 960, 640, true ); + win->center(); } } Float p; - Vector2f mf = imp->GetMousePosf(); + Vector2f mf = imp->getMousePosf(); Float tratio = tw / th; Float touchX = ( mf.x / tw - 1 ) * tratio; Float touchY = -( mf.y / th - 1 ); - bool touch = imp->MouseLeftPressed(); + bool touch = imp->mouseLeftPressed(); for( Uint32 i = 0; i < ParticlesNum; i+=2 ) { @@ -195,24 +195,24 @@ void MainLoop() GLi->DrawArrays( DM_LINES, 0, ParticlesNum ); /// Stop the simulation if the window is not visible - while ( !win->Visible() ) { - imp->Update(); /// To get the real state of the window you need to update the window input + while ( !win->visible() ) { + imp->update(); /// To get the real state of the window you need to update the window input Sys::sleep( 100 ); /// Sleep 100 ms } - win->Display(); + win->display(); } EE_MAIN_FUNC int main (int argc, char * argv []) { - win = Engine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - External Shaders" ), ContextSettings( true ) ); + win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - External Shaders" ), ContextSettings( true ) ); - if ( win->Created() ) + if ( win->created() ) { /// This will work without shaders too ShadersSupported = GLi->ShadersSupported(); - imp = win->GetInput(); + imp = win->getInput(); /// We really don't need shaders for this, but the purpose of the example is to show how to work with external shaders if ( ShadersSupported ) { @@ -252,7 +252,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) videoResize( win ); /// Push a window resize callback the reset the projection when needed - win->PushResizeCallback( cb::Make1( &videoResize ) ); + win->pushResizeCallback( cb::Make1( &videoResize ) ); Uint32 i; @@ -272,7 +272,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } #endif - win->RunMainLoop( &MainLoop ); + win->runMainLoop( &MainLoop ); eeSAFE_DELETE_ARRAY( vertices ); eeSAFE_DELETE_ARRAY( velocities ); diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index 85ec9a750..fc142174a 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -11,50 +11,50 @@ TextCache * TxtCache = NULL; void MainLoop() { // Clear the screen buffer - win->Clear(); + win->clear(); // Update the input - win->GetInput()->Update(); + win->getInput()->update(); // Check if ESCAPE key is pressed - if ( win->GetInput()->IsKeyDown( KEY_ESCAPE ) ) { + if ( win->getInput()->isKeyDown( KEY_ESCAPE ) ) { // Close the window - win->Close(); + win->close(); } Float YPos = 32; // Draw the text on screen - TTF->Draw( win->GetWidth() * 0.5f - TTF->GetTextWidth() * 0.5f, YPos ); + TTF->Draw( win->getWidth() * 0.5f - TTF->GetTextWidth() * 0.5f, YPos ); - TTFO->Draw( win->GetWidth() * 0.5f - TTFO->GetTextWidth() * 0.5f, ( YPos += TTF->GetTextHeight() + 24 ) ); + TTFO->Draw( win->getWidth() * 0.5f - TTFO->GetTextWidth() * 0.5f, ( YPos += TTF->GetTextHeight() + 24 ) ); - TTF2->Draw( win->GetWidth() * 0.5f - TTF2->GetTextWidth() * 0.5f, ( YPos += TTF->GetTextHeight() + 24 ) ); + TTF2->Draw( win->getWidth() * 0.5f - TTF2->GetTextWidth() * 0.5f, ( YPos += TTF->GetTextHeight() + 24 ) ); - TexF->Draw( win->GetWidth() * 0.5f - TexF->GetTextWidth() * 0.5f, ( YPos += TTF2->GetTextHeight() + 24 ) ); + TexF->Draw( win->getWidth() * 0.5f - TexF->GetTextWidth() * 0.5f, ( YPos += TTF2->GetTextHeight() + 24 ) ); - TexF2->Draw( win->GetWidth() * 0.5f - TexF2->GetTextWidth() * 0.5f, ( YPos += TexF->GetTextHeight() + 24 ) ); + TexF2->Draw( win->getWidth() * 0.5f - TexF2->GetTextWidth() * 0.5f, ( YPos += TexF->GetTextHeight() + 24 ) ); // Draw the cached text TxtCache->Draw( 48, ( YPos += TexF2->GetTextHeight() + 24 ) ); // Text rotated and scaled - TTF->Draw( win->GetWidth() * 0.5f - TTF->GetTextWidth() * 0.5f, 512, FONT_DRAW_LEFT, Vector2f( 0.75f, 0.75f ), 12.5f ); + TTF->Draw( win->getWidth() * 0.5f - TTF->GetTextWidth() * 0.5f, 512, FONT_DRAW_LEFT, Vector2f( 0.75f, 0.75f ), 12.5f ); // Draw frame - win->Display(); + win->display(); } EE_MAIN_FUNC int main (int argc, char * argv []) { // Create a new window - win = Engine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - Fonts" ), ContextSettings( true ) ); + win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - Fonts" ), ContextSettings( true ) ); // Set window background color - win->BackColor( RGB(255,255,255) ); + win->backColor( RGB(255,255,255) ); // Check if created - if ( win->Created() ) { + if ( win->created() ) { // Get the application path std::string AppPath = Sys::getProcessPath(); @@ -105,7 +105,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) String Txt( "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." ); // Make the text fit the screen width ( wrap the text ) - TTF2->ShrinkText( Txt, win->GetWidth() - 96 ); + TTF2->ShrinkText( Txt, win->getWidth() - 96 ); // Create a new text cache to draw on screen // The cached text will @@ -124,7 +124,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } // Application loop - win->RunMainLoop( &MainLoop ); + win->runMainLoop( &MainLoop ); } eeSAFE_DELETE( TxtCache ); diff --git a/src/examples/physics/physics.cpp b/src/examples/physics/physics.cpp index dea4da158..bd6e158c0 100644 --- a/src/examples/physics/physics.cpp +++ b/src/examples/physics/physics.cpp @@ -113,7 +113,7 @@ void Demo1Create() { CreateJointAndBody(); - mWindow->Caption( "eepp - Physics - Logo Smash" ); + mWindow->caption( "eepp - Physics - Logo Smash" ); mSpace = Physics::Space::New(); mSpace->Iterations( 1 ); @@ -128,8 +128,8 @@ void Demo1Create() { Body * body; Shape * shape; - Float pX = mWindow->GetWidth() / 2 - ( image_width * 4 ) / 2; - Float pY = mWindow->GetHeight() / 2 - ( image_height * 4 ) / 2; + Float pX = mWindow->getWidth() / 2 - ( image_width * 4 ) / 2; + Float pY = mWindow->getHeight() / 2 - ( image_height * 4 ) / 2; for(int y=0; yAddBody( Body::New( INFINITY, INFINITY ) ); - body->Pos( cVectNew( 0, mWindow->GetHeight() / 2 + 16 ) ); + body->Pos( cVectNew( 0, mWindow->getHeight() / 2 + 16 ) ); body->Vel( cVectNew( 400, 0 ) ); shape = mSpace->AddShape( ShapeCircle::New( body, 8.0f, cVectZero ) ); @@ -168,7 +168,7 @@ void Demo2Create() { CreateJointAndBody(); - mWindow->Caption( "eepp - Physics - Pyramid Stack" ); + mWindow->caption( "eepp - Physics - Pyramid Stack" ); Shape::ResetShapeIdCounter(); @@ -179,27 +179,27 @@ void Demo2Create() { Body *body, *statiBody = mSpace->StatiBody(); Shape * shape; - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, mWindow->GetHeight() ), cVectNew( mWindow->GetWidth(), mWindow->GetHeight() ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, mWindow->getHeight() ), cVectNew( mWindow->getWidth(), mWindow->getHeight() ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( mWindow->GetWidth(), 0 ), cVectNew( mWindow->GetWidth(), mWindow->GetHeight() ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( mWindow->getWidth(), 0 ), cVectNew( mWindow->getWidth(), mWindow->getHeight() ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( 0, mWindow->GetHeight() ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( 0, mWindow->getHeight() ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( mWindow->GetWidth(), 0 ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( mWindow->getWidth(), 0 ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - Float hw = mWindow->GetWidth() / 2; + Float hw = mWindow->getWidth() / 2; for(int i=0; i<14; i++){ for(int j=0; j<=i; j++){ @@ -215,7 +215,7 @@ void Demo2Create() { cpFloat radius = 15.0f; body = mSpace->AddBody( Body::New( 10.0f, Moment::ForCircle( 10.0f, 0.0f, radius, cVectZero ) ) ); - body->Pos( cVectNew( hw, mWindow->GetHeight() - radius - 5 ) ); + body->Pos( cVectNew( hw, mWindow->getHeight() - radius - 5 ) ); shape = mSpace->AddShape( ShapeCircle::New( body, radius, cVectZero ) ); shape->e( 0.0f ); @@ -294,7 +294,7 @@ void Demo3Create() { CreateJointAndBody(); - mWindow->Caption( "eepp - Physics - Sensor" ); + mWindow->caption( "eepp - Physics - Sensor" ); Shape::ResetShapeIdCounter(); @@ -307,7 +307,7 @@ void Demo3Create() { emitterInstance.queue = 5; emitterInstance.blocked = 0; - emitterInstance.position = cVectNew( mWindow->GetWidth() / 2 , 150); + emitterInstance.position = cVectNew( mWindow->getWidth() / 2 , 150); shape = mSpace->AddShape( ShapeCircle::New( statiBody, 15.0f, emitterInstance.position ) ); shape->Sensor( 1 ); @@ -460,7 +460,7 @@ void Demo4Create() { CreateJointAndBody(); - mWindow->Caption( "eepp - Physics - Sticky collisions using the Arbiter data pointer." ); + mWindow->caption( "eepp - Physics - Sticky collisions using the Arbiter data pointer." ); mSpace = Space::New(); mSpace->Iterations( 10 ); @@ -572,15 +572,15 @@ void PhysicsCreate() { void PhysicsUpdate() { // Creates a joint to drag any grabable object on the scene - mMousePoint = cVectNew( KM->GetMousePosf().x, KM->GetMousePosf().y ); + mMousePoint = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); cVect newPoint = tovect( cpvlerp( tocpv( mMousePoint_last ), tocpv( mMousePoint ), 0.25 ) ); mMouseBody->Pos( newPoint ); mMouseBody->Vel( ( newPoint - mMousePoint_last ) * (cpFloat)mWindow->FPS() ); mMousePoint_last = newPoint; - if ( KM->MouseLeftPressed() ) { + if ( KM->mouseLeftPressed() ) { if ( NULL == mMouseJoint ) { - cVect point = cVectNew( KM->GetMousePosf().x, KM->GetMousePosf().y ); + cVect point = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); Shape * shape = mSpace->PointQueryFirst( point, GRABABLE_MASK_BIT, CP_NO_GROUP ); @@ -607,37 +607,37 @@ void PhysicsDestroy() { void MainLoop() { - mWindow->Clear(); + mWindow->clear(); - KM->Update(); + KM->update(); - if ( KM->IsKeyDown( KEY_ESCAPE ) ) { - mWindow->Close(); + if ( KM->isKeyDown( KEY_ESCAPE ) ) { + mWindow->close(); } PhysicsUpdate(); - if ( KM->IsKeyUp( KEY_LEFT ) || KM->IsKeyUp( KEY_A ) ) { + if ( KM->isKeyUp( KEY_LEFT ) || KM->isKeyUp( KEY_A ) ) { ChangeDemo( mCurDemo - 1 ); - } else if ( KM->IsKeyUp( KEY_RIGHT ) || KM->IsKeyUp( KEY_D ) ) { + } else if ( KM->isKeyUp( KEY_RIGHT ) || KM->isKeyUp( KEY_D ) ) { ChangeDemo( mCurDemo + 1 ); } - mWindow->Display(); + mWindow->display(); } EE_MAIN_FUNC int main (int argc, char * argv []) { - mWindow = Engine::instance()->CreateWindow( WindowSettings( 1024, 768, "eepp - Physics" ), ContextSettings( true ) ); + mWindow = Engine::instance()->createWindow( WindowSettings( 1024, 768, "eepp - Physics" ), ContextSettings( true ) ); - if ( mWindow->Created() ) { - KM = mWindow->GetInput(); + if ( mWindow->created() ) { + KM = mWindow->getInput(); - mWindow->BackColor( RGB( 255, 255, 255 ) ); + mWindow->backColor( RGB( 255, 255, 255 ) ); PhysicsCreate(); - mWindow->RunMainLoop( &MainLoop ); + mWindow->runMainLoop( &MainLoop ); PhysicsDestroy(); } diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 7424a3908..317649f8d 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -42,26 +42,26 @@ void spriteCallback( Uint32 Event, Sprite * Sprite, void * UserData ) { void MainLoop() { // Clear the screen buffer - win->Clear(); + win->clear(); // Update the input - win->GetInput()->Update(); + win->getInput()->update(); // Check if ESCAPE key is pressed - if ( win->GetInput()->IsKeyDown( KEY_ESCAPE ) ) { + if ( win->getInput()->isKeyDown( KEY_ESCAPE ) ) { // Close the window - win->Close(); + win->close(); } // Check if the D key was pressed - if ( win->GetInput()->IsKeyUp( KEY_D ) ) { + if ( win->getInput()->isKeyUp( KEY_D ) ) { // Reverse the Rock animation Rock->ReverseAnim( !Rock->ReverseAnim() ); } // Update the angle interpolation - PlanetAngle.update( win->Elapsed() ); - RockAngle.update( win->Elapsed() ); + PlanetAngle.update( win->elapsed() ); + RockAngle.update( win->elapsed() ); // Set the Planet and Rock angle from the interpolation Planet->Angle( PlanetAngle.getPos() ); @@ -85,16 +85,16 @@ void MainLoop() P.DrawQuad( Rock->GetQuad() ); // Draw frame - win->Display(); + win->display(); } EE_MAIN_FUNC int main (int argc, char * argv []) { // Create a new window - win = Engine::instance()->CreateWindow( WindowSettings( 640, 480, "eepp - Sprites" ), ContextSettings( true ) ); + win = Engine::instance()->createWindow( WindowSettings( 640, 480, "eepp - Sprites" ), ContextSettings( true ) ); // Check if created - if ( win->Created() ) { + if ( win->created() ) { // Get the application path std::string AppPath = Sys::getProcessPath(); @@ -140,7 +140,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) P.FillMode( DRAW_LINE ); // Set the sprites position to the screen center - Vector2i ScreenCenter( Engine::instance()->GetWidth() / 2, Engine::instance()->GetHeight() / 2 ); + Vector2i ScreenCenter( Engine::instance()->getWidth() / 2, Engine::instance()->getHeight() / 2 ); Planet->Position( ScreenCenter.x - Planet->GetAABB().size().width() / 2, ScreenCenter.y - Planet->GetAABB().size().height() / 2 ); @@ -159,7 +159,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) Rock->SetEventsCallback( cb::Make3( &spriteCallback ), &RockAngle ); // Application loop - win->RunMainLoop( &MainLoop ); + win->runMainLoop( &MainLoop ); } eeSAFE_DELETE( Rock ); diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index 915a3b04b..5bfbe9d6d 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -17,15 +17,15 @@ bool side = false; void MainLoop() { // Clear the screen buffer - win->Clear(); + win->clear(); // Update the input - win->GetInput()->Update(); + win->getInput()->update(); // Check if ESCAPE key is pressed - if ( win->GetInput()->IsKeyDown( KEY_ESCAPE ) ) { + if ( win->getInput()->isKeyDown( KEY_ESCAPE ) ) { // Close the window - win->Close(); + win->close(); } // Bind the Frame Buffer, everything rendered from here will be rendered in the frame buffer @@ -55,8 +55,8 @@ void MainLoop() } } - Float HWidth = win->GetWidth() * 0.5f; - Float HHeight = win->GetHeight() * 0.5f; + Float HWidth = win->getWidth() * 0.5f; + Float HHeight = win->getHeight() * 0.5f; // The batch can be rotated, scale and moved Batch->BatchRotation( ang ); @@ -93,7 +93,7 @@ void MainLoop() Batch->Draw(); // Add the rotation angle - ang+=win->Elapsed().asMilliseconds() * 0.1f; + ang+=win->elapsed().asMilliseconds() * 0.1f; ang = (ang>=360) ? 0 : ang; // Change the scale value @@ -104,22 +104,22 @@ void MainLoop() side = false; scale = 0.5f; } - scale = (!side) ? scale+win->Elapsed().asMilliseconds() * 0.00025f : scale-win->Elapsed().asMilliseconds() * 0.00025f; + scale = (!side) ? scale+win->elapsed().asMilliseconds() * 0.00025f : scale-win->elapsed().asMilliseconds() * 0.00025f; // Draw frame - win->Display(); + win->display(); } EE_MAIN_FUNC int main (int argc, char * argv []) { // Create a new window - win = Engine::instance()->CreateWindow( WindowSettings( 1024, 768, "eepp - VBO - FBO and Batch Rendering" ), ContextSettings( true ) ); + win = Engine::instance()->createWindow( WindowSettings( 1024, 768, "eepp - VBO - FBO and Batch Rendering" ), ContextSettings( true ) ); // Set window background color - win->BackColor( RGB( 50, 50, 50 ) ); + win->backColor( RGB( 50, 50, 50 ) ); // Check if created - if ( win->Created() ) { + if ( win->created() ) { Polygon2f Poly( Polygon2f::createRoundedRectangle( 0, 0, 200, 50 ) ); // Create the Vertex Buffer, the vertex buffer stores the vertex data in the GPU, making the rendering much faster @@ -150,7 +150,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) FBO = FrameBuffer::New( 200, 200 ); // Application loop - win->RunMainLoop( &MainLoop ); + win->runMainLoop( &MainLoop ); // Release the allocated objects ( VBOs and FBOs need to be released manually ) eeSAFE_DELETE( VBO ); diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index f9abb4b48..f2f9f8090 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -52,23 +52,23 @@ void EETest::Init() { mMusEnabled = Ini.getValueB( "EEPP", "Music", false ); Int32 StartScreen = Ini.getValueI( "EEPP", "StartScreen", 0 ); - WindowSettings WinSettings = EE->CreateWindowSettings( &Ini ); - ContextSettings ConSettings = EE->CreateContextSettings( &Ini ); + WindowSettings WinSettings = EE->createWindowSettings( &Ini ); + ContextSettings ConSettings = EE->createContextSettings( &Ini ); - mWindow = EE->CreateWindow( WinSettings, ConSettings ); + mWindow = EE->createWindow( WinSettings, ConSettings ); - if ( NULL != mWindow && mWindow->Created() ) { + if ( NULL != mWindow && mWindow->created() ) { SetScreen( StartScreen ); - mWindow->Caption( "eepp - Test Application" ); - mWindow->PushResizeCallback( cb::Make1( this, &EETest::OnWindowResize ) ); + mWindow->caption( "eepp - Test Application" ); + mWindow->pushResizeCallback( cb::Make1( this, &EETest::OnWindowResize ) ); TF = TextureFactory::instance(); TF->Allocate(40); Log = Log::instance(); - KM = mWindow->GetInput(); - JM = KM->GetJoystickManager(); + KM = mWindow->getInput(); + JM = KM->getJoystickManager(); PS.resize(5); @@ -80,7 +80,7 @@ void EETest::Init() { Scenes[5] = cb::Make0( this, &EETest::Screen5 ); //InBuf.Start(); - InBuf.SupportNewLine( true ); + InBuf.supportNewLine( true ); setRandomSeed( static_cast( Sys::getSystemTime() * 1000 ) ); @@ -244,7 +244,7 @@ void EETest::OnShowMenu( const UIEvent * Event ) { } void EETest::OnWindowResize(EE::Window::Window * win) { - Map.ViewSize( win->Size() ); + Map.ViewSize( win->size() ); } void EETest::CreateUI() { @@ -679,12 +679,12 @@ void EETest::ItemClick( const UIEvent * Event ) { SetScreen( 5 ); } else if ( "Show Console" == txt ) { Con.Toggle(); - InBuf.Active( !Con.Active() ); + InBuf.active( !Con.Active() ); if ( Con.Active() ) { - mWindow->StartTextInput(); + mWindow->startTextInput(); } else { - mWindow->StopTextInput(); + mWindow->stopTextInput(); } } else if ( "Show Window" == txt ) { UIMenuCheckBox * Chk = reinterpret_cast ( Event->Ctrl() ); @@ -739,13 +739,13 @@ void EETest::QuitClick( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( MouseEvent->Flags() & EE_BUTTON_LMASK ) { - mWindow->Close(); + mWindow->close(); } } void EETest::ShowMenu() { if ( Menu->Show() ) { - Vector2i Pos = mWindow->GetInput()->GetMousePos(); + Vector2i Pos = mWindow->getInput()->getMousePos(); UIMenu::FixMenuPos( Pos , Menu ); Menu->Pos( Pos ); } @@ -771,7 +771,7 @@ void EETest::ButtonClick( const UIEvent * Event ) { Gfx->Enabled( false ); Gfx->StartRotation( 0, 2500, Milliseconds( 2500 ) ); - Gfx->StartMovement( Vector2i( Math::randi( 0, mWindow->GetWidth() ), -64 ), Vector2i( Math::randi( 0, mWindow->GetWidth() ), mWindow->GetHeight() + 64 ), Milliseconds( 2500 ) ); + Gfx->StartMovement( Vector2i( Math::randi( 0, mWindow->getWidth() ), -64 ), Vector2i( Math::randi( 0, mWindow->getWidth() ), mWindow->getHeight() + 64 ), Milliseconds( 2500 ) ); Gfx->CloseFadeOut( Milliseconds( 3500 ) ); mListBox->AddListBoxItem( "Test ListBox " + String::toStr( mListBox->Count() + 1 ) + " testing it right now!" ); @@ -782,9 +782,9 @@ void EETest::SetScreen( Uint32 num ) { if ( NULL != mTerrainBut ) mTerrainBut->Visible( 1 == num ); if ( 0 == num || 5 == num ) - mWindow->BackColor( RGB( 240, 240, 240 ) ); + mWindow->backColor( RGB( 240, 240, 240 ) ); else - mWindow->BackColor( RGB( 0, 0, 0 ) ); + mWindow->backColor( RGB( 0, 0, 0 ) ); if ( num < 6 ) Screen = num; @@ -797,7 +797,7 @@ void EETest::CmdSetPartsNum ( const std::vector < String >& params ) { bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt >= 0 && tInt <= 100000 ) ) { - PS[2].Create( PSE_WormHole, tInt, TN[5], Vector2f( mWindow->GetWidth() * 0.5f, mWindow->GetHeight() * 0.5f ), 32, true ); + PS[2].Create( PSE_WormHole, tInt, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 32, true ); Con.PushText( "Wormhole Particles Number Changed to: " + String::toStr(tInt) ); } else Con.PushText( "Valid parameters are between 0 and 100000 (0 = no limit)." ); @@ -818,7 +818,7 @@ void EETest::LoadTextures() { #ifndef EE_GLES #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX - Engine::instance()->EnableSharedGLContext(); + Engine::instance()->enableSharedGLContext(); #endif PakTest->open( MyPath + "test.zip" ); @@ -876,8 +876,8 @@ void EETest::LoadTextures() { PS[0].SetCallbackReset( cb::Make2( this, &EETest::ParticlesCallback ) ); PS[0].Create( PSE_Callback, 500, TN[5], Vector2f( 0, 0 ), 16, true ); - PS[1].Create( PSE_Heal, 250, TN[5], Vector2f( mWindow->GetWidth() * 0.5f, mWindow->GetHeight() * 0.5f ), 16, true ); - PS[2].Create( PSE_WormHole, PartsNum, TN[5], Vector2f( mWindow->GetWidth() * 0.5f, mWindow->GetHeight() * 0.5f ), 32, true ); + PS[1].Create( PSE_Heal, 250, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 16, true ); + PS[2].Create( PSE_WormHole, PartsNum, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 32, true ); PS[3].Create( PSE_Fire, 350, TN[5], Vector2f( -50.f, -50.f ), 32, true ); PS[4].Create( PSE_Fire, 350, TN[5], Vector2f( -50.f, -50.f ), 32, true ); @@ -906,12 +906,12 @@ void EETest::LoadTextures() { Cursor[0] = TF->Load( MyPath + "cursors/cursor.tga" ); CursorP[0] = TF->GetTexture( Cursor[0] ); - CursorManager * CurMan = mWindow->GetCursorManager(); - CurMan->Visible( false ); - CurMan->Visible( true ); - CurMan->Set( EE::Window::SYS_CURSOR_HAND ); - CurMan->SetGlobalCursor( EE_CURSOR_ARROW, CurMan->Add( CurMan->Create( CursorP[0], Vector2i( 1, 1 ), "cursor_special" ) ) ); - CurMan->Set( EE_CURSOR_ARROW ); + CursorManager * CurMan = mWindow->getCursorManager(); + CurMan->visible( false ); + CurMan->visible( true ); + CurMan->set( EE::Window::SYS_CURSOR_HAND ); + CurMan->setGlobalCursor( EE_CURSOR_ARROW, CurMan->add( CurMan->create( CursorP[0], Vector2i( 1, 1 ), "cursor_special" ) ) ); + CurMan->set( EE_CURSOR_ARROW ); CL1.AddFrame( TN[2] ); CL1.Position( 500, 400 ); @@ -934,7 +934,7 @@ void EETest::LoadTextures() { Map.DrawGrid( false ); Map.ClipedArea( false ); Map.DrawBackground( false ); - Map.ViewSize( mWindow->Size() ); + Map.ViewSize( mWindow->size() ); eePRINTL( "Map creation time: %4.3f ms.", TE.elapsed().asMilliseconds() ); } @@ -944,7 +944,7 @@ void EETest::run() { } void EETest::ParticlesThread() { - while ( mWindow->Running() ) { + while ( mWindow->isRunning() ) { UpdateParticles(); Sys::sleep(10); } @@ -972,8 +972,8 @@ void EETest::Screen2() { TexLoaded->Draw( 0, 0 ); } - if ( KM->MouseLeftPressed() ) - TNP[3]->DrawEx( 0.f, 0.f, (Float)mWindow->GetWidth(), (Float)mWindow->GetHeight() ); + if ( KM->mouseLeftPressed() ) + TNP[3]->DrawEx( 0.f, 0.f, (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ); Batch.SetTexture( TNP[2] ); Batch.QuadsBegin(); @@ -1050,7 +1050,7 @@ void EETest::Screen2() { } ColorA Col(255,255,255,(int)alpha); - TNP[1]->DrawEx( (Float)mWindow->GetWidth() - 128.f, (Float)mWindow->GetHeight() - 128.f, 128.f, 128.f, ang, Vector2f::One, Col, Col, Col, Col, ALPHA_BLENDONE, RN_FLIPMIRROR); + TNP[1]->DrawEx( (Float)mWindow->getWidth() - 128.f, (Float)mWindow->getHeight() - 128.f, 128.f, 128.f, ang, Vector2f::One, Col, Col, Col, Col, ALPHA_BLENDONE, RN_FLIPMIRROR); SP.Position( alpha, alpha ); SP.Draw(); @@ -1084,7 +1084,7 @@ void EETest::Screen2() { PR.DrawQuad( CL1.GetQuad() ); #endif - Ang = Ang + mWindow->Elapsed().asMilliseconds() * 0.1f; + Ang = Ang + mWindow->elapsed().asMilliseconds() * 0.1f; if (Ang > 360.f) Ang = 1.f; if ( ShowParticles ) @@ -1092,9 +1092,9 @@ void EETest::Screen2() { PR.SetColor( ColorA(0, 255, 0, 50) ); - Line2f Line( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->GetWidth(), (Float)mWindow->GetHeight() ) ); + Line2f Line( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ); Line2f Line2( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ); - Line2f Line3( Vector2f((Float)mWindow->GetWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->GetHeight() ) ); + Line2f Line3( Vector2f((Float)mWindow->getWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->getHeight() ) ); Line2f Line4( Vector2f(Mousef.x - 80.f, Mousef.y + 80.f), Vector2f(Mousef.x + 80.f, Mousef.y - 80.f) ); if ( Line.intersect( Line2 ) ) @@ -1119,12 +1119,12 @@ void EETest::Screen2() { PR.DrawTriangle( Triangle2f( Vector2f( Mousef.x, Mousef.y - 10.f ), Vector2f( Mousef.x - 10.f, Mousef.y + 10.f ), Vector2f( Mousef.x + 10.f, Mousef.y + 10.f ) ) ); PR.DrawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ) ); PR.DrawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y + 80.f), Vector2f(Mousef.x + 80.f, Mousef.y - 80.f) ) ); - PR.DrawLine( Line2f( Vector2f((Float)mWindow->GetWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->GetHeight() ) ) ); + PR.DrawLine( Line2f( Vector2f((Float)mWindow->getWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->getHeight() ) ) ); PR.FillMode( DRAW_FILL ); PR.DrawQuad( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); PR.FillMode( DRAW_LINE ); PR.DrawRectangle( Rectf( Vector2f( Mousef.x - 80.f, Mousef.y - 80.f ), Sizef( 160.f, 160.f ) ), 45.f ); - PR.DrawLine( Line2f( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->GetWidth(), (Float)mWindow->GetHeight() ) ) ); + PR.DrawLine( Line2f( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ) ); TNP[3]->DrawQuadEx( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Vector2f(), ang, Vector2f(scale,scale), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); @@ -1173,7 +1173,7 @@ void EETest::Screen4() { mFBO->Unbind(); if ( NULL != mFBO->GetTexture() ) { - mFBO->GetTexture()->Draw( (Float)mWindow->GetWidth() * 0.5f - (Float)mFBO->GetWidth() * 0.5f, (Float)mWindow->GetHeight() * 0.5f - (Float)mFBO->GetHeight() * 0.5f, Ang ); + mFBO->GetTexture()->Draw( (Float)mWindow->getWidth() * 0.5f - (Float)mFBO->GetWidth() * 0.5f, (Float)mWindow->getHeight() * 0.5f - (Float)mFBO->GetHeight() * 0.5f, Ang ); GlobalBatchRenderer::instance()->Draw(); } } @@ -1184,8 +1184,8 @@ void EETest::Screen5() { } void EETest::Render() { - HWidth = mWindow->GetWidth() * 0.5f; - HHeight = mWindow->GetHeight() * 0.5f; + HWidth = mWindow->getWidth() * 0.5f; + HHeight = mWindow->getHeight() * 0.5f; if ( Sys::getTicks() - lasttick >= 50 ) { lasttick = Sys::getTicks(); @@ -1215,23 +1215,23 @@ void EETest::Render() { if ( !MultiViewportMode ) { Scenes[ Screen ](); } else { - Views[0].SetView( 0, 0, mWindow->GetWidth(), static_cast( HHeight ) ); - Views[1].SetView( 0, static_cast ( HHeight ), mWindow->GetWidth(), static_cast( HHeight ) ); + Views[0].setView( 0, 0, mWindow->getWidth(), static_cast( HHeight ) ); + Views[1].setView( 0, static_cast ( HHeight ), mWindow->getWidth(), static_cast( HHeight ) ); - mWindow->SetView( Views[1] ); - Mouse = KM->GetMousePosFromView( Views[1] ); + mWindow->setView( Views[1] ); + Mouse = KM->getMousePosFromView( Views[1] ); Mousef = Vector2f( (Float)Mouse.x, (Float)Mouse.y ); Screen2(); - mWindow->SetView( Views[0] ); - Mouse = KM->GetMousePosFromView( Views[0] ); + mWindow->setView( Views[0] ); + Mouse = KM->getMousePosFromView( Views[0] ); Mousef = Vector2f( (Float)Mouse.x, (Float)Mouse.y ); Screen1(); - mWindow->SetView( mWindow->GetDefaultView() ); - mWindow->ClipEnable( (Int32)HWidth - 320, (Int32)HHeight - 240, 640, 480 ); + mWindow->setView( mWindow->getDefaultView() ); + mWindow->clipEnable( (Int32)HWidth - 320, (Int32)HHeight - 240, 640, 480 ); Screen3(); - mWindow->ClipDisable(); + mWindow->clipDisable(); } ColorA ColRR1( 150, 150, 150, 220 ); @@ -1247,7 +1247,7 @@ void EETest::Render() { Rectf( Vector2f( 0.f, - (Float)mWindow->GetHeight() - mEEText.GetTextHeight() + (Float)mWindow->getHeight() - mEEText.GetTextHeight() ), Vector2f( mEEText.GetTextWidth(), @@ -1257,24 +1257,24 @@ void EETest::Render() { ColRR1, ColRR2, ColRR3, ColRR4 ); - mEEText.Draw( 0.f, (Float)mWindow->GetHeight() - mEEText.GetTextHeight() ); + mEEText.Draw( 0.f, (Float)mWindow->getHeight() - mEEText.GetTextHeight() ); mInfoText.Draw( 6.f, 6.f ); - if ( InBuf.Active() ) { + if ( InBuf.active() ) { Uint32 NLPos = 0; - Uint32 LineNum = InBuf.GetCurPosLinePos( NLPos ); - if ( InBuf.CurPos() == (int)InBuf.Buffer().size() && !LineNum ) { + Uint32 LineNum = InBuf.getCurPosLinePos( NLPos ); + if ( InBuf.curPos() == (int)InBuf.buffer().size() && !LineNum ) { FF2->Draw( "_", 6.f + FF2->GetTextWidth(), 180.f ); } else { - FF2->SetText( InBuf.Buffer().substr( NLPos, InBuf.CurPos() - NLPos ) ); + FF2->SetText( InBuf.buffer().substr( NLPos, InBuf.curPos() - NLPos ) ); FF2->Draw( "_", 6.f + FF2->GetTextWidth(), 180.f + (Float)LineNum * (Float)FF2->GetFontHeight() ); } FF2->SetText( "FPS: " + String::toStr( mWindow->FPS() ) ); - FF2->Draw( mWindow->GetWidth() - FF2->GetTextWidth() - 15, 0 ); + FF2->Draw( mWindow->getWidth() - FF2->GetTextWidth() - 15, 0 ); - FF2->SetText( InBuf.Buffer() ); + FF2->SetText( InBuf.buffer() ); FF2->Draw( 6, 180, FONT_DRAW_SHADOW ); } @@ -1286,120 +1286,120 @@ void EETest::Render() { } void EETest::Input() { - KM->Update(); - JM->Update(); + KM->update(); + JM->update(); - Mouse = KM->GetMousePos(); + Mouse = KM->getMousePos(); Mousef = Vector2f( (Float)Mouse.x, (Float)Mouse.y ); - if ( KM->IsKeyUp( KEY_F1 ) ) + if ( KM->isKeyUp( KEY_F1 ) ) Graphics::ShaderProgramManager::instance()->Reload(); - if ( !mWindow->Visible() ) { + if ( !mWindow->visible() ) { mWasMinimized = true; - mWindow->FrameRateLimit( 10 ); + mWindow->frameRateLimit( 10 ); if ( mMusEnabled && Mus->state() == Sound::Playing ) Mus->pause(); } else { - if ( mLastFPSLimit != mWindow->FrameRateLimit() && !mWasMinimized ) - mLastFPSLimit = mWindow->FrameRateLimit(); + if ( mLastFPSLimit != mWindow->frameRateLimit() && !mWasMinimized ) + mLastFPSLimit = mWindow->frameRateLimit(); if ( mWasMinimized ) { mWasMinimized = false; - if ( !mWindow->Windowed() ) - KM->GrabInput( true ); + if ( !mWindow->isWindowed() ) + KM->grabInput( true ); } - mWindow->FrameRateLimit( mLastFPSLimit ); + mWindow->frameRateLimit( mLastFPSLimit ); if ( mMusEnabled && Mus->state() == Sound::Paused ) Mus->play(); } - if ( KM->IsKeyDown( KEY_ESCAPE ) ) - mWindow->Close(); + if ( KM->isKeyDown( KEY_ESCAPE ) ) + mWindow->close(); - if ( KM->IsKeyUp( KEY_F1 ) ) + if ( KM->isKeyUp( KEY_F1 ) ) MultiViewportMode = !MultiViewportMode; - if ( KM->AltPressed() && KM->IsKeyUp( KEY_C ) ) - mWindow->Center(); + if ( KM->altPressed() && KM->isKeyUp( KEY_C ) ) + mWindow->center(); - if ( KM->AltPressed() && KM->IsKeyUp( KEY_M ) && !Con.Active() ) { - if ( !mWindow->IsMaximized() ) - mWindow->Maximize(); + if ( KM->altPressed() && KM->isKeyUp( KEY_M ) && !Con.Active() ) { + if ( !mWindow->isMaximized() ) + mWindow->maximize(); } - if ( KM->IsKeyUp(KEY_F4) ) + if ( KM->isKeyUp(KEY_F4) ) TF->ReloadAllTextures(); - if ( KM->AltPressed() && KM->IsKeyUp( KEY_RETURN ) ) { - if ( mWindow->Windowed() ) { - mWindow->Size( mWindow->GetDesktopResolution().width(), mWindow->GetDesktopResolution().height(), false ); + if ( KM->altPressed() && KM->isKeyUp( KEY_RETURN ) ) { + if ( mWindow->isWindowed() ) { + mWindow->size( mWindow->getDesktopResolution().width(), mWindow->getDesktopResolution().height(), false ); } else { - mWindow->ToggleFullscreen(); + mWindow->toggleFullscreen(); } } - if ( KM->GrabInput() ) { - if ( KM->AltPressed() && KM->IsKeyDown( KEY_TAB ) ) { - mWindow->Minimize(); + if ( KM->grabInput() ) { + if ( KM->altPressed() && KM->isKeyDown( KEY_TAB ) ) { + mWindow->minimize(); - if ( KM->GrabInput() ) - KM->GrabInput( false ); + if ( KM->grabInput() ) + KM->grabInput( false ); } } - if ( KM->ControlPressed() && KM->IsKeyUp(KEY_G) ) - KM->GrabInput( !KM->GrabInput() ); + if ( KM->controlPressed() && KM->isKeyUp(KEY_G) ) + KM->grabInput( !KM->grabInput() ); - if ( KM->IsKeyUp( KEY_F3 ) || KM->IsKeyUp( KEY_WORLD_26 ) || KM->IsKeyUp( KEY_BACKSLASH ) ) { + if ( KM->isKeyUp( KEY_F3 ) || KM->isKeyUp( KEY_WORLD_26 ) || KM->isKeyUp( KEY_BACKSLASH ) ) { Con.Toggle(); - InBuf.Active( !Con.Active() ); + InBuf.active( !Con.Active() ); } - if ( KM->IsKeyUp(KEY_1) && KM->ControlPressed() ) + if ( KM->isKeyUp(KEY_1) && KM->controlPressed() ) SetScreen( 0 ); - if ( KM->IsKeyUp(KEY_2) && KM->ControlPressed() ) + if ( KM->isKeyUp(KEY_2) && KM->controlPressed() ) SetScreen( 1 ); - if ( KM->IsKeyUp(KEY_3) && KM->ControlPressed() ) + if ( KM->isKeyUp(KEY_3) && KM->controlPressed() ) SetScreen( 2 ); - if ( KM->IsKeyUp(KEY_4) && KM->ControlPressed() ) + if ( KM->isKeyUp(KEY_4) && KM->controlPressed() ) SetScreen( 3 ); - if ( KM->IsKeyUp(KEY_5) && KM->ControlPressed() ) + if ( KM->isKeyUp(KEY_5) && KM->controlPressed() ) SetScreen( 4 ); - if ( KM->IsKeyUp(KEY_6) && KM->ControlPressed() ) + if ( KM->isKeyUp(KEY_6) && KM->controlPressed() ) SetScreen( 5 ); - Joystick * Joy = JM->GetJoystick(0); + Joystick * Joy = JM->getJoystick(0); if ( mJoyEnabled && NULL != Joy ) { - if ( Joy->IsButtonDown(0) ) KM->InjectButtonPress(EE_BUTTON_LEFT); - if ( Joy->IsButtonDown(1) ) KM->InjectButtonPress(EE_BUTTON_RIGHT); - if ( Joy->IsButtonDown(2) ) KM->InjectButtonPress(EE_BUTTON_MIDDLE); - if ( Joy->IsButtonUp(0) ) KM->InjectButtonRelease(EE_BUTTON_LEFT); - if ( Joy->IsButtonUp(1) ) KM->InjectButtonRelease(EE_BUTTON_RIGHT); - if ( Joy->IsButtonUp(2) ) KM->InjectButtonRelease(EE_BUTTON_MIDDLE); - if ( Joy->IsButtonUp(3) ) KM->InjectButtonRelease(EE_BUTTON_WHEELUP); - if ( Joy->IsButtonUp(7) ) KM->InjectButtonRelease(EE_BUTTON_WHEELDOWN); - if ( Joy->IsButtonUp(4) ) SetScreen( 0 ); - if ( Joy->IsButtonUp(5) ) SetScreen( 1 ); - if ( Joy->IsButtonUp(6) ) SetScreen( 2 ); + if ( Joy->isButtonDown(0) ) KM->injectButtonPress(EE_BUTTON_LEFT); + if ( Joy->isButtonDown(1) ) KM->injectButtonPress(EE_BUTTON_RIGHT); + if ( Joy->isButtonDown(2) ) KM->injectButtonPress(EE_BUTTON_MIDDLE); + if ( Joy->isButtonUp(0) ) KM->injectButtonRelease(EE_BUTTON_LEFT); + if ( Joy->isButtonUp(1) ) KM->injectButtonRelease(EE_BUTTON_RIGHT); + if ( Joy->isButtonUp(2) ) KM->injectButtonRelease(EE_BUTTON_MIDDLE); + if ( Joy->isButtonUp(3) ) KM->injectButtonRelease(EE_BUTTON_WHEELUP); + if ( Joy->isButtonUp(7) ) KM->injectButtonRelease(EE_BUTTON_WHEELDOWN); + if ( Joy->isButtonUp(4) ) SetScreen( 0 ); + if ( Joy->isButtonUp(5) ) SetScreen( 1 ); + if ( Joy->isButtonUp(6) ) SetScreen( 2 ); - Float aX = Joy->GetAxis( AXIS_X ); - Float aY = Joy->GetAxis( AXIS_Y ); + Float aX = Joy->getAxis( AXIS_X ); + Float aY = Joy->getAxis( AXIS_Y ); if ( 0 != aX || 0 != aY ) { - double rE = mWindow->Elapsed().asMilliseconds(); + double rE = mWindow->elapsed().asMilliseconds(); mAxisX += aX * rE; mAxisY += aY * rE; } @@ -1410,10 +1410,10 @@ void EETest::Input() { nmX = eemax( nmX, 0 ); nmY = eemax( nmY, 0 ); - nmX = eemin( nmX, (Float)EE->GetWidth() ); - nmY = eemin( nmY, (Float)EE->GetHeight() ); + nmX = eemin( nmX, (Float)EE->getWidth() ); + nmY = eemin( nmY, (Float)EE->getHeight() ); - KM->InjectMousePos( (Int32)nmX, (Int32)nmY ); + KM->injectMousePos( (Int32)nmX, (Int32)nmY ); nmX -= (Int32)nmX; nmY -= (Int32)nmY; @@ -1425,72 +1425,72 @@ void EETest::Input() { switch (Screen) { case 0: - if ( KM->IsKeyUp( KEY_R ) ) { + if ( KM->isKeyUp( KEY_R ) ) { PhysicsDestroy(); PhysicsCreate(); } - if ( KM->IsKeyUp( KEY_1 ) ) + if ( KM->isKeyUp( KEY_1 ) ) ChangeDemo( 0 ); - if ( KM->IsKeyUp( KEY_2 ) ) + if ( KM->isKeyUp( KEY_2 ) ) ChangeDemo( 1 ); case 1: if ( NULL != Joy ) { - Uint8 hat = Joy->GetHat(); + Uint8 hat = Joy->getHat(); if ( HAT_LEFT == hat || HAT_LEFTDOWN == hat || HAT_LEFTUP == hat ) - Map.Move( (mWindow->Elapsed().asMilliseconds() * 0.2f), 0 ); + Map.Move( (mWindow->elapsed().asMilliseconds() * 0.2f), 0 ); if ( HAT_RIGHT == hat || HAT_RIGHTDOWN == hat || HAT_RIGHTUP == hat ) - Map.Move( -mWindow->Elapsed().asMilliseconds() * 0.2f, 0 ); + Map.Move( -mWindow->elapsed().asMilliseconds() * 0.2f, 0 ); if ( HAT_UP == hat || HAT_LEFTUP == hat || HAT_RIGHTUP == hat ) - Map.Move( 0, (mWindow->Elapsed().asMilliseconds() * 0.2f) ); + Map.Move( 0, (mWindow->elapsed().asMilliseconds() * 0.2f) ); if ( HAT_DOWN == hat || HAT_LEFTDOWN == hat || HAT_RIGHTDOWN == hat ) - Map.Move( 0, -mWindow->Elapsed().asMilliseconds() * 0.2f ); + Map.Move( 0, -mWindow->elapsed().asMilliseconds() * 0.2f ); } - if ( KM->IsKeyDown(KEY_LEFT) ) { - Map.Move( mWindow->Elapsed().asMilliseconds() * 0.2f, 0 ); + if ( KM->isKeyDown(KEY_LEFT) ) { + Map.Move( mWindow->elapsed().asMilliseconds() * 0.2f, 0 ); } - if ( KM->IsKeyDown(KEY_RIGHT) ) { - Map.Move( -mWindow->Elapsed().asMilliseconds() * 0.2f, 0 ); + if ( KM->isKeyDown(KEY_RIGHT) ) { + Map.Move( -mWindow->elapsed().asMilliseconds() * 0.2f, 0 ); } - if ( KM->IsKeyDown(KEY_UP) ) { - Map.Move( 0, mWindow->Elapsed().asMilliseconds() * 0.2f ); + if ( KM->isKeyDown(KEY_UP) ) { + Map.Move( 0, mWindow->elapsed().asMilliseconds() * 0.2f ); } - if ( KM->IsKeyDown(KEY_DOWN) ) { - Map.Move( 0, -mWindow->Elapsed().asMilliseconds() * 0.2f ); + if ( KM->isKeyDown(KEY_DOWN) ) { + Map.Move( 0, -mWindow->elapsed().asMilliseconds() * 0.2f ); } - if ( KM->IsKeyUp(KEY_F8) ) + if ( KM->isKeyUp(KEY_F8) ) Map.Reset(); break; case 2: - if ( KM->IsKeyUp(KEY_S) ) + if ( KM->isKeyUp(KEY_S) ) SP.SetRepeations(1); - if ( KM->IsKeyUp(KEY_A) ) + if ( KM->isKeyUp(KEY_A) ) SP.SetRepeations(-1); - if ( KM->IsKeyUp(KEY_D) ) + if ( KM->isKeyUp(KEY_D) ) SP.ReverseAnim( !SP.ReverseAnim() ); - if ( KM->MouseRightPressed() ) + if ( KM->mouseRightPressed() ) DrawBack = true; else DrawBack = false; - if ( KM->IsKeyUp( KEY_P ) ) + if ( KM->isKeyUp( KEY_P ) ) SndMng.play( "mysound" ); - if ( KM->ControlPressed() && KM->IsKeyUp(KEY_P) ) { + if ( KM->controlPressed() && KM->isKeyUp(KEY_P) ) { ShowParticles = !ShowParticles; } @@ -1499,9 +1499,9 @@ void EETest::Input() { } void EETest::Update() { - mWindow->Clear(); + mWindow->clear(); - et = mWindow->Elapsed(); + et = mWindow->elapsed(); Input(); @@ -1517,18 +1517,18 @@ void EETest::Update() { UpdateParticles(); #endif - if ( KM->IsKeyUp(KEY_F12) ) mWindow->TakeScreenshot( MyPath + "screenshots/" ); //After render and before Display + if ( KM->isKeyUp(KEY_F12) ) mWindow->takeScreenshot( MyPath + "screenshots/" ); //After render and before Display - mWindow->Display(false); + mWindow->display(false); } void EETest::Process() { Init(); - if ( NULL != mWindow && mWindow->Created() ) { + if ( NULL != mWindow && mWindow->created() ) { TestInstance = this; - mWindow->RunMainLoop( &MainLoop ); + mWindow->runMainLoop( &MainLoop ); } End(); @@ -1586,27 +1586,27 @@ void EETest::Demo1Create() { Body *body, *statiBody = mSpace->StatiBody(); Shape * shape; - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, mWindow->GetHeight() ), cVectNew( mWindow->GetWidth(), mWindow->GetHeight() ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, mWindow->getHeight() ), cVectNew( mWindow->getWidth(), mWindow->getHeight() ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( mWindow->GetWidth(), 0 ), cVectNew( mWindow->GetWidth(), mWindow->GetHeight() ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( mWindow->getWidth(), 0 ), cVectNew( mWindow->getWidth(), mWindow->getHeight() ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( 0, mWindow->GetHeight() ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( 0, mWindow->getHeight() ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( mWindow->GetWidth(), 0 ), 0.0f ) ); + shape = mSpace->AddShape( ShapeSegment::New( statiBody, cVectNew( 0, 0 ), cVectNew( mWindow->getWidth(), 0 ), 0.0f ) ); shape->e( 1.0f ); shape->u( 1.0f ); shape->Layers( NOT_GRABABLE_MASK ); - Float hw = mWindow->GetWidth() / 2; + Float hw = mWindow->getWidth() / 2; for(int i=0; i<14; i++){ for(int j=0; j<=i; j++){ @@ -1623,7 +1623,7 @@ void EETest::Demo1Create() { cpFloat radius = 15.0f; body = mSpace->AddBody( Body::New( 10.0f, Moment::ForCircle( 10.0f, 0.0f, radius, cVectZero ) ) ); - body->Pos( cVectNew( hw, mWindow->GetHeight() - radius - 5 ) ); + body->Pos( cVectNew( hw, mWindow->getHeight() - radius - 5 ) ); //shape = mSpace->AddShape( ShapeCircleSprite::New( body, radius, cVectZero, mCircleSprite ) ); shape = mSpace->AddShape( ShapeCircle::New( body, radius, cVectZero ) ); @@ -1720,7 +1720,7 @@ void EETest::Demo2Create() { emitterInstance.queue = 5; emitterInstance.blocked = 0; - emitterInstance.position = cVectNew( mWindow->GetWidth() / 2 , 150); + emitterInstance.position = cVectNew( mWindow->getWidth() / 2 , 150); shape = mSpace->AddShape( ShapeCircle::New( statiBody, 15.0f, emitterInstance.position ) ); shape->Sensor( 1 ); @@ -1807,15 +1807,15 @@ void EETest::PhysicsCreate() { void EETest::PhysicsUpdate() { #ifndef EE_PLATFORM_TOUCH - mMousePoint = cVectNew( KM->GetMousePosf().x, KM->GetMousePosf().y ); + mMousePoint = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); cVect newPoint = tovect( cpvlerp( tocpv( mMousePoint_last ), tocpv( mMousePoint ), 0.25 ) ); mMouseBody->Pos( newPoint ); mMouseBody->Vel( ( newPoint - mMousePoint_last ) * (cpFloat)mWindow->FPS() ); mMousePoint_last = newPoint; - if ( KM->MouseLeftPressed() ) { + if ( KM->mouseLeftPressed() ) { if ( NULL == mMouseJoint ) { - cVect point = cVectNew( KM->GetMousePosf().x, KM->GetMousePosf().y ); + cVect point = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); Shape * shape = mSpace->PointQueryFirst( point, GRABABLE_MASK_BIT, CP_NO_GROUP ); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index f22a6001d..e51b2297d 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -36,9 +36,9 @@ class UITest : public UIControlAnim { virtual Uint32 OnMouseUp( const Vector2i& Pos, const Uint32 Flags ) { UIDragable::OnMouseUp( Pos, Flags ); - if ( Engine::instance()->GetCurrentWindow()->GetInput()->MouseWheelUp() ) + if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelUp() ) Scale( Scale() + 0.1f ); - else if ( Engine::instance()->GetCurrentWindow()->GetInput()->MouseWheelDown() ) + else if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelDown() ) Scale( Scale() - 0.1f ); return 1;