diff --git a/Doxyfile b/Doxyfile index e4bb04965..37a58cf6b 100644 --- a/Doxyfile +++ b/Doxyfile @@ -898,7 +898,7 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = pugi, EE::Maps::Private, EE::Graphics::Private, EE::System::Private +EXCLUDE_SYMBOLS = pugi, EE::Maps::Private, EE::Graphics::Private, EE::System::Private, EE::System::Platform, EE::Window::Platform, EE::Window::Backend # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include diff --git a/include/eepp/graphics/batchrenderer.hpp b/include/eepp/graphics/batchrenderer.hpp index 9380c8377..33acd5698 100644 --- a/include/eepp/graphics/batchrenderer.hpp +++ b/include/eepp/graphics/batchrenderer.hpp @@ -14,7 +14,8 @@ using namespace EE::System; namespace EE { namespace Graphics { -struct eeVertex { +/// Holds the position texture UV and color of a vertex. +struct VertexData { Vector2f pos; Vector2f tex; Color color; @@ -143,7 +144,7 @@ class EE_API BatchRenderer { const PrimitiveType& primitiveType = PRIMITIVE_POINTS ); /** Adds to the batch a point list */ - void batchPointList( const std::vector& points, + void batchPointList( const std::vector& points, const PrimitiveType& primitiveType = PRIMITIVE_POINTS ); /** This will set as the default batch rendering to PRIMITIVE_LINES. And will reset the line @@ -299,9 +300,9 @@ class EE_API BatchRenderer { const bool& getForceBlendModeChange() const; protected: - eeVertex* mVertex; + VertexData* mVertex; unsigned int mVertexSize; - eeVertex* mTVertex; + VertexData* mTVertex; unsigned int mNumVertex; const Texture* mTexture; diff --git a/include/eepp/graphics/renderer/renderer.hpp b/include/eepp/graphics/renderer/renderer.hpp index 631c47977..fd26826b6 100644 --- a/include/eepp/graphics/renderer/renderer.hpp +++ b/include/eepp/graphics/renderer/renderer.hpp @@ -19,7 +19,7 @@ class RendererGL3CP; class RendererGLES2; /** @brief This class is an abstraction of some OpenGL functionality. - * eepp have 4 different rendering pipelines: OpenGL 2, OpenGL 3, OpenGL 3 Core Profile and OpenGL + * eepp has 4 different rendering pipelines: OpenGL 2, OpenGL 3, OpenGL 3 Core Profile and OpenGL *ES 2. This abstraction is to encapsulate this pipelines. eepp implements its own state machine to *simulate fixed-pipeline commands with OpenGL 3 and OpenGL ES 2. Most of the commands can be found *in the OpenGL documentation. This is only useful for advanced users that want some control of the @@ -27,7 +27,7 @@ class RendererGLES2; */ class EE_API Renderer { public: - static Renderer* createSingleton( EEGL_version ver ); + static Renderer* createSingleton( GraphicsLibraryVersion ver ); static Renderer* createSingleton(); @@ -60,7 +60,7 @@ class EE_API Renderer { bool isExtension( const std::string& name ); /** @return If the extension from the EEGL_extensions is present on the GPU. */ - bool isExtension( EEGL_extensions name ); + bool isExtension( GraphicsLibraryExtension name ); bool pointSpriteSupported(); @@ -133,7 +133,7 @@ class EE_API Renderer { virtual void enable( unsigned int cap ); - virtual EEGL_version version() = 0; + virtual GraphicsLibraryVersion version() = 0; virtual std::string versionStr() = 0; diff --git a/include/eepp/graphics/renderer/renderergl.hpp b/include/eepp/graphics/renderer/renderergl.hpp index 55d3995f8..415b664c6 100644 --- a/include/eepp/graphics/renderer/renderergl.hpp +++ b/include/eepp/graphics/renderer/renderergl.hpp @@ -14,7 +14,7 @@ class EE_API RendererGL : public Renderer { ~RendererGL(); - EEGL_version version(); + GraphicsLibraryVersion version(); std::string versionStr(); diff --git a/include/eepp/graphics/renderer/renderergl3.hpp b/include/eepp/graphics/renderer/renderergl3.hpp index 149844d5e..13c19d215 100644 --- a/include/eepp/graphics/renderer/renderergl3.hpp +++ b/include/eepp/graphics/renderer/renderergl3.hpp @@ -19,7 +19,7 @@ class EE_API RendererGL3 : public RendererGLShader { ~RendererGL3(); - EEGL_version version(); + GraphicsLibraryVersion version(); std::string versionStr(); diff --git a/include/eepp/graphics/renderer/renderergl3cp.hpp b/include/eepp/graphics/renderer/renderergl3cp.hpp index ff85801bb..af86d2cd7 100644 --- a/include/eepp/graphics/renderer/renderergl3cp.hpp +++ b/include/eepp/graphics/renderer/renderergl3cp.hpp @@ -19,7 +19,7 @@ class EE_API RendererGL3CP : public RendererGLShader { ~RendererGL3CP(); - EEGL_version version(); + GraphicsLibraryVersion version(); std::string versionStr(); diff --git a/include/eepp/graphics/renderer/renderergles2.hpp b/include/eepp/graphics/renderer/renderergles2.hpp index a996e203e..8026c3e39 100644 --- a/include/eepp/graphics/renderer/renderergles2.hpp +++ b/include/eepp/graphics/renderer/renderergles2.hpp @@ -25,7 +25,7 @@ class EE_API RendererGLES2 : public RendererGLShader { ~RendererGLES2(); - EEGL_version version(); + GraphicsLibraryVersion version(); std::string versionStr(); diff --git a/include/eepp/graphics/renderer/rendererhelper.hpp b/include/eepp/graphics/renderer/rendererhelper.hpp index 3e3472944..401dba51f 100644 --- a/include/eepp/graphics/renderer/rendererhelper.hpp +++ b/include/eepp/graphics/renderer/rendererhelper.hpp @@ -3,8 +3,8 @@ namespace EE { namespace Graphics { -/** Just for reference */ -enum EEGL_ARRAY_STATES { +/** Internal reference of Vertex Arrays States */ +enum VertexArrayStates { EEGL_VERTEX_ARRAY = 0, EEGL_NORMAL_ARRAY, EEGL_COLOR_ARRAY, @@ -12,7 +12,8 @@ enum EEGL_ARRAY_STATES { EEGL_TEXTURE_COORD_ARRAY }; -enum EEGL_extensions { +/// Graphics Library Extensions used by eepp when available. +enum GraphicsLibraryExtension { EEGL_ARB_texture_non_power_of_two = 0, EEGL_ARB_point_parameters, EEGL_ARB_point_sprite, @@ -33,7 +34,21 @@ enum EEGL_extensions { EEGL_EXT_blend_subtract }; -enum EEGL_version { GLv_2, GLv_3, GLv_3CP, GLv_ES1, GLv_ES2, GLv_default }; +/// Graphics Library Renderer version available. +enum GraphicsLibraryVersion { + /// OpenGL 2 + GLv_2, + /// OpenGL 3 + GLv_3, + /// OpenGL 3 Core Profile + GLv_3CP, + /// OpenGL ES 1 + GLv_ES1, + /// OpenGL ES 2 + GLv_ES2, + /// Selects the most appropriate graphics library version for each platform. + GLv_default +}; }} // namespace EE::Graphics diff --git a/include/eepp/graphics/vertexbuffer.hpp b/include/eepp/graphics/vertexbuffer.hpp index 8d9ad813b..975ced824 100644 --- a/include/eepp/graphics/vertexbuffer.hpp +++ b/include/eepp/graphics/vertexbuffer.hpp @@ -17,7 +17,7 @@ class EE_API VertexBuffer { public: /** @brief Creates a new Vertex Buffer. * @param VertexFlags The vertex flags indicates which vertex data will be used. @see - *EE_VERTEX_FLAGS + *VertexFlags * @param DrawType The type of the primitive to draw. * @param ReserveVertexSize If the vertex size is known is possible to reserve the space in *memory to avoid resizeing the array. @@ -30,15 +30,15 @@ class EE_API VertexBuffer { static VertexBuffer* New( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, PrimitiveType DrawType = PRIMITIVE_QUADS, const Int32& ReserveVertexSize = 0, const Int32& ReserveIndexSize = 0, - EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC ); + VertexBufferUsageType UsageType = VertexBufferUsageType::Static ); /** Creates the simple vertex array implementation ( without VBOs or VAO ), which it's faster * for many cases. */ - static VertexBuffer* NewVertexArray( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, - PrimitiveType DrawType = PRIMITIVE_QUADS, - const Int32& ReserveVertexSize = 0, - const Int32& ReserveIndexSize = 0, - EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC ); + static VertexBuffer* + NewVertexArray( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, + PrimitiveType DrawType = PRIMITIVE_QUADS, const Int32& ReserveVertexSize = 0, + const Int32& ReserveIndexSize = 0, + VertexBufferUsageType UsageType = VertexBufferUsageType::Static ); virtual ~VertexBuffer(); @@ -144,7 +144,7 @@ class EE_API VertexBuffer { protected: Uint32 mVertexFlags; PrimitiveType mDrawType; - EE_VBO_USAGE_TYPE mUsageType; + VertexBufferUsageType mUsageType; Int32 mElemDraw; std::vector mVertexArray[VERTEX_FLAGS_COUNT - 1]; std::vector mColorArray; @@ -153,7 +153,7 @@ class EE_API VertexBuffer { VertexBuffer( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, PrimitiveType DrawType = PRIMITIVE_QUADS, const Int32& ReserveVertexSize = 0, const Int32& ReserveIndexSize = 0, - EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC ); + VertexBufferUsageType UsageType = VertexBufferUsageType::Static ); virtual void setVertexStates() = 0; }; diff --git a/include/eepp/graphics/vertexbufferhelper.hpp b/include/eepp/graphics/vertexbufferhelper.hpp index 15a4f88c7..3486e9816 100644 --- a/include/eepp/graphics/vertexbufferhelper.hpp +++ b/include/eepp/graphics/vertexbufferhelper.hpp @@ -3,14 +3,14 @@ namespace EE { namespace Graphics { -enum EE_VBO_USAGE_TYPE { - VBO_USAGE_TYPE_STATIC, - VBO_USAGE_TYPE_DYNAMIC, - VBO_USAGE_TYPE_STREAM, - VBO_USAGE_TYPE_COUNT +/// VBO default usage type +enum class VertexBufferUsageType : int { + Static, + Dynamic, + Stream, }; -enum EE_VERTEX_FLAGS { +enum VertexFlags { VERTEX_FLAG_POSITION = 0, VERTEX_FLAG_TEXTURE0 = 1, VERTEX_FLAG_TEXTURE1 = 2, @@ -23,7 +23,7 @@ enum EE_VERTEX_FLAGS { #define VERTEX_FLAGS_COUNT_ARR ( 5 ) #define VERTEX_FLAGS_COUNT ( 6 ) -const int eeVertexElements[] = { +const int VertexElementCount[] = { 2, // Position 2, // Texture0 2, // Texture1 @@ -38,9 +38,12 @@ const int eeVertexElements[] = { F |= VERTEX_FLAG_GET( X ); #define VERTEX_FLAG_QUERY( F, X ) ( F & VERTEX_FLAG_GET( X ) ) +/// Vertex data will have position, color and texture UV. #define VERTEX_FLAGS_DEFAULT \ ( VERTEX_FLAG_GET( VERTEX_FLAG_POSITION ) | VERTEX_FLAG_GET( VERTEX_FLAG_TEXTURE0 ) | \ VERTEX_FLAG_GET( VERTEX_FLAG_COLOR ) ) + +/// Vertex data will have position and color. #define VERTEX_FLAGS_PRIMITIVE \ ( VERTEX_FLAG_GET( VERTEX_FLAG_POSITION ) | VERTEX_FLAG_GET( VERTEX_FLAG_COLOR ) ) diff --git a/include/eepp/graphics/vertexbufferogl.hpp b/include/eepp/graphics/vertexbufferogl.hpp index 02df33d7c..588050390 100644 --- a/include/eepp/graphics/vertexbufferogl.hpp +++ b/include/eepp/graphics/vertexbufferogl.hpp @@ -14,7 +14,7 @@ class EE_API VertexBufferOGL : public VertexBuffer { VertexBufferOGL( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, PrimitiveType DrawType = PRIMITIVE_QUADS, const Int32& ReserveVertexSize = 0, const Int32& ReserveIndexSize = 0, - EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC ); + VertexBufferUsageType UsageType = VertexBufferUsageType::Static ); void bind(); diff --git a/include/eepp/graphics/vertexbuffervbo.hpp b/include/eepp/graphics/vertexbuffervbo.hpp index b9c3232f8..0aca7701a 100644 --- a/include/eepp/graphics/vertexbuffervbo.hpp +++ b/include/eepp/graphics/vertexbuffervbo.hpp @@ -15,7 +15,7 @@ class EE_API VertexBufferVBO : public VertexBuffer { VertexBufferVBO( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, PrimitiveType DrawType = PRIMITIVE_QUADS, const Int32& ReserveVertexSize = 0, const Int32& ReserveIndexSize = 0, - EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC ); + VertexBufferUsageType UsageType = VertexBufferUsageType::Static ); virtual ~VertexBufferVBO(); diff --git a/include/eepp/scene/node.hpp b/include/eepp/scene/node.hpp index c8a4ef887..7834a7251 100644 --- a/include/eepp/scene/node.hpp +++ b/include/eepp/scene/node.hpp @@ -31,7 +31,7 @@ using namespace EE::Scene; namespace EE { namespace Scene { -enum NODE_FLAGS_VALUES { +enum NodeFlags { NODE_FLAG_SCHEDULED_UPDATE = ( 1 << 0 ), NODE_FLAG_VIEW_DIRTY = ( 1 << 1 ), NODE_FLAG_POSITION_DIRTY = ( 1 << 2 ), diff --git a/include/eepp/window/engine.hpp b/include/eepp/window/engine.hpp index fd567fcc7..99914f46e 100644 --- a/include/eepp/window/engine.hpp +++ b/include/eepp/window/engine.hpp @@ -12,7 +12,7 @@ class IniFile; class Pack; }} // namespace EE::System namespace EE { namespace Window { namespace Backend { -class WindowBackend; +class WindowBackendLibrary; }}} // namespace EE::Window::Backend namespace EE { namespace Window { @@ -104,10 +104,10 @@ class EE_API Engine { 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. - */ + *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(); /** Disable the Shared GL Context @@ -130,7 +130,7 @@ class EE_API Engine { protected: friend class Window; - Backend::WindowBackend* mBackend; + Backend::WindowBackendLibrary* mBackend; std::list mWindows; EE::Window::Window* mWindow; bool mSharedGLContext; @@ -143,7 +143,7 @@ class EE_API Engine { void destroy(); - Backend::WindowBackend* createSDL2Backend( const WindowSettings& Settings ); + Backend::WindowBackendLibrary* createSDL2Backend( const WindowSettings& Settings ); EE::Window::Window* createSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ); @@ -151,7 +151,7 @@ class EE_API Engine { EE::Window::Window* createDefaultWindow( const WindowSettings& Settings, const ContextSettings& Context ); - Uint32 getDefaultBackend() const; + WindowBackend getDefaultBackend() const; }; }} // namespace EE::Window diff --git a/include/eepp/window/inputtextbuffer.hpp b/include/eepp/window/inputtextbuffer.hpp index dc8afe798..55d080be3 100644 --- a/include/eepp/window/inputtextbuffer.hpp +++ b/include/eepp/window/inputtextbuffer.hpp @@ -1,26 +1,13 @@ #ifndef EE_WINDOWCINPUTTEXTBUFFER_H #define EE_WINDOWCINPUTTEXTBUFFER_H +#include #include #include #include namespace EE { namespace Window { -enum INPUT_TEXTBUFFER_FLAGS { - INPUT_TB_SUPPORT_NEW_LINE = 0, - INPUT_TB_ALLOW_ONLY_NUMBERS = 1, - INPUT_TB_ALLOW_DOT_IN_NUMBERS = 2, - INPUT_TB_ACTIVE = 3, - INPUT_TB_CHANGE_SINCE_LAST_UPDATE = 4, - INPUT_TB_FREE_EDITING = 5, - INPUT_TB_PROMPT_AUTO_POS = 6, - INPUT_TB_SUPPORT_COPY_PASTE = 7, - INPUT_TB_TEXT_SELECTION_ENABLED = 8 -}; - -#define INPUT_LENGHT_MAX 0xFFFFFFFF - /** @brief A class to keep a buffer of the user writed text */ class EE_API InputTextBuffer { public: @@ -31,13 +18,12 @@ class EE_API InputTextBuffer { static InputTextBuffer* New( const bool& active, const bool& newLineEnabled, const bool& freeEditing, EE::Window::Window* window = NULL, - const Uint32& maxLength = INPUT_LENGHT_MAX ); + const Uint32& maxLength = UINT32_MAX ); static InputTextBuffer* New( EE::Window::Window* window = NULL ); InputTextBuffer( const bool& active, const bool& newLineEnabled, const bool& freeEditing, - EE::Window::Window* window = NULL, - const Uint32& maxLength = INPUT_LENGHT_MAX ); + EE::Window::Window* window = NULL, const Uint32& maxLength = UINT32_MAX ); InputTextBuffer( EE::Window::Window* window = NULL ); @@ -155,6 +141,18 @@ class EE_API InputTextBuffer { void setSelectionChangeCallback( const SelectionChangeCallback& selectionChangeCallback ); protected: + enum Flags { + SUPPORT_NEW_LINE = 0, + ALLOW_ONLY_NUMBERS = 1, + ALLOW_DOT_IN_NUMBERS = 2, + ACTIVE = 3, + CHANGE_SINCE_LAST_UPDATE = 4, + FREE_EDITING = 5, + PROMPT_AUTO_POS = 6, + SUPPORT_COPY_PASTE = 7, + TEXT_SELECTION_ENABLED = 8 + }; + EE::Window::Window* mWindow; String mText; Uint32 mFlags; diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 4f774dc3a..dec1a913e 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -16,9 +16,7 @@ class Clipboard; class Input; class CursorManager; -/** @namespace EE::Window::WindowStyle Define the Windows Styles */ -namespace WindowStyle { -enum { +enum WindowStyle { Borderless = ( 1 << 0 ), Titlebar = ( 1 << 1 ), Resize = ( 1 << 2 ), @@ -30,12 +28,8 @@ enum { Default = Titlebar | Resize #endif }; -} // namespace WindowStyle -/** @namespace EE::Window::WindowBackend Define the window backends supported by eepp */ -namespace WindowBackend { -enum { SDL2, Default }; -} +enum class WindowBackend : Uint32 { SDL2, Default }; #ifndef EE_SCREEN_KEYBOARD_ENABLED #if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS @@ -50,7 +44,7 @@ class WindowSettings { public: inline WindowSettings( Uint32 width, Uint32 height, const std::string& caption = std::string(), Uint32 style = WindowStyle::Default, - Uint32 backend = WindowBackend::Default, Uint32 bpp = 32, + WindowBackend backend = WindowBackend::Default, Uint32 bpp = 32, const std::string& icon = std::string(), const Float& pixelDensity = 1, const bool& useScreenKeyboard = EE_SCREEN_KEYBOARD_ENABLED ) : Style( style ), @@ -78,7 +72,7 @@ class WindowSettings { Uint32 BitsPerPixel; std::string Icon; std::string Caption; - Uint32 Backend; + WindowBackend Backend; Float PixelDensity; bool UseScreenKeyboard; }; @@ -86,7 +80,7 @@ class WindowSettings { /** @brief ContextSettings Small class that contains the renderer context information */ class ContextSettings { public: - inline ContextSettings( bool vsync, EEGL_version version = GLv_default, + inline ContextSettings( bool vsync, GraphicsLibraryVersion version = GLv_default, bool doubleBuffering = true, Uint32 depthBufferSize = 24, Uint32 stencilBufferSize = 1, Uint32 multisamples = 0, bool sharedGLContext = true, Int32 frameRateLimit = 0 ) : @@ -109,7 +103,7 @@ class ContextSettings { DoubleBuffering( true ), SharedGLContext( true ) {} - EEGL_version Version; + GraphicsLibraryVersion Version; Uint32 DepthBufferSize; Uint32 StencilBufferSize; Uint32 Multisamples; @@ -132,7 +126,7 @@ class WindowInfo { WindowSettings WindowConfig; ContextSettings ContextConfig; - Uint32 Backend; + WindowBackend Backend; Sizei DesktopResolution; Sizei WindowSize; Uint32 Flags; diff --git a/premake5.lua b/premake5.lua index c18b4f8f0..c68c8f394 100644 --- a/premake5.lua +++ b/premake5.lua @@ -17,17 +17,6 @@ newoption { } } -function explode(div,str) - if (div=='') then return false end - local pos,arr = 0,{} - for st,sp in function() return string.find(str,div,pos,true) end do - table.insert(arr,string.sub(str,pos,st-1)) - pos = sp + 1 - end - table.insert(arr,string.sub(str,pos)) - return arr -end - function print_table( table_ref ) for _, value in pairs( table_ref ) do print(value) @@ -40,10 +29,6 @@ function table_length(T) return count end -function args_contains( element ) - return table.contains( _ARGS, element ) -end - function multiple_insert( parent_table, insert_table ) for _, value in pairs( insert_table ) do table.insert( parent_table, value ) @@ -51,7 +36,7 @@ function multiple_insert( parent_table, insert_table ) end function get_ios_arch() - local archs = explode( "-", os.target() ) + local archs = string.explode( os.target(), "-" ) return archs[ table_length( archs ) ] end @@ -111,6 +96,13 @@ backend_selected = false remote_sdl2_version = "SDL2-2.0.10" remote_sdl2_devel_vc_url = "https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip" +function incdirs( dirs ) + if is_xcode() then + sysincludedirs { dirs } + end + includedirs { dirs } +end + function download_and_extract_dependencies() if _OPTIONS["windows-vc-build"] then print("Downloading: " .. remote_sdl2_devel_vc_url) @@ -129,33 +121,26 @@ function download_and_extract_dependencies() end function build_base_configuration( package_name ) - sysincludedirs { "src/thirdparty/zlib" } - - if not os.istarget("windows") then - buildoptions{ "-fPIC" } - end - - if is_vs() then - sysincludedirs { "src/thirdparty/libzip/vs" } - end + incdirs { "src/thirdparty/zlib" } set_ios_config() set_xcode_config() - configuration "debug" - defines { "DEBUG" } - symbols "On" - if not is_vs() then - buildoptions{ "-Wall", "-std=gnu99" } - end + filter "not system:windows" + buildoptions{ "-fPIC" } + + filter "configurations:debug" targetname ( package_name .. "-debug" ) - configuration "release" - optimize "Speed" - if not is_vs() then - buildoptions{ "-Wall", "-std=gnu99" } - end + filter "configurations:release" targetname ( package_name ) + + filter "action:not vs*" + cdialect "gnu99" + buildoptions{ "-Wall" } + + filter "action:vs*" + incdirs { "src/thirdparty/libzip/vs" } end function build_base_cpp_configuration( package_name ) @@ -166,7 +151,7 @@ function build_base_cpp_configuration( package_name ) set_ios_config() set_xcode_config() - configuration "debug" + filter "configurations:debug" defines { "DEBUG" } symbols "On" if not is_vs() then @@ -174,7 +159,7 @@ function build_base_cpp_configuration( package_name ) end targetname ( package_name .. "-debug" ) - configuration "release" + filter "configurations:release" optimize "Speed" if not is_vs() then buildoptions{ "-Wall" } @@ -194,20 +179,8 @@ function add_cross_config_links() end end -function fix_shared_lib_linking_path( package_name, libname ) - if ( "4.4-beta5" == _PREMAKE_VERSION or "HEAD" == _PREMAKE_VERSION ) and not _OPTIONS["with-static-eepp"] and package_name == "eepp" then - if os.istarget("macosx") then - linkoptions { "-install_name " .. libname .. ".dylib" } - elseif os.istarget("linux") or os.istarget("freebsd") then - linkoptions { "-Wl,-soname=\"" .. libname .. "\"" } - elseif os.istarget("haiku") then - linkoptions { "-Wl,-soname=\"" .. libname .. ".so" .. "\"" } - end - end -end - function build_link_configuration( package_name, use_ee_icon ) - sysincludedirs { "include" } + incdirs { "include" } local extension = ""; @@ -254,7 +227,7 @@ function build_link_configuration( package_name, use_ee_icon ) set_ios_config() set_xcode_config() - configuration "debug" + filter "configurations:debug" defines { "DEBUG", "EE_DEBUG", "EE_MEMORY_MANAGER" } symbols "On" @@ -262,11 +235,9 @@ function build_link_configuration( package_name, use_ee_icon ) buildoptions{ "-Wall -Wno-long-long" } end - fix_shared_lib_linking_path( package_name, "libeepp-debug" ) - targetname ( package_name .. "-debug" .. extension ) - configuration "release" + filter "configurations:release" optimize "Speed" if not is_vs() and not os.istarget("emscripten") then @@ -277,11 +248,9 @@ function build_link_configuration( package_name, use_ee_icon ) buildoptions { "-s" } end - fix_shared_lib_linking_path( package_name, "libeepp" ) - targetname ( package_name .. extension ) - configuration "windows" + filter "system:windows" add_cross_config_links() if _OPTIONS["windows-vc-build"] then @@ -292,7 +261,7 @@ function build_link_configuration( package_name, use_ee_icon ) links { "SDL2", "SDL2main" } end - configuration "emscripten" + filter "system:emscripten" linkoptions{ "-O2 -s TOTAL_MEMORY=67108864 -s ASM_JS=1 -s VERBOSE=1 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_SDL=2 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ERROR_ON_MISSING_LIBRARIES=0 -s FULL_ES3=1 -s \"BINARYEN_TRAP_MODE='clamp'\"" } buildoptions { "-fno-strict-aliasing -O2 -s USE_SDL=2 -s PRECISE_F32=1 -s ENVIRONMENT=web" } @@ -318,7 +287,7 @@ function generate_os_links() multiple_insert( os_links, { "opengl32", "glu32", "gdi32", "ws2_32", "winmm", "ole32" } ) elseif os.istarget("macosx") then multiple_insert( os_links, { "OpenGL.framework", "CoreFoundation.framework" } ) - elseif os.istarget("freebsd") then + elseif os.istarget("bsd") then multiple_insert( os_links, { "rt", "pthread", "X11", "GL", "Xcursor" } ) elseif os.istarget("haiku") then multiple_insert( os_links, { "GL", "network" } ) @@ -329,7 +298,7 @@ function generate_os_links() end if not _OPTIONS["with-mojoal"] then - if os.istarget("linux") or os.istarget("freebsd") or os.istarget("haiku") or os.istarget("emscripten") then + if os.istarget("linux") or os.istarget("bsd") or os.istarget("haiku") or os.istarget("emscripten") then multiple_insert( os_links, { "openal" } ) elseif os.istarget("windows") or os.istarget("mingw32") then multiple_insert( os_links, { "OpenAL32" } ) @@ -415,7 +384,7 @@ end function set_xcode_config() if is_xcode() or _OPTIONS["use-frameworks"] then linkoptions { "-F /Library/Frameworks" } - sysincludedirs { "/Library/Frameworks/SDL2.framework/Headers" } + incdirs { "/Library/Frameworks/SDL2.framework/Headers" } defines { "EE_SDL2_FROM_ROOTPATH" } end end @@ -455,11 +424,11 @@ function set_ios_config() linkoptions { sysroot_ver } libdirs { framework_libs_path } linkoptions { " -F" .. framework_path .. " -L" .. framework_libs_path .. " -isysroot " .. sysroot_path } - sysincludedirs { "src/thirdparty/SDL2/include" } + incdirs { "src/thirdparty/SDL2/include" } end if _OPTIONS.platform == "ios-cross-arm7" or _OPTIONS.platform == "ios-cross-x86" then - sysincludedirs { "src/thirdparty/SDL2/include" } + incdirs { "src/thirdparty/SDL2/include" } end end @@ -537,15 +506,15 @@ function set_macos_and_ios_config() end function build_eepp( build_name ) - sysincludedirs { "include", "src", "src/thirdparty", "include/eepp/thirdparty", "src/thirdparty/freetype2/include", "src/thirdparty/zlib", "src/thirdparty/libogg/include", "src/thirdparty/libvorbis/include", "src/thirdparty/mbedtls/include" } + incdirs { "include", "src", "src/thirdparty", "include/eepp/thirdparty", "src/thirdparty/freetype2/include", "src/thirdparty/zlib", "src/thirdparty/libogg/include", "src/thirdparty/libvorbis/include", "src/thirdparty/mbedtls/include" } if _OPTIONS["with-mojoal"] then defines( "AL_LIBTYPE_STATIC" ) - sysincludedirs { "src/thirdparty/mojoAL" } + incdirs { "src/thirdparty/mojoAL" } end if _OPTIONS["windows-vc-build"] then - sysincludedirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" } + incdirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" } end set_macos_and_ios_config() @@ -555,7 +524,7 @@ function build_eepp( build_name ) add_static_links() if is_vs() then - sysincludedirs { "src/thirdparty/libzip/vs" } + incdirs { "src/thirdparty/libzip/vs" } end if not is_vs() then @@ -621,7 +590,6 @@ function set_targetdir( dir ) end workspace "eepp" - targetdir("./bin/") configurations { "debug", "release" } rtti "On" @@ -645,47 +613,46 @@ workspace "eepp" generate_os_links() parse_args() + filter "configurations:debug" + defines { "DEBUG" } + symbols "On" + filter "configurations:release" + optimize "Speed" + project "SOIL2-static" kind "StaticLib" - - if is_vs() then - language "C++" - buildoptions { "/TP" } - else - language "C" - end - set_targetdir("libs/" .. os.target() .. "/thirdparty/") files { "src/thirdparty/SOIL2/src/SOIL2/*.c" } - sysincludedirs { "src/thirdparty/SOIL2" } + incdirs { "src/thirdparty/SOIL2" } build_base_configuration( "SOIL2" ) - - if not os.istarget("haiku") and not os.istarget("ios") and not os.istarget("android") and not os.istarget("emscripten") then - project "glew-static" - kind "StaticLib" + filter "action:vs*" + language "C++" + buildoptions { "/TP" } + filter "action:not vs*" language "C" - defines { "GLEW_NO_GLU", "GLEW_STATIC" } - set_targetdir("libs/" .. os.target() .. "/thirdparty/") - files { "src/thirdparty/glew/*.c" } - sysincludedirs { "include/thirdparty/glew" } - build_base_configuration( "glew" ) - end - if not _OPTIONS["with-openssl"] then - project "mbedtls-static" - kind "StaticLib" - language "C" - set_targetdir("libs/" .. os.target() .. "/thirdparty/") - sysincludedirs { "src/thirdparty/mbedtls/include/" } - files { "src/thirdparty/mbedtls/library/*.c" } - build_base_cpp_configuration( "mbedtls" ) - end + project "glew-static" + kind "StaticLib" + language "C" + defines { "GLEW_NO_GLU", "GLEW_STATIC" } + set_targetdir("libs/" .. os.target() .. "/thirdparty/") + files { "src/thirdparty/glew/*.c" } + incdirs { "include/thirdparty/glew" } + build_base_configuration( "glew" ) + + project "mbedtls-static" + kind "StaticLib" + language "C" + set_targetdir("libs/" .. os.target() .. "/thirdparty/") + incdirs { "src/thirdparty/mbedtls/include/" } + files { "src/thirdparty/mbedtls/library/*.c" } + build_base_cpp_configuration( "mbedtls" ) project "vorbis-static" kind "StaticLib" language "C" set_targetdir("libs/" .. os.target() .. "/thirdparty/") - sysincludedirs { "src/thirdparty/libvorbis/lib/", "src/thirdparty/libogg/include", "src/thirdparty/libvorbis/include" } + incdirs { "src/thirdparty/libvorbis/lib/", "src/thirdparty/libogg/include", "src/thirdparty/libvorbis/include" } files { "src/thirdparty/libogg/**.c", "src/thirdparty/libvorbis/**.c" } build_base_cpp_configuration( "vorbis" ) @@ -708,7 +675,7 @@ workspace "eepp" language "C" set_targetdir("libs/" .. os.target() .. "/thirdparty/") files { "src/thirdparty/libzip/*.c" } - sysincludedirs { "src/thirdparty/zlib" } + incdirs { "src/thirdparty/zlib" } build_base_configuration( "libzip" ) project "freetype-static" @@ -717,23 +684,20 @@ workspace "eepp" set_targetdir("libs/" .. os.target() .. "/thirdparty/") defines { "FT2_BUILD_LIBRARY" } files { "src/thirdparty/freetype2/src/**.c" } - sysincludedirs { "src/thirdparty/freetype2/include" } + incdirs { "src/thirdparty/freetype2/include" } build_base_configuration( "freetype" ) project "chipmunk-static" kind "StaticLib" - - if is_vs() then - language "C++" - buildoptions { "/TP" } - else - language "C" - end - set_targetdir("libs/" .. os.target() .. "/thirdparty/") files { "src/thirdparty/chipmunk/*.c", "src/thirdparty/chipmunk/constraints/*.c" } - sysincludedirs { "include/eepp/thirdparty/chipmunk" } + incdirs { "include/eepp/thirdparty/chipmunk" } build_base_configuration( "chipmunk" ) + filter "action:vs*" + language "C++" + buildoptions { "/TP" } + filter "action:not vs*" + language "C" project "jpeg-compressor-static" kind "StaticLib" @@ -749,56 +713,41 @@ workspace "eepp" files { "src/thirdparty/imageresampler/*.cpp" } build_base_cpp_configuration( "imageresampler" ) - if _OPTIONS["with-mojoal"] then - project "mojoal-static" - kind "StaticLib" - language "C" - set_targetdir("libs/" .. os.target() .. "/thirdparty/") - if _OPTIONS["windows-vc-build"] then - sysincludedirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" } - end - sysincludedirs { "include/eepp/thirdparty/mojoAL" } - defines( "AL_LIBTYPE_STATIC" ) - files { "src/thirdparty/mojoAL/*.c" } - build_base_cpp_configuration( "mojoal" ) - end + project "mojoal-static" + kind "StaticLib" + language "C" + set_targetdir("libs/" .. os.target() .. "/thirdparty/") + incdirs { "include/eepp/thirdparty/mojoAL" } + defines( "AL_LIBTYPE_STATIC" ) + files { "src/thirdparty/mojoAL/*.c" } + build_base_cpp_configuration( "mojoal" ) + filter "options:windows-vc-build" + incdirs { "src/thirdparty/" .. remote_sdl2_version .. "/include" } project "efsw-static" kind "StaticLib" language "C++" set_targetdir("libs/" .. os.target() .. "/thirdparty/") - sysincludedirs { "src/thirdparty/efsw/include", "src/thirdparty/efsw/src" } - - if os.istarget("windows") then - osfiles = "src/thirdparty/efsw/src/efsw/platform/win/*.cpp" - else - osfiles = "src/thirdparty/efsw/src/efsw/platform/posix/*.cpp" - end - - files { "src/thirdparty/efsw/src/efsw/*.cpp", osfiles } - - if os.istarget("windows") then - excludes { "src/thirdparty/efsw/src/efsw/WatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/WatcherFSEvents.cpp", "src/thirdparty/efsw/src/efsw/WatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp" } - elseif os.istarget("linux") then - excludes { "src/thirdparty/efsw/src/efsw/WatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/WatcherFSEvents.cpp", "src/thirdparty/efsw/src/efsw/WatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp" } - elseif os.istarget("macosx") then - excludes { "src/thirdparty/efsw/src/efsw/WatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/WatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp" } - elseif os.istarget("freebsd") then - excludes { "src/thirdparty/efsw/src/efsw/WatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/WatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/WatcherFSEvents.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp" } - end - + incdirs { "src/thirdparty/efsw/include", "src/thirdparty/efsw/src" } + files { "src/thirdparty/efsw/src/efsw/*.cpp" } build_base_cpp_configuration( "efsw" ) + filter "system:windows" + files { "src/thirdparty/efsw/src/efsw/platform/win/*.cpp" } + excludes { "src/thirdparty/efsw/src/efsw/WatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/WatcherFSEvents.cpp", "src/thirdparty/efsw/src/efsw/WatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp" } + filter "system:linux" + excludes { "src/thirdparty/efsw/src/efsw/WatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/WatcherFSEvents.cpp", "src/thirdparty/efsw/src/efsw/WatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherKqueue.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp" } + filter "system:macosx" + excludes { "src/thirdparty/efsw/src/efsw/WatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/WatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp" } + filter "system:bsd" + excludes { "src/thirdparty/efsw/src/efsw/WatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/WatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/WatcherFSEvents.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherInotify.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherWin32.cpp", "src/thirdparty/efsw/src/efsw/FileWatcherFSEvents.cpp" } + filter "system:not windows" + files { "src/thirdparty/efsw/src/efsw/platform/posix/*.cpp" } project "eepp-main" kind "StaticLib" language "C++" set_targetdir("libs/" .. os.target() .. "/") files { "src/eepp/main/eepp_main.cpp" } - configuration "debug" - defines { "DEBUG" } - symbols "On" - configuration "release" - optimize "Speed" project "eepp-static" kind "StaticLib" @@ -865,14 +814,14 @@ workspace "eepp" kind "ConsoleApp" language "C++" files { "src/examples/http_request/*.cpp" } - sysincludedirs { "src/thirdparty" } + incdirs { "src/thirdparty" } build_link_configuration( "eehttp-request", true ) project "eepp-ui-hello-world" set_kind() language "C++" files { "src/examples/ui_hello_world/*.cpp" } - sysincludedirs { "src/thirdparty" } + incdirs { "src/thirdparty" } build_link_configuration( "eeui-hello-world", true ) -- Tools @@ -891,19 +840,14 @@ workspace "eepp" project "eepp-uieditor" set_kind() language "C++" - sysincludedirs { "src/thirdparty/efsw/include", "src/thirdparty" } - - if not os.istarget("windows") and not os.istarget("haiku") then - links { "pthread" } - end - - if os.istarget("macosx") then - links { "CoreFoundation.framework", "CoreServices.framework" } - end - + incdirs { "src/thirdparty/efsw/include", "src/thirdparty" } links { "efsw-static", "pugixml-static" } files { "src/tools/uieditor/*.cpp" } build_link_configuration( "eepp-UIEditor", true ) + filter "system:macosx" + links { "CoreFoundation.framework", "CoreServices.framework" } + filter { "system:not windows", "system:not haiku" } + links { "pthread" } if os.isfile("external_projects.lua") then dofile("external_projects.lua") diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 62a7cfb70..bd469a6a8 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -77,7 +77,7 @@ Desktop Desktop {6d057187-158a-4883-8d5b-d470a6b6b025} - 10 + 12 0 15 @@ -85,7 +85,7 @@ true - gmake + gmake2 premake5 %{buildDir}../../../ ProjectExplorer.ProcessStep @@ -166,7 +166,7 @@ true - --with-backend=SDL2 gmake + gmake premake5 %{buildDir}../../../ ProjectExplorer.ProcessStep @@ -175,7 +175,7 @@ false - make + /usr/bin/make false true GenericProjectManager.GenericMakeStep diff --git a/src/eepp/graphics/batchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp index 1f17d9d2b..059dd8252 100644 --- a/src/eepp/graphics/batchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -62,7 +62,7 @@ void BatchRenderer::init() { void BatchRenderer::allocVertexs( const unsigned int& size ) { eeSAFE_DELETE_ARRAY( mVertex ); - mVertex = eeNewArray( eeVertex, size ); + mVertex = eeNewArray( VertexData, size ); mVertexSize = size; mNumVertex = 0; } @@ -95,7 +95,7 @@ void BatchRenderer::addVertexs( const unsigned int& num ) { mNumVertex += num; if ( ( mNumVertex + num ) >= mVertexSize ) { - eeVertex* newVertex = eeNewArray( eeVertex, mVertexSize * 2 ); + VertexData* newVertex = eeNewArray( VertexData, mVertexSize * 2 ); for ( Uint32 i = 0; i < mVertexSize; i++ ) newVertex[i] = mVertex[i]; @@ -142,21 +142,21 @@ void BatchRenderer::flush() { GLi->translatef( -mCenter.x, -mCenter.y, 0.0f ); } - Uint32 alloc = sizeof( eeVertex ) * NumVertex; + Uint32 alloc = sizeof( VertexData ) * NumVertex; if ( NULL != mTexture ) { const_cast( mTexture )->bind( mCoordinateType ); - GLi->texCoordPointer( 2, GL_FP, sizeof( eeVertex ), + GLi->texCoordPointer( 2, GL_FP, sizeof( VertexData ), reinterpret_cast( &mVertex[0] ) + sizeof( Vector2f ), alloc ); } else { GLi->disable( GL_TEXTURE_2D ); GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); } - GLi->vertexPointer( 2, GL_FP, sizeof( eeVertex ), reinterpret_cast( &mVertex[0] ), + GLi->vertexPointer( 2, GL_FP, sizeof( VertexData ), reinterpret_cast( &mVertex[0] ), alloc ); GLi->colorPointer( - 4, GL_UNSIGNED_BYTE, sizeof( eeVertex ), + 4, GL_UNSIGNED_BYTE, sizeof( VertexData ), reinterpret_cast( &mVertex[0] ) + sizeof( Vector2f ) + sizeof( Vector2f ), alloc ); if ( !GLi->quadsSupported() ) { @@ -538,7 +538,7 @@ void BatchRenderer::batchPoint( const Float& x, const Float& y, addVertexs( 1 ); } -void BatchRenderer::batchPointList( const std::vector& points, +void BatchRenderer::batchPointList( const std::vector& points, const PrimitiveType& primitiveType ) { setDrawMode( primitiveType, mForceBlendMode ); @@ -546,7 +546,7 @@ void BatchRenderer::batchPointList( const std::vector& points, addVertexs( points.size() ); - memcpy( (void*)&mVertex[curNumVertex], (void*)&points[0], sizeof( eeVertex ) * points.size() ); + memcpy( (void*)&mVertex[curNumVertex], (void*)&points[0], sizeof( VertexData ) * points.size() ); } void BatchRenderer::linesBegin() { diff --git a/src/eepp/graphics/renderer/renderer.cpp b/src/eepp/graphics/renderer/renderer.cpp index e632f4b7c..743039149 100644 --- a/src/eepp/graphics/renderer/renderer.cpp +++ b/src/eepp/graphics/renderer/renderer.cpp @@ -41,7 +41,7 @@ Renderer* GLi = NULL; Renderer* Renderer::sSingleton = NULL; -Renderer* Renderer::createSingleton( EEGL_version ver ) { +Renderer* Renderer::createSingleton( GraphicsLibraryVersion ver ) { #if !defined( EE_GLES1 ) && !defined( EE_GLES2 ) if ( GLv_default == ver ) ver = GLv_2; @@ -288,7 +288,7 @@ bool Renderer::isExtension( const std::string& name ) { #endif } -bool Renderer::isExtension( EEGL_extensions name ) { +bool Renderer::isExtension( GraphicsLibraryExtension name ) { return 0 != ( mExtensions & ( 1 << name ) ); } diff --git a/src/eepp/graphics/renderer/renderergl.cpp b/src/eepp/graphics/renderer/renderergl.cpp index 995df038d..d6dc20f99 100644 --- a/src/eepp/graphics/renderer/renderergl.cpp +++ b/src/eepp/graphics/renderer/renderergl.cpp @@ -61,7 +61,7 @@ RendererGL::RendererGL() { RendererGL::~RendererGL() {} -EEGL_version RendererGL::version() { +GraphicsLibraryVersion RendererGL::version() { #ifndef EE_GLES1 return GLv_2; #else diff --git a/src/eepp/graphics/renderer/renderergl3.cpp b/src/eepp/graphics/renderer/renderergl3.cpp index 55ae3ecad..4a6757612 100644 --- a/src/eepp/graphics/renderer/renderergl3.cpp +++ b/src/eepp/graphics/renderer/renderergl3.cpp @@ -47,7 +47,7 @@ RendererGL3::RendererGL3() : RendererGL3::~RendererGL3() {} -EEGL_version RendererGL3::version() { +GraphicsLibraryVersion RendererGL3::version() { return GLv_3; } diff --git a/src/eepp/graphics/renderer/renderergl3cp.cpp b/src/eepp/graphics/renderer/renderergl3cp.cpp index 81560a5b8..d51bc5539 100644 --- a/src/eepp/graphics/renderer/renderergl3cp.cpp +++ b/src/eepp/graphics/renderer/renderergl3cp.cpp @@ -71,7 +71,7 @@ RendererGL3CP::~RendererGL3CP() { #endif } -EEGL_version RendererGL3CP::version() { +GraphicsLibraryVersion RendererGL3CP::version() { return GLv_3CP; } diff --git a/src/eepp/graphics/renderer/renderergles2.cpp b/src/eepp/graphics/renderer/renderergles2.cpp index 2e3df8ac1..1591d6f37 100644 --- a/src/eepp/graphics/renderer/renderergles2.cpp +++ b/src/eepp/graphics/renderer/renderergles2.cpp @@ -55,7 +55,7 @@ RendererGLES2::RendererGLES2() : RendererGLES2::~RendererGLES2() {} -EEGL_version RendererGLES2::version() { +GraphicsLibraryVersion RendererGLES2::version() { return GLv_ES2; } diff --git a/src/eepp/graphics/vertexbuffer.cpp b/src/eepp/graphics/vertexbuffer.cpp index 4d0272208..4b5c3d7a5 100644 --- a/src/eepp/graphics/vertexbuffer.cpp +++ b/src/eepp/graphics/vertexbuffer.cpp @@ -9,7 +9,7 @@ namespace EE { namespace Graphics { VertexBuffer* VertexBuffer::New( const Uint32& VertexFlags, PrimitiveType DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, - EE_VBO_USAGE_TYPE UsageType ) { + VertexBufferUsageType UsageType ) { if ( GLi->isExtension( EEGL_ARB_vertex_buffer_object ) ) return eeNew( VertexBufferVBO, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); @@ -21,22 +21,22 @@ VertexBuffer* VertexBuffer::New( const Uint32& VertexFlags, PrimitiveType DrawTy VertexBuffer* VertexBuffer::NewVertexArray( const Uint32& VertexFlags, PrimitiveType DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, - EE_VBO_USAGE_TYPE UsageType ) { + VertexBufferUsageType UsageType ) { return eeNew( VertexBufferOGL, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); } VertexBuffer::VertexBuffer( const Uint32& VertexFlags, PrimitiveType DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, - EE_VBO_USAGE_TYPE UsageType ) : + VertexBufferUsageType UsageType ) : mVertexFlags( VertexFlags ), mDrawType( DrawType ), mUsageType( UsageType ), mElemDraw( -1 ) { if ( ReserveVertexSize > 0 ) { for ( Int32 i = 0; i < VERTEX_FLAGS_COUNT; i++ ) { if ( VERTEX_FLAG_QUERY( mVertexFlags, i ) ) { if ( i != VERTEX_FLAG_COLOR ) - mVertexArray[i].reserve( ReserveVertexSize * eeVertexElements[i] ); + mVertexArray[i].reserve( ReserveVertexSize * VertexElementCount[i] ); else - mColorArray.reserve( ReserveVertexSize * eeVertexElements[i] ); + mColorArray.reserve( ReserveVertexSize * VertexElementCount[i] ); } } } @@ -114,7 +114,7 @@ Uint32* VertexBuffer::getIndices() { Uint32 VertexBuffer::getVertexCount() { return (Uint32)mVertexArray[VERTEX_FLAG_POSITION].size() / - eeVertexElements[VERTEX_FLAG_POSITION]; + VertexElementCount[VERTEX_FLAG_POSITION]; } Uint32 VertexBuffer::getIndexCount() { @@ -124,7 +124,7 @@ Uint32 VertexBuffer::getIndexCount() { Vector2f VertexBuffer::getVector2( const Uint32& Type, const Uint32& Index ) { eeASSERT( Type < VERTEX_FLAGS_COUNT_ARR && !VERTEX_FLAG_QUERY( mVertexFlags, Type ) ) - Int32 pos = Index * eeVertexElements[Type]; + Int32 pos = Index * VertexElementCount[Type]; return Vector2f( mVertexArray[Type][pos], mVertexArray[Type][pos + 1] ); } @@ -132,7 +132,7 @@ Vector2f VertexBuffer::getVector2( const Uint32& Type, const Uint32& Index ) { Color VertexBuffer::getColor( const Uint32& Index ) { eeASSERT( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ); - Int32 pos = Index * eeVertexElements[VERTEX_FLAG_COLOR]; + Int32 pos = Index * VertexElementCount[VERTEX_FLAG_COLOR]; return Color( mColorArray[pos], mColorArray[pos + 1], mColorArray[pos + 2], mColorArray[pos + 3] ); diff --git a/src/eepp/graphics/vertexbufferogl.cpp b/src/eepp/graphics/vertexbufferogl.cpp index 369cd90a7..d03e5af2c 100644 --- a/src/eepp/graphics/vertexbufferogl.cpp +++ b/src/eepp/graphics/vertexbufferogl.cpp @@ -7,7 +7,7 @@ namespace EE { namespace Graphics { VertexBufferOGL::VertexBufferOGL( const Uint32& VertexFlags, PrimitiveType DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, - EE_VBO_USAGE_TYPE UsageType ) : + VertexBufferUsageType UsageType ) : VertexBuffer( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) {} void VertexBufferOGL::bind() { @@ -43,8 +43,8 @@ void VertexBufferOGL::setVertexStates() { GLi->clientActiveTexture( GL_TEXTURE0 + i ); GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->texCoordPointer( eeVertexElements[VERTEX_FLAG_TEXTURE0 + i], GL_FP, - sizeof( Float ) * eeVertexElements[VERTEX_FLAG_TEXTURE0 + i], + GLi->texCoordPointer( VertexElementCount[VERTEX_FLAG_TEXTURE0 + i], GL_FP, + sizeof( Float ) * VertexElementCount[VERTEX_FLAG_TEXTURE0 + i], &mVertexArray[VERTEX_FLAG_TEXTURE0 + i][0], alloc ); } else { if ( 0 == i ) { @@ -57,8 +57,8 @@ void VertexBufferOGL::setVertexStates() { } else { if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_TEXTURE0 ) ) { GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->texCoordPointer( eeVertexElements[VERTEX_FLAG_TEXTURE0], GL_FP, - sizeof( Float ) * eeVertexElements[VERTEX_FLAG_TEXTURE0], + GLi->texCoordPointer( VertexElementCount[VERTEX_FLAG_TEXTURE0], GL_FP, + sizeof( Float ) * VertexElementCount[VERTEX_FLAG_TEXTURE0], &mVertexArray[VERTEX_FLAG_TEXTURE0][0], alloc ); } else { GLi->disable( GL_TEXTURE_2D ); @@ -69,8 +69,8 @@ void VertexBufferOGL::setVertexStates() { /// POSITION if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) { GLi->enableClientState( GL_VERTEX_ARRAY ); - GLi->vertexPointer( eeVertexElements[VERTEX_FLAG_POSITION], GL_FP, - sizeof( Float ) * eeVertexElements[VERTEX_FLAG_POSITION], + GLi->vertexPointer( VertexElementCount[VERTEX_FLAG_POSITION], GL_FP, + sizeof( Float ) * VertexElementCount[VERTEX_FLAG_POSITION], &mVertexArray[VERTEX_FLAG_POSITION][0], alloc ); } else { GLi->disableClientState( GL_VERTEX_ARRAY ); @@ -79,8 +79,8 @@ void VertexBufferOGL::setVertexStates() { /// COLOR if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ) { GLi->enableClientState( GL_COLOR_ARRAY ); - GLi->colorPointer( eeVertexElements[VERTEX_FLAG_COLOR], GL_UNSIGNED_BYTE, - sizeof( Uint8 ) * eeVertexElements[VERTEX_FLAG_COLOR], &mColorArray[0], + GLi->colorPointer( VertexElementCount[VERTEX_FLAG_COLOR], GL_UNSIGNED_BYTE, + sizeof( Uint8 ) * VertexElementCount[VERTEX_FLAG_COLOR], &mColorArray[0], allocC ); } else { GLi->disableClientState( GL_COLOR_ARRAY ); diff --git a/src/eepp/graphics/vertexbuffervbo.cpp b/src/eepp/graphics/vertexbuffervbo.cpp index b8dd3c9f8..d3bc8165f 100644 --- a/src/eepp/graphics/vertexbuffervbo.cpp +++ b/src/eepp/graphics/vertexbuffervbo.cpp @@ -10,7 +10,7 @@ namespace EE { namespace Graphics { VertexBufferVBO::VertexBufferVBO( const Uint32& VertexFlags, PrimitiveType DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, - EE_VBO_USAGE_TYPE UsageType ) : + VertexBufferUsageType UsageType ) : VertexBuffer( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ), mCompiled( false ), mBuffersSet( false ), @@ -64,9 +64,9 @@ bool VertexBufferVBO::compile() { #endif unsigned int usageType = GL_STATIC_DRAW; - if ( mUsageType == VBO_USAGE_TYPE_DYNAMIC ) + if ( mUsageType == VertexBufferUsageType::Dynamic ) usageType = GL_DYNAMIC_DRAW; - else if ( mUsageType == VBO_USAGE_TYPE_STREAM ) + else if ( mUsageType == VertexBufferUsageType::Stream ) usageType = GL_STREAM_DRAW; // Create the VBO vertex arrays @@ -193,12 +193,12 @@ void VertexBufferVBO::setVertexStates() { EEGL_TEXTURE_COORD_ARRAY ) ); if ( -1 != index ) - glVertexAttribPointerARB( index, eeVertexElements[VERTEX_FLAG_TEXTURE0 + i], + glVertexAttribPointerARB( index, VertexElementCount[VERTEX_FLAG_TEXTURE0 + i], GL_FP, GL_FALSE, 0, 0 ); } else #endif { - GLi->texCoordPointer( eeVertexElements[VERTEX_FLAG_TEXTURE0 + i], GL_FP, 0, + GLi->texCoordPointer( VertexElementCount[VERTEX_FLAG_TEXTURE0 + i], GL_FP, 0, (char*)NULL, 0 ); } @@ -228,12 +228,12 @@ void VertexBufferVBO::setVertexStates() { EEGL_TEXTURE_COORD_ARRAY ) ); if ( -1 != index ) - glVertexAttribPointerARB( index, eeVertexElements[VERTEX_FLAG_TEXTURE0], GL_FP, + glVertexAttribPointerARB( index, VertexElementCount[VERTEX_FLAG_TEXTURE0], GL_FP, GL_FALSE, 0, 0 ); } else #endif { - GLi->texCoordPointer( eeVertexElements[VERTEX_FLAG_TEXTURE0], GL_FP, 0, (char*)NULL, + GLi->texCoordPointer( VertexElementCount[VERTEX_FLAG_TEXTURE0], GL_FP, 0, (char*)NULL, 0 ); } @@ -260,12 +260,12 @@ void VertexBufferVBO::setVertexStates() { : GLi->getRendererGLES2()->getStateIndex( EEGL_VERTEX_ARRAY ) ); if ( -1 != index ) - glVertexAttribPointerARB( index, eeVertexElements[VERTEX_FLAG_POSITION], GL_FP, + glVertexAttribPointerARB( index, VertexElementCount[VERTEX_FLAG_POSITION], GL_FP, GL_FALSE, 0, 0 ); } else #endif { - GLi->vertexPointer( eeVertexElements[VERTEX_FLAG_POSITION], GL_FP, 0, (char*)NULL, 0 ); + GLi->vertexPointer( VertexElementCount[VERTEX_FLAG_POSITION], GL_FP, 0, (char*)NULL, 0 ); } } else { GLi->disableClientState( GL_VERTEX_ARRAY ); @@ -285,12 +285,12 @@ void VertexBufferVBO::setVertexStates() { : GLi->getRendererGLES2()->getStateIndex( EEGL_COLOR_ARRAY ) ); if ( -1 != index ) - glVertexAttribPointerARB( index, eeVertexElements[VERTEX_FLAG_COLOR], + glVertexAttribPointerARB( index, VertexElementCount[VERTEX_FLAG_COLOR], GL_UNSIGNED_BYTE, GL_TRUE, 0, 0 ); } else #endif { - GLi->colorPointer( eeVertexElements[VERTEX_FLAG_COLOR], GL_UNSIGNED_BYTE, 0, + GLi->colorPointer( VertexElementCount[VERTEX_FLAG_COLOR], GL_UNSIGNED_BYTE, 0, (char*)NULL, 0 ); } } else { @@ -306,9 +306,9 @@ void VertexBufferVBO::setVertexStates() { void VertexBufferVBO::update( const Uint32& Types, bool Indices ) { unsigned int usageType = GL_STATIC_DRAW; - if ( mUsageType == VBO_USAGE_TYPE_DYNAMIC ) + if ( mUsageType == VertexBufferUsageType::Dynamic ) usageType = GL_DYNAMIC_DRAW; - else if ( mUsageType == VBO_USAGE_TYPE_STREAM ) + else if ( mUsageType == VertexBufferUsageType::Stream ) usageType = GL_STREAM_DRAW; for ( Int32 i = 0; i < VERTEX_FLAGS_COUNT; i++ ) { diff --git a/src/eepp/window/backend.hpp b/src/eepp/window/backend.hpp index 1dd1ba4e8..7fa20f1f4 100644 --- a/src/eepp/window/backend.hpp +++ b/src/eepp/window/backend.hpp @@ -5,11 +5,11 @@ namespace EE { namespace Window { namespace Backend { -class EE_API WindowBackend { +class EE_API WindowBackendLibrary { public: - inline WindowBackend() {} + inline WindowBackendLibrary() {} - inline virtual ~WindowBackend() {} + inline virtual ~WindowBackendLibrary() {} }; }}} // namespace EE::Window::Backend diff --git a/src/eepp/window/backend/SDL2/backendsdl2.cpp b/src/eepp/window/backend/SDL2/backendsdl2.cpp index 1e7307307..831ab186e 100644 --- a/src/eepp/window/backend/SDL2/backendsdl2.cpp +++ b/src/eepp/window/backend/SDL2/backendsdl2.cpp @@ -16,7 +16,7 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { -WindowBackendSDL2::WindowBackendSDL2() : WindowBackend() {} +WindowBackendSDL2::WindowBackendSDL2() : WindowBackendLibrary() {} WindowBackendSDL2::~WindowBackendSDL2() { #if EE_PLATFORM != EE_PLATFORM_MACOSX diff --git a/src/eepp/window/backend/SDL2/backendsdl2.hpp b/src/eepp/window/backend/SDL2/backendsdl2.hpp index bec0101e7..e4307587d 100644 --- a/src/eepp/window/backend/SDL2/backendsdl2.hpp +++ b/src/eepp/window/backend/SDL2/backendsdl2.hpp @@ -11,7 +11,7 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { -class EE_API WindowBackendSDL2 : public WindowBackend { +class EE_API WindowBackendSDL2 : public WindowBackendLibrary { public: WindowBackendSDL2(); diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 3cd43b87f..b8d4b3e1d 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -23,10 +23,10 @@ #endif #if EE_PLATFORM == EE_PLATFORM_WIN -#include +#include #include #include -#include +#include bool WindowsIsProcessRunning( const char* processName, bool killProcess = false ) { bool exists = false; diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 1b33fb08c..20e93a01c 100644 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -121,7 +121,7 @@ void Engine::destroy() { mWindow = NULL; } -Backend::WindowBackend* Engine::createSDL2Backend( const WindowSettings& Settings ) { +Backend::WindowBackendLibrary* Engine::createSDL2Backend( const WindowSettings& Settings ) { #if defined( EE_SDL_VERSION_2 ) return eeNew( Backend::SDL2::WindowBackendSDL2, () ); #else @@ -223,7 +223,7 @@ bool Engine::isRunning() const { return NULL != mWindow; } -Uint32 Engine::getDefaultBackend() const { +WindowBackend Engine::getDefaultBackend() const { #if DEFAULT_BACKEND == BACKEND_SDL2 return WindowBackend::SDL2; #endif @@ -240,10 +240,11 @@ WindowSettings Engine::createWindowSettings( IniFile* ini, std::string iniKeyNam bool Windowed = ini->getValueB( iniKeyName, "Windowed", true ); bool Resizeable = ini->getValueB( iniKeyName, "Resizeable", true ); bool Borderless = ini->getValueB( iniKeyName, "Borderless", false ); - bool UseDesktopResolution = ini->getValueB( iniKeyName, "UseDesktopResolution", false ); + bool useDesktopResolution = ini->getValueB( iniKeyName, "UseDesktopResolution", false ); std::string pixelDensityStr = ini->getValue( iniKeyName, "PixelDensity" ); float pixelDensity = PixelDensity::getPixelDensity(); - bool useScreenKeyboard = ini->getValueB( iniKeyName, "UseScreenKeyboard" ); + bool useScreenKeyboard = + ini->getValueB( iniKeyName, "UseScreenKeyboard", EE_SCREEN_KEYBOARD_ENABLED ); if ( !pixelDensityStr.empty() ) { if ( String::toLower( pixelDensityStr ) == "auto" ) { @@ -258,20 +259,20 @@ WindowSettings Engine::createWindowSettings( IniFile* ini, std::string iniKeyNam } } - std::string Backend = ini->getValue( iniKeyName, "Backend", "" ); - Uint32 WinBackend = getDefaultBackend(); + std::string backend = ini->getValue( iniKeyName, "Backend", "" ); + WindowBackend winBackend = getDefaultBackend(); - String::toLowerInPlace( Backend ); + String::toLowerInPlace( backend ); - if ( "sdl2" == Backend ) - WinBackend = WindowBackend::SDL2; + if ( "sdl2" == backend ) + winBackend = WindowBackend::SDL2; Uint32 Style = WindowStyle::Titlebar; if ( Borderless ) Style = WindowStyle::Borderless; - if ( UseDesktopResolution ) + if ( useDesktopResolution ) Style |= WindowStyle::UseDesktopResolution; if ( !Windowed ) @@ -283,7 +284,7 @@ WindowSettings Engine::createWindowSettings( IniFile* ini, std::string iniKeyNam std::string Icon = ini->getValue( iniKeyName, "WinIcon", "" ); std::string Caption = ini->getValue( iniKeyName, "WinCaption", "" ); - WindowSettings WinSettings( Width, Height, Caption, Style, WinBackend, BitColor, Icon, + WindowSettings WinSettings( Width, Height, Caption, Style, winBackend, BitColor, Icon, pixelDensity, useScreenKeyboard ); return WinSettings; @@ -305,7 +306,7 @@ ContextSettings Engine::createContextSettings( IniFile* ini, std::string iniKeyN String::toLowerInPlace( GLVersion ); - EEGL_version GLVer; + GraphicsLibraryVersion GLVer; if ( "3" == GLVersion || "opengl 3" == GLVersion || "gl3" == GLVersion || "opengl3" == GLVersion ) GLVer = GLv_3; diff --git a/src/eepp/window/inputtextbuffer.cpp b/src/eepp/window/inputtextbuffer.cpp index 2788dbd02..23d949113 100644 --- a/src/eepp/window/inputtextbuffer.cpp +++ b/src/eepp/window/inputtextbuffer.cpp @@ -21,7 +21,7 @@ InputTextBuffer::InputTextBuffer( const bool& active, const bool& newLineEnabled mFlags( 0 ), mCallback( 0 ), mPromptPos( 0 ), - mMaxLength( INPUT_LENGHT_MAX ), + mMaxLength( UINT32_MAX ), mSelCurInit( -1 ), mSelCurEnd( -1 ) { if ( NULL == mWindow ) { @@ -46,7 +46,7 @@ InputTextBuffer::InputTextBuffer( EE::Window::Window* window ) : mFlags( 0 ), mCallback( 0 ), mPromptPos( 0 ), - mMaxLength( INPUT_LENGHT_MAX ), + mMaxLength( UINT32_MAX ), mSelCurInit( -1 ), mSelCurEnd( -1 ) { if ( NULL == mWindow ) { @@ -714,15 +714,15 @@ String InputTextBuffer::getBuffer() const { } bool InputTextBuffer::changedSinceLastUpdate() { - return 0 != ( mFlags & ( 1 << INPUT_TB_CHANGE_SINCE_LAST_UPDATE ) ); + return 0 != ( mFlags & ( 1 << CHANGE_SINCE_LAST_UPDATE ) ); } void InputTextBuffer::setChangedSinceLastUpdate( const bool& Changed ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_CHANGE_SINCE_LAST_UPDATE, Changed == true ); + BitOp::writeBitKey( &mFlags, CHANGE_SINCE_LAST_UPDATE, Changed == true ); } void InputTextBuffer::autoPrompt( const bool& set ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_PROMPT_AUTO_POS, set == true ); + BitOp::writeBitKey( &mFlags, PROMPT_AUTO_POS, set == true ); if ( set ) { mPromptPos = (int)mText.size(); @@ -732,60 +732,60 @@ void InputTextBuffer::autoPrompt( const bool& set ) { } bool InputTextBuffer::autoPrompt() { - return 0 != ( mFlags & ( 1 << INPUT_TB_PROMPT_AUTO_POS ) ); + return 0 != ( mFlags & ( 1 << PROMPT_AUTO_POS ) ); } bool InputTextBuffer::isActive() const { - return 0 != ( mFlags & ( 1 << INPUT_TB_ACTIVE ) ); + return 0 != ( mFlags & ( 1 << ACTIVE ) ); } void InputTextBuffer::setActive( const bool& active ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_ACTIVE, active == true ); + BitOp::writeBitKey( &mFlags, ACTIVE, active == true ); } bool InputTextBuffer::setSupportNewLine() { - return 0 != ( mFlags & ( 1 << INPUT_TB_SUPPORT_NEW_LINE ) ); + return 0 != ( mFlags & ( 1 << SUPPORT_NEW_LINE ) ); } void InputTextBuffer::isNewLineEnabled( const bool& enabled ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_NEW_LINE, enabled == true ); + BitOp::writeBitKey( &mFlags, SUPPORT_NEW_LINE, enabled == true ); } void InputTextBuffer::setAllowOnlyNumbers( 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 ); + BitOp::writeBitKey( &mFlags, ALLOW_ONLY_NUMBERS, onlynums == true ); + BitOp::writeBitKey( &mFlags, ALLOW_DOT_IN_NUMBERS, allowdots == true ); } bool InputTextBuffer::onlyNumbersAllowed() { - return 0 != ( mFlags & ( 1 << INPUT_TB_ALLOW_ONLY_NUMBERS ) ); + return 0 != ( mFlags & ( 1 << ALLOW_ONLY_NUMBERS ) ); } bool InputTextBuffer::dotsInNumbersAllowed() { - return 0 != ( mFlags & ( 1 << INPUT_TB_ALLOW_DOT_IN_NUMBERS ) ); + return 0 != ( mFlags & ( 1 << ALLOW_DOT_IN_NUMBERS ) ); } bool InputTextBuffer::isFreeEditingEnabled() const { - return 0 != ( mFlags & ( 1 << INPUT_TB_FREE_EDITING ) ); + return 0 != ( mFlags & ( 1 << FREE_EDITING ) ); } void InputTextBuffer::setFreeEditing( const bool& enabled ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_FREE_EDITING, enabled == true ); + BitOp::writeBitKey( &mFlags, FREE_EDITING, enabled == true ); } void InputTextBuffer::supportCopyPaste( const bool& support ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_COPY_PASTE, support == true ); + BitOp::writeBitKey( &mFlags, SUPPORT_COPY_PASTE, support == true ); } bool InputTextBuffer::supportCopyPaste() { - return 0 != ( mFlags & ( 1 << INPUT_TB_SUPPORT_COPY_PASTE ) ); + return 0 != ( mFlags & ( 1 << SUPPORT_COPY_PASTE ) ); } bool InputTextBuffer::isTextSelectionEnabled() { - return 0 != ( mFlags & ( 1 << INPUT_TB_TEXT_SELECTION_ENABLED ) ); + return 0 != ( mFlags & ( 1 << TEXT_SELECTION_ENABLED ) ); } void InputTextBuffer::setTextSelectionEnabled( const bool& enabled ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_TEXT_SELECTION_ENABLED, enabled == true ); + BitOp::writeBitKey( &mFlags, TEXT_SELECTION_ENABLED, enabled == true ); } void InputTextBuffer::cursorToEnd() {