diff --git a/include/eepp/graphics/blendmode.hpp b/include/eepp/graphics/blendmode.hpp index 34c2d3857..b6f7f1136 100644 --- a/include/eepp/graphics/blendmode.hpp +++ b/include/eepp/graphics/blendmode.hpp @@ -8,7 +8,7 @@ namespace EE { namespace Graphics { class EE_API BlendMode { public: - enum class EE_API Factor { + enum class Factor { Zero, /// (0, 0, 0, 0) One, /// (1, 1, 1, 1) SrcColor, /// (src.r, src.g, src.b, src.a) @@ -21,7 +21,7 @@ class EE_API BlendMode { OneMinusDstAlpha /// (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a) }; - enum class EE_API Equation { + enum class Equation { Add, /// Pixel = Src * SrcFactor + Dst * DstFactor Subtract, /// Pixel = Src * SrcFactor - Dst * DstFactor ReverseSubtract /// Pixel = Dst * DstFactor - Src * SrcFactor diff --git a/include/eepp/graphics/font.hpp b/include/eepp/graphics/font.hpp index 62ec13848..e25e5e7df 100644 --- a/include/eepp/graphics/font.hpp +++ b/include/eepp/graphics/font.hpp @@ -17,7 +17,7 @@ class EE_API Glyph { int rsbDelta{ 0 }; //!< Right offset after forced autohint. Internally used by getKerning() }; -enum class EE_API FontType { TTF, BMF, Sprite }; +enum class FontType { TTF, BMF, Sprite }; enum FontHorizontalAlign { TEXT_ALIGN_LEFT = ( 0 << 0 ), diff --git a/include/eepp/graphics/glyphdrawable.hpp b/include/eepp/graphics/glyphdrawable.hpp index 266310c6d..e7785ec58 100644 --- a/include/eepp/graphics/glyphdrawable.hpp +++ b/include/eepp/graphics/glyphdrawable.hpp @@ -14,7 +14,7 @@ class EE_API GlyphDrawable : public DrawableResource { static GlyphDrawable* New( Texture* texture, const Rect& srcRect, const std::string& resourceName = "" ); - enum class EE_API DrawMode { + enum class DrawMode { Image, ///< It will be treated as a simple image, no special offset is applied. Text, ///< Will add the glyph offset corresponding to that character TextItalic ///< Will add the glyph offset corresponding to that character and simulate diff --git a/include/eepp/graphics/particlesystem.hpp b/include/eepp/graphics/particlesystem.hpp index a02002c76..8ae22f780 100644 --- a/include/eepp/graphics/particlesystem.hpp +++ b/include/eepp/graphics/particlesystem.hpp @@ -14,7 +14,7 @@ class Texture; /** @enum EE::Graphics::ParticleEffect Predefined effects for the particle system. Use Callback when * wan't to create a new effect, o set the parameters using NoFx, but it's much more limited. */ -enum class EE_API ParticleEffect : Uint32 { +enum class ParticleEffect : Uint32 { Nofx = 0, //!< User defined effect BlueBall, Fire, diff --git a/include/eepp/graphics/pixeldensity.hpp b/include/eepp/graphics/pixeldensity.hpp index 6de987cf0..0c89af055 100644 --- a/include/eepp/graphics/pixeldensity.hpp +++ b/include/eepp/graphics/pixeldensity.hpp @@ -12,7 +12,7 @@ using namespace EE::Math; namespace EE { namespace Graphics { -enum class EE_API PixelDensitySize : Uint32 { +enum class PixelDensitySize : Uint32 { MDPI = 1, //!< 1dp = 1px HDPI = 2, //!< 1dp = 1.5px XHDPI = 3, //!< 1dp = 2px diff --git a/include/eepp/graphics/texture.hpp b/include/eepp/graphics/texture.hpp index 7e529a27e..6a9123cab 100644 --- a/include/eepp/graphics/texture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -13,15 +13,15 @@ namespace EE { namespace Graphics { class EE_API Texture : public DrawableResource, public Image, private NonCopyable { public: /** @enum TextureFilter Defines the texture filter used. */ - enum class EE_API Filter : Uint32 { + enum class Filter : Uint32 { Linear, //!< Linear filtering (Smoothed Zoom) Nearest //!< No filtering (Pixeled Zoom) }; /** @enum ClampMode Set the clamp mode of the texture. */ - enum class EE_API ClampMode : Uint32 { ClampToEdge, ClampRepeat }; + enum class ClampMode : Uint32 { ClampToEdge, ClampRepeat }; - enum class EE_API CoordinateType : Uint32 { + enum class CoordinateType : Uint32 { Normalized, ///< Texture coordinates in range [0 .. 1] Pixels ///< Texture coordinates in range [0 .. size] }; diff --git a/include/eepp/graphics/vertexbufferhelper.hpp b/include/eepp/graphics/vertexbufferhelper.hpp index f38e00af9..3486e9816 100644 --- a/include/eepp/graphics/vertexbufferhelper.hpp +++ b/include/eepp/graphics/vertexbufferhelper.hpp @@ -4,7 +4,7 @@ namespace EE { namespace Graphics { /// VBO default usage type -enum class EE_API VertexBufferUsageType : int { +enum class VertexBufferUsageType : int { Static, Dynamic, Stream, diff --git a/include/eepp/system/log.hpp b/include/eepp/system/log.hpp index 3ec760c4a..737df276c 100644 --- a/include/eepp/system/log.hpp +++ b/include/eepp/system/log.hpp @@ -17,7 +17,7 @@ class LogReaderInterface { virtual void writeLog( const std::string& Text ) = 0; }; -enum class EE_API LogLevel : int { +enum class LogLevel : int { Debug, ///< Detailed debug information. Info, ///< Interesting events in your application. Notice, ///< Normal, but significant events in your application. diff --git a/include/eepp/ui/abstract/uiabstractview.hpp b/include/eepp/ui/abstract/uiabstractview.hpp index 7e825d7ab..51f013189 100644 --- a/include/eepp/ui/abstract/uiabstractview.hpp +++ b/include/eepp/ui/abstract/uiabstractview.hpp @@ -11,7 +11,7 @@ using namespace EE::UI::Models; namespace EE { namespace UI { namespace Abstract { -enum class EE_API ModelEventType { Open, OpenTree, CloseTree, OpenMenu }; +enum class ModelEventType { Open, OpenTree, CloseTree, OpenMenu }; class EE_API ModelEvent : public Event { public: diff --git a/include/eepp/ui/border.hpp b/include/eepp/ui/border.hpp index d87a45a26..7d378c0be 100644 --- a/include/eepp/ui/border.hpp +++ b/include/eepp/ui/border.hpp @@ -15,7 +15,7 @@ using namespace EE::Math; namespace EE { namespace UI { class UINode; -enum class EE_API BorderType : Uint32 { Inside, Outside, Outline }; +enum class BorderType : Uint32 { Inside, Outside, Outline }; struct EE_API Border { int width = 0; diff --git a/include/eepp/ui/css/propertydefinition.hpp b/include/eepp/ui/css/propertydefinition.hpp index 7f2e88e37..4909f7959 100644 --- a/include/eepp/ui/css/propertydefinition.hpp +++ b/include/eepp/ui/css/propertydefinition.hpp @@ -6,7 +6,7 @@ namespace EE { namespace UI { namespace CSS { -enum class EE_API PropertyId : Uint32 { +enum class PropertyId : Uint32 { Id = String::hash( "id" ), Class = String::hash( "class" ), X = String::hash( "x" ), @@ -209,7 +209,7 @@ enum class EE_API PropertyId : Uint32 { GravityOwner = String::hash( "gravity-owner" ), }; -enum class EE_API PropertyType : Uint32 { +enum class PropertyType : Uint32 { Undefined, String, Bool, @@ -227,7 +227,7 @@ enum class EE_API PropertyType : Uint32 { Time }; -enum class EE_API PropertyRelativeTarget : Uint32 { +enum class PropertyRelativeTarget : Uint32 { None, ContainingBlockWidth, ContainingBlockHeight, diff --git a/include/eepp/ui/css/shorthanddefinition.hpp b/include/eepp/ui/css/shorthanddefinition.hpp index fe4720dc7..4a283d587 100644 --- a/include/eepp/ui/css/shorthanddefinition.hpp +++ b/include/eepp/ui/css/shorthanddefinition.hpp @@ -8,7 +8,7 @@ namespace EE { namespace UI { namespace CSS { -enum class EE_API ShorthandId : Uint32 { +enum class ShorthandId : Uint32 { Margin = String::hash( "margin" ), Padding = String::hash( "padding" ), Transition = String::hash( "transition" ), diff --git a/include/eepp/ui/css/stylesheetpropertyanimation.hpp b/include/eepp/ui/css/stylesheetpropertyanimation.hpp index df282a154..20873f942 100644 --- a/include/eepp/ui/css/stylesheetpropertyanimation.hpp +++ b/include/eepp/ui/css/stylesheetpropertyanimation.hpp @@ -16,7 +16,7 @@ class UIWidget; namespace EE { namespace UI { namespace CSS { -enum class EE_API AnimationOrigin : uint8_t { User, Animation, Transition }; +enum class AnimationOrigin : uint8_t { User, Animation, Transition }; class EE_API StyleSheetPropertyAnimation : public Action { public: diff --git a/include/eepp/ui/css/stylesheetstyle.hpp b/include/eepp/ui/css/stylesheetstyle.hpp index 8fdbd9d76..2ba0f5c37 100644 --- a/include/eepp/ui/css/stylesheetstyle.hpp +++ b/include/eepp/ui/css/stylesheetstyle.hpp @@ -9,7 +9,7 @@ namespace EE { namespace UI { namespace CSS { -enum class EE_API AtRuleType : Uint32 { None, FontFace }; +enum class AtRuleType : Uint32 { None, FontFace }; class EE_API StyleSheetStyle { public: diff --git a/include/eepp/ui/doc/textdocument.hpp b/include/eepp/ui/doc/textdocument.hpp index 676746ca9..12c370688 100644 --- a/include/eepp/ui/doc/textdocument.hpp +++ b/include/eepp/ui/doc/textdocument.hpp @@ -35,15 +35,15 @@ class EE_API TextDocument { public: typedef std::function DocumentCommand; - enum class EE_API UndoRedo { Undo, Redo }; + enum class UndoRedo { Undo, Redo }; - enum class EE_API IndentType { IndentSpaces, IndentTabs }; + enum class IndentType { IndentSpaces, IndentTabs }; - enum class EE_API LineEnding { LF, CRLF, CR }; + enum class LineEnding { LF, CRLF, CR }; - enum class EE_API FindReplaceType { Normal, LuaPattern }; + enum class FindReplaceType { Normal, LuaPattern }; - enum class EE_API LoadStatus { Loaded, Interrupted, Failed }; + enum class LoadStatus { Loaded, Interrupted, Failed }; static std::string lineEndingToString( const LineEnding& le ) { switch ( le ) { diff --git a/include/eepp/ui/doc/undostack.hpp b/include/eepp/ui/doc/undostack.hpp index 18c1d9294..0774ed6a7 100644 --- a/include/eepp/ui/doc/undostack.hpp +++ b/include/eepp/ui/doc/undostack.hpp @@ -14,7 +14,7 @@ namespace EE { namespace UI { namespace Doc { class TextDocument; -enum class EE_API TextUndoCommandType { Insert, Remove, Selection }; +enum class TextUndoCommandType { Insert, Remove, Selection }; class EE_API TextUndoCommand { public: diff --git a/include/eepp/ui/models/filesystemmodel.hpp b/include/eepp/ui/models/filesystemmodel.hpp index 27619f38d..c387b9f2d 100644 --- a/include/eepp/ui/models/filesystemmodel.hpp +++ b/include/eepp/ui/models/filesystemmodel.hpp @@ -33,7 +33,7 @@ struct FileEvent { class EE_API FileSystemModel : public Model { public: - enum class EE_API Mode { DirectoriesOnly, FilesAndDirectories }; + enum class Mode { DirectoriesOnly, FilesAndDirectories }; struct DisplayConfig { DisplayConfig() {} diff --git a/include/eepp/ui/models/model.hpp b/include/eepp/ui/models/model.hpp index f66bbb32f..161f1068c 100644 --- a/include/eepp/ui/models/model.hpp +++ b/include/eepp/ui/models/model.hpp @@ -25,7 +25,7 @@ namespace EE { namespace UI { namespace Models { class PersistentHandle; -enum class EE_API SortOrder { None, Ascending, Descending }; +enum class SortOrder { None, Ascending, Descending }; class EE_API Model { public: @@ -152,8 +152,8 @@ class EE_API Model { ModelIndex createIndex( int row, int column, const void* data = nullptr, const Int64& internalId = 0 ) const; - enum class EE_API OperationType { Invalid = 0, Insert, Move, Delete, Reset }; - enum class EE_API Direction { Row, Column }; + enum class OperationType { Invalid = 0, Insert, Move, Delete, Reset }; + enum class Direction { Row, Column }; struct Operation { OperationType type{ OperationType::Invalid }; diff --git a/include/eepp/ui/models/modelrole.hpp b/include/eepp/ui/models/modelrole.hpp index 2f0964214..8f6853027 100644 --- a/include/eepp/ui/models/modelrole.hpp +++ b/include/eepp/ui/models/modelrole.hpp @@ -3,7 +3,7 @@ namespace EE { namespace UI { namespace Models { -enum class EE_API ModelRole { Display, Icon, Sort, Custom }; +enum class ModelRole { Display, Icon, Sort, Custom }; }}} // namespace EE::UI::Models diff --git a/include/eepp/ui/tools/uicodeeditorsplitter.hpp b/include/eepp/ui/tools/uicodeeditorsplitter.hpp index 0e6b5e356..46206ed84 100644 --- a/include/eepp/ui/tools/uicodeeditorsplitter.hpp +++ b/include/eepp/ui/tools/uicodeeditorsplitter.hpp @@ -17,7 +17,7 @@ class EE_API UICodeEditorSplitter { static const std::map getLocalDefaultKeybindings(); - enum class EE_API SplitDirection { Left, Right, Top, Bottom }; + enum class SplitDirection { Left, Right, Top, Bottom }; class EE_API Client { public: diff --git a/include/eepp/ui/uiclip.hpp b/include/eepp/ui/uiclip.hpp index 35ed10592..b89f40467 100644 --- a/include/eepp/ui/uiclip.hpp +++ b/include/eepp/ui/uiclip.hpp @@ -6,7 +6,7 @@ namespace EE { namespace UI { -enum class EE_API ClipType : Uint32 { None, ContentBox, PaddingBox, BorderBox }; +enum class ClipType : Uint32 { None, ContentBox, PaddingBox, BorderBox }; class UIClip { public: diff --git a/include/eepp/ui/uihelper.hpp b/include/eepp/ui/uihelper.hpp index f46f41365..973ec90e9 100644 --- a/include/eepp/ui/uihelper.hpp +++ b/include/eepp/ui/uihelper.hpp @@ -105,15 +105,15 @@ enum UINodeType { UI_TYPE_USER = 100000 }; -enum class EE_API ScrollBarMode : Uint32 { Auto, AlwaysOn, AlwaysOff }; +enum class ScrollBarMode : Uint32 { Auto, AlwaysOn, AlwaysOff }; -enum class EE_API UIOrientation : Uint32 { Vertical, Horizontal }; +enum class UIOrientation : Uint32 { Vertical, Horizontal }; -enum class EE_API SizePolicy : Uint32 { Fixed, MatchParent, WrapContent }; +enum class SizePolicy : Uint32 { Fixed, MatchParent, WrapContent }; -enum class EE_API PositionPolicy : Uint32 { None, LeftOf, RightOf, TopOf, BottomOf }; +enum class PositionPolicy : Uint32 { None, LeftOf, RightOf, TopOf, BottomOf }; -enum class EE_API UIScaleType : Uint32 { None, Expand, FitInside }; +enum class UIScaleType : Uint32 { None, Expand, FitInside }; static const Uint32 UI_NODE_DEFAULT_ALIGN = UI_HALIGN_LEFT | UI_VALIGN_CENTER; diff --git a/include/eepp/ui/uipushbutton.hpp b/include/eepp/ui/uipushbutton.hpp index 4c764bb53..408763d53 100644 --- a/include/eepp/ui/uipushbutton.hpp +++ b/include/eepp/ui/uipushbutton.hpp @@ -7,7 +7,7 @@ namespace EE { namespace UI { -enum class EE_API InnerWidgetOrientation { Left, Right, Center }; +enum class InnerWidgetOrientation { Left, Right, Center }; class EE_API UIPushButton : public UIWidget { public: diff --git a/include/eepp/ui/uiscenenode.hpp b/include/eepp/ui/uiscenenode.hpp index 0fe43da88..a23c97ada 100644 --- a/include/eepp/ui/uiscenenode.hpp +++ b/include/eepp/ui/uiscenenode.hpp @@ -22,7 +22,7 @@ class UIWidget; class UILayout; class UIIcon; -enum class EE_API ColorSchemePreference { Light, Dark }; +enum class ColorSchemePreference { Light, Dark }; class EE_API UISceneNode : public SceneNode { public: diff --git a/include/eepp/ui/uitreeview.hpp b/include/eepp/ui/uitreeview.hpp index c999f1f62..0ec12ba70 100644 --- a/include/eepp/ui/uitreeview.hpp +++ b/include/eepp/ui/uitreeview.hpp @@ -145,7 +145,7 @@ class EE_API UITreeView : public UIAbstractTableView { void updateContentSize(); protected: - enum class EE_API IterationDecision { + enum class IterationDecision { Continue, Break, Stop, diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index ddb27500d..3520a943c 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -29,7 +29,7 @@ enum WindowStyle { #endif }; -enum class EE_API WindowBackend : Uint32 { SDL2, Default }; +enum class WindowBackend : Uint32 { SDL2, Default }; #ifndef EE_SCREEN_KEYBOARD_ENABLED #if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS diff --git a/premake4.lua b/premake4.lua index 5456ce636..bc084677c 100644 --- a/premake4.lua +++ b/premake4.lua @@ -331,6 +331,12 @@ static_backends = { } backend_selected = false remote_sdl2_version = "SDL2-2.0.20" +function build_arch_configuration() + if os.is_real("mingw32") or os.is_real("mingw64") then + buildoptions { "-D__USE_MINGW_ANSI_STDIO=1" } + end +end + function build_base_configuration( package_name ) includedirs { "src/thirdparty/zlib" } @@ -344,6 +350,7 @@ function build_base_configuration( package_name ) set_ios_config() set_xcode_config() + build_arch_configuration() configuration "debug" defines { "DEBUG" } @@ -384,6 +391,7 @@ function build_base_cpp_configuration( package_name ) set_ios_config() set_xcode_config() + build_arch_configuration() configuration "debug" defines { "DEBUG", "EE_DEBUG", "EE_MEMORY_MANAGER" } @@ -549,6 +557,10 @@ function build_link_configuration( package_name, use_ee_icon ) end end + set_ios_config() + set_xcode_config() + build_arch_configuration() + configuration "debug" defines { "DEBUG", "EE_DEBUG", "EE_MEMORY_MANAGER" } flags { "Symbols" } @@ -608,9 +620,6 @@ function build_link_configuration( package_name, use_ee_icon ) if _OPTIONS["with-gles2"] and not _OPTIONS["force-gles1"] then linkoptions{ "-s FULL_ES2=1" } end - - set_ios_config() - set_xcode_config() end function generate_os_links() diff --git a/premake5.lua b/premake5.lua index 71bd8c84d..905794761 100644 --- a/premake5.lua +++ b/premake5.lua @@ -177,10 +177,10 @@ end function build_arch_configuration() filter {"architecture:x86", "options:cc=mingw"} - buildoptions { "-B /usr/bin/i686-w64-mingw32-" } + buildoptions { "-D__USE_MINGW_ANSI_STDIO=1 -B /usr/bin/i686-w64-mingw32-" } filter {"architecture:x86_64", "options:cc=mingw"} - buildoptions { "-B /usr/bin/x86_64-w64-mingw32-" } + buildoptions { "-D__USE_MINGW_ANSI_STDIO=1 -B /usr/bin/x86_64-w64-mingw32-" } end function build_base_configuration( package_name ) diff --git a/src/eepp/system/filesystem.cpp b/src/eepp/system/filesystem.cpp index 4c43d6bf6..63d68f7b6 100644 --- a/src/eepp/system/filesystem.cpp +++ b/src/eepp/system/filesystem.cpp @@ -198,7 +198,7 @@ bool FileSystem::fileWrite( const std::string& filepath, const std::string& data bool FileSystem::fileRemove( const std::string& filepath ) { #if EE_PLATFORM == EE_PLATFORM_WIN - return DeleteFile( String( filepath ).toWideString().c_str() ); + return DeleteFileW( String( filepath ).toWideString().c_str() ); #else return 0 == remove( filepath.c_str() ); #endif @@ -300,7 +300,7 @@ bool FileSystem::isDirectory( const std::string& path ) { static inline bool eepp_mkdir( const std::string& path, const Uint16& mode ) { #if EE_PLATFORM == EE_PLATFORM_WIN - return 0 != CreateDirectory( String( path ).toWideString().c_str(), NULL ); + return 0 != CreateDirectoryW( String( path ).toWideString().c_str(), NULL ); #else int v; v = mkdir( path.c_str(), mode ); diff --git a/src/thirdparty/efsw b/src/thirdparty/efsw index 4a3a3a5fd..23f603887 160000 --- a/src/thirdparty/efsw +++ b/src/thirdparty/efsw @@ -1 +1 @@ -Subproject commit 4a3a3a5fdd65c584d8ed9415dfbffcec088527c3 +Subproject commit 23f6038879bdb2223ddebc6459618593565345e8