diff --git a/CMakeLists.txt b/CMakeLists.txt index d1bfa6c..3650794 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,14 +79,21 @@ list(APPEND OSTD_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/src/ostd/utils/Time.cpp ) list(APPEND OGFX_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/FontUtils.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/WindowBase.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/BasicRenderer.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/RawTextInput.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/Image.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/WindowBaseOutputHandler.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/PixelRenderer.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/Animation.cpp + # gui + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/gui/RawTextInput.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/gui/WindowBase.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/gui/WindowBaseOutputHandler.cpp + + # render + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/render/BasicRenderer.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/render/FontUtils.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/render/PixelRenderer.cpp + + # resources + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/resources/Image.cpp + + # utils + ${CMAKE_CURRENT_LIST_DIR}/src/ogfx/utils/Animation.cpp ) list(APPEND TEST_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/src/test.cpp diff --git a/extra/res/test.png b/extra/res/test.png deleted file mode 100644 index ad258d3..0000000 Binary files a/extra/res/test.png and /dev/null differ diff --git a/extra/testMidiFile.mid b/extra/testMidiFile.mid deleted file mode 100644 index c0e937c..0000000 Binary files a/extra/testMidiFile.mid and /dev/null differ diff --git a/other/build.nr b/other/build.nr index e8d0f83..70477d2 100644 --- a/other/build.nr +++ b/other/build.nr @@ -1 +1 @@ -2031 +2034 diff --git a/other/create_release.sh b/other/create_release.sh index 5364366..4ed4c7d 100755 --- a/other/create_release.sh +++ b/other/create_release.sh @@ -42,16 +42,23 @@ mkdir -p $RELEASE_DIR/include/ostd/io mkdir -p $RELEASE_DIR/include/ostd/math mkdir -p $RELEASE_DIR/include/ostd/string mkdir -p $RELEASE_DIR/include/ostd/utils -mkdir -p $RELEASE_DIR/include/ogfx/ +mkdir -p $RELEASE_DIR/include/ogfx/gui +mkdir -p $RELEASE_DIR/include/ogfx/render +mkdir -p $RELEASE_DIR/include/ogfx/resources +mkdir -p $RELEASE_DIR/include/ogfx/utils find ../src/ostd -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd \; find ../src/ostd/data -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/data \; find ../src/ostd/io -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/io \; find ../src/ostd/math -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/math \; find ../src/ostd/string -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/string \; find ../src/ostd/utils -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/utils \; -find ../src/ogfx -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ogfx \; find ../src/ostd/vendor -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/vendor \; find ../src/ostd/vendor/midifile -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ostd/vendor/midifile \; +find ../src/ogfx -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ogfx \; +find ../src/ogfx/gui -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ogfx/gui \; +find ../src/ogfx/render -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ogfx/render \; +find ../src/ogfx/resources -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ogfx/resources \; +find ../src/ogfx/utils -maxdepth 1 -name "*.h*" -exec cp {} $RELEASE_DIR/include/ogfx/utils \; cp -r ../src/ostd/vendor/nlohmann $RELEASE_DIR/include/ostd/vendor/ cp -r ../licences $RELEASE_DIR cp ../LICENSE $RELEASE_DIR/licences/OmniaFramework-LICENCE.txt diff --git a/src/ogfx/Image.cpp b/src/ogfx/Image.cpp deleted file mode 100644 index c456cb9..0000000 --- a/src/ogfx/Image.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "Image.hpp" -#include "io/Logger.hpp" -#include -#include -#include - -namespace ogfx -{ - void Image::destroy(void) - { - SDL_DestroyTexture(m_sdl_texture); - m_loaded = false; - m_sdl_texture = nullptr; - m_width = 0; - m_height = 0; - } - - Image& Image::loadFromFile(const ostd::String& filePath, BasicRenderer2D& gfx) - { - if (!gfx.isInitialized()) - return *this; //TODO: Error - m_sdl_texture = IMG_LoadTexture(gfx.getWindow().getSDLRenderer(), filePath.c_str()); - if (!m_sdl_texture) - { - OX_ERROR("Failed to load Image: %s", IMG_GetError()); - return *this; - } - SDL_QueryTexture(m_sdl_texture, nullptr, nullptr, &m_width, &m_height); - m_loaded = true; - setTypeName("ogfx::Image"); - validate(); - return *this; - } -} diff --git a/src/ogfx/RawTextInput.cpp b/src/ogfx/gui/RawTextInput.cpp similarity index 91% rename from src/ogfx/RawTextInput.cpp rename to src/ogfx/gui/RawTextInput.cpp index 5c7b5d5..cb0661c 100644 --- a/src/ogfx/RawTextInput.cpp +++ b/src/ogfx/gui/RawTextInput.cpp @@ -1,6 +1,26 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "RawTextInput.hpp" -#include -#include +#include "../gui/WindowBase.hpp" +#include "../../io/Logger.hpp" namespace ogfx { diff --git a/src/ogfx/RawTextInput.hpp b/src/ogfx/gui/RawTextInput.hpp similarity index 99% rename from src/ogfx/RawTextInput.hpp rename to src/ogfx/gui/RawTextInput.hpp index 7908fd6..7a412e6 100644 --- a/src/ogfx/RawTextInput.hpp +++ b/src/ogfx/gui/RawTextInput.hpp @@ -20,7 +20,7 @@ #pragma once -#include +#include #include namespace ogfx diff --git a/src/ogfx/WindowBase.cpp b/src/ogfx/gui/WindowBase.cpp similarity index 88% rename from src/ogfx/WindowBase.cpp rename to src/ogfx/gui/WindowBase.cpp index 272fce5..fe811c1 100644 --- a/src/ogfx/WindowBase.cpp +++ b/src/ogfx/gui/WindowBase.cpp @@ -1,7 +1,25 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "WindowBase.hpp" -#include "../ostd/utils/Time.hpp" -#include -#include +#include "../../ostd/utils/Time.hpp" namespace ogfx { @@ -12,7 +30,7 @@ namespace ogfx SDL_FreeCursor(m_cursor_Arrow); SDL_DestroyRenderer(m_renderer); SDL_DestroyWindow(m_window); - // IMG_Quit(); + IMG_Quit(); SDL_Quit(); TTF_Quit(); } diff --git a/src/ogfx/WindowBase.hpp b/src/ogfx/gui/WindowBase.hpp similarity index 98% rename from src/ogfx/WindowBase.hpp rename to src/ogfx/gui/WindowBase.hpp index d1b3db2..c625a70 100644 --- a/src/ogfx/WindowBase.hpp +++ b/src/ogfx/gui/WindowBase.hpp @@ -20,8 +20,7 @@ #pragma once -#include -#include +#include #include #include #include diff --git a/src/ogfx/WindowBaseOutputHandler.cpp b/src/ogfx/gui/WindowBaseOutputHandler.cpp similarity index 93% rename from src/ogfx/WindowBaseOutputHandler.cpp rename to src/ogfx/gui/WindowBaseOutputHandler.cpp index 265db29..55aca03 100644 --- a/src/ogfx/WindowBaseOutputHandler.cpp +++ b/src/ogfx/gui/WindowBaseOutputHandler.cpp @@ -1,6 +1,26 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "WindowBaseOutputHandler.hpp" -#include "BasicRenderer.hpp" -#include "../string/TextStyleParser.hpp" +#include "../render/BasicRenderer.hpp" +#include "../../string/TextStyleParser.hpp" namespace ogfx { diff --git a/src/ogfx/WindowBaseOutputHandler.hpp b/src/ogfx/gui/WindowBaseOutputHandler.hpp similarity index 99% rename from src/ogfx/WindowBaseOutputHandler.hpp rename to src/ogfx/gui/WindowBaseOutputHandler.hpp index 4cb52d1..5bd98be 100644 --- a/src/ogfx/WindowBaseOutputHandler.hpp +++ b/src/ogfx/gui/WindowBaseOutputHandler.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include namespace ogfx { diff --git a/src/ogfx/ogfx.hpp b/src/ogfx/ogfx.hpp new file mode 100644 index 0000000..c726c99 --- /dev/null +++ b/src/ogfx/ogfx.hpp @@ -0,0 +1,35 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + +#pragma once + +#include + +#include +#include +#include + +#include +#include + +#include + +#include +#include diff --git a/src/ogfx/BasicRenderer.cpp b/src/ogfx/render/BasicRenderer.cpp similarity index 88% rename from src/ogfx/BasicRenderer.cpp rename to src/ogfx/render/BasicRenderer.cpp index 40d5268..af579dd 100644 --- a/src/ogfx/BasicRenderer.cpp +++ b/src/ogfx/render/BasicRenderer.cpp @@ -1,6 +1,25 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "BasicRenderer.hpp" -#include "WindowBase.hpp" -#include +#include "../gui/WindowBase.hpp" namespace ogfx { diff --git a/src/ogfx/BasicRenderer.hpp b/src/ogfx/render/BasicRenderer.hpp similarity index 96% rename from src/ogfx/BasicRenderer.hpp rename to src/ogfx/render/BasicRenderer.hpp index 51b99b9..cbf9d8d 100644 --- a/src/ogfx/BasicRenderer.hpp +++ b/src/ogfx/render/BasicRenderer.hpp @@ -20,10 +20,10 @@ #pragma once -#include "Animation.hpp" -#include +#include +#include #include -#include +#include namespace ogfx { diff --git a/src/ogfx/FontUtils.cpp b/src/ogfx/render/FontUtils.cpp similarity index 87% rename from src/ogfx/FontUtils.cpp rename to src/ogfx/render/FontUtils.cpp index 1cb98b2..3e9e5a5 100644 --- a/src/ogfx/FontUtils.cpp +++ b/src/ogfx/render/FontUtils.cpp @@ -1,3 +1,23 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "FontUtils.hpp" namespace ogfx diff --git a/src/ogfx/FontUtils.hpp b/src/ogfx/render/FontUtils.hpp similarity index 98% rename from src/ogfx/FontUtils.hpp rename to src/ogfx/render/FontUtils.hpp index feff883..972198b 100644 --- a/src/ogfx/FontUtils.hpp +++ b/src/ogfx/render/FontUtils.hpp @@ -20,7 +20,7 @@ #pragma once -#include +#include #include #include diff --git a/src/ogfx/PixelRenderer.cpp b/src/ogfx/render/PixelRenderer.cpp similarity index 86% rename from src/ogfx/PixelRenderer.cpp rename to src/ogfx/render/PixelRenderer.cpp index 1f530a9..cb997ec 100644 --- a/src/ogfx/PixelRenderer.cpp +++ b/src/ogfx/render/PixelRenderer.cpp @@ -1,6 +1,26 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "PixelRenderer.hpp" -#include "WindowBase.hpp" -#include "../ostd/io/Memory.hpp" +#include "../gui/WindowBase.hpp" +#include "../../ostd/io/Memory.hpp" namespace ogfx { diff --git a/src/ogfx/PixelRenderer.hpp b/src/ogfx/render/PixelRenderer.hpp similarity index 98% rename from src/ogfx/PixelRenderer.hpp rename to src/ogfx/render/PixelRenderer.hpp index 23c6473..a80beb8 100644 --- a/src/ogfx/PixelRenderer.hpp +++ b/src/ogfx/render/PixelRenderer.hpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include namespace ogfx diff --git a/src/ogfx/resources/Image.cpp b/src/ogfx/resources/Image.cpp new file mode 100644 index 0000000..f7416a6 --- /dev/null +++ b/src/ogfx/resources/Image.cpp @@ -0,0 +1,53 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + +#include "Image.hpp" +#include "../../io/Logger.hpp" +#include "../render/BasicRenderer.hpp" +#include "../gui/WindowBase.hpp" + +namespace ogfx +{ + void Image::destroy(void) + { + SDL_DestroyTexture(m_sdl_texture); + m_loaded = false; + m_sdl_texture = nullptr; + m_width = 0; + m_height = 0; + } + + Image& Image::loadFromFile(const ostd::String& filePath, BasicRenderer2D& gfx) + { + if (!gfx.isInitialized()) + return *this; //TODO: Error + m_sdl_texture = IMG_LoadTexture(gfx.getWindow().getSDLRenderer(), filePath.c_str()); + if (!m_sdl_texture) + { + OX_ERROR("Failed to load Image: %s", IMG_GetError()); + return *this; + } + SDL_QueryTexture(m_sdl_texture, nullptr, nullptr, &m_width, &m_height); + m_loaded = true; + setTypeName("ogfx::Image"); + validate(); + return *this; + } +} diff --git a/src/ogfx/Image.hpp b/src/ogfx/resources/Image.hpp similarity index 97% rename from src/ogfx/Image.hpp rename to src/ogfx/resources/Image.hpp index ff95d87..d4fcbf3 100644 --- a/src/ogfx/Image.hpp +++ b/src/ogfx/resources/Image.hpp @@ -21,7 +21,7 @@ #pragma once #include -#include +#include #include namespace ogfx diff --git a/src/ogfx/Animation.cpp b/src/ogfx/utils/Animation.cpp similarity index 69% rename from src/ogfx/Animation.cpp rename to src/ogfx/utils/Animation.cpp index a9f734c..94064d2 100644 --- a/src/ogfx/Animation.cpp +++ b/src/ogfx/utils/Animation.cpp @@ -1,5 +1,25 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #include "Animation.hpp" -#include +#include "../../ostd/math/Random.hpp" namespace ogfx { diff --git a/src/ogfx/Animation.hpp b/src/ogfx/utils/Animation.hpp similarity index 73% rename from src/ogfx/Animation.hpp rename to src/ogfx/utils/Animation.hpp index 46a7e2e..f50a444 100644 --- a/src/ogfx/Animation.hpp +++ b/src/ogfx/utils/Animation.hpp @@ -1,8 +1,28 @@ +/* + OmniaFramework - A collection of useful functionality + Copyright (C) 2025 OmniaX-Dev + + This file is part of OmniaFramework. + + OmniaFramework is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OmniaFramework is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OmniaFramework. If not, see . +*/ + #pragma once #include #include -#include +#include namespace ogfx { diff --git a/src/ogfx/SDLInclude.hpp b/src/ogfx/utils/SDLInclude.hpp similarity index 92% rename from src/ogfx/SDLInclude.hpp rename to src/ogfx/utils/SDLInclude.hpp index fced569..c819932 100644 --- a/src/ogfx/SDLInclude.hpp +++ b/src/ogfx/utils/SDLInclude.hpp @@ -29,3 +29,6 @@ #include #include #include +#include +#include +#include diff --git a/src/ostd/data/Bitfields.hpp b/src/ostd/data/Bitfields.hpp index f95443b..d7eb3b9 100755 --- a/src/ostd/data/Bitfields.hpp +++ b/src/ostd/data/Bitfields.hpp @@ -21,6 +21,7 @@ #pragma once #include +#include #define get_bit(__bit_field, __bit_n ) __bit_field.bits.b##__bit_n #define set_bit(__bit_field, __bit_n ) __bit_field.bits.b##__bit_n = true diff --git a/src/ostd/data/Types.hpp b/src/ostd/data/Types.hpp index 4f60619..589878c 100755 --- a/src/ostd/data/Types.hpp +++ b/src/ostd/data/Types.hpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace ostd { diff --git a/src/ostd/utils/Async.hpp b/src/ostd/utils/Async.hpp index 007bf23..924ac10 100644 --- a/src/ostd/utils/Async.hpp +++ b/src/ostd/utils/Async.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace ostd { diff --git a/src/ostd/utils/PathFinder.hpp b/src/ostd/utils/PathFinder.hpp index bd5305a..b629b4c 100755 --- a/src/ostd/utils/PathFinder.hpp +++ b/src/ostd/utils/PathFinder.hpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace ostd { diff --git a/src/test.cpp b/src/test.cpp index 6d0c520..6c102c8 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -18,16 +18,7 @@ along with OmniaFramework. If not, see . */ -// #include -// #include -// #include -// #include - -#include "Image.hpp" -#include "utils/Hash.hpp" -#include -#include -#include +#include ostd::ConsoleOutputHandler out; @@ -50,10 +41,6 @@ class Window : public ogfx::WindowBase m_textInput.setEventListener(m_sigHandler); // m_textInput.setCharacterFilter(m_numCharFilter); m_textInput.getTheme().extraPaddingTop = 3; - - m_testImg.loadFromFile("res/test.png", m_gfx); - out.p("Image loaded: ").p(STR_BOOL(m_testImg.isLoaded())).nl(); - out.p(" ").p(m_testImg.getSize().x).nl(); } inline void handleSignal(ostd::tSignal& signal) override @@ -85,7 +72,6 @@ class Window : public ogfx::WindowBase inline void onRender(void) override { m_textInput.render(m_gfx); - // m_gfx.drawImage(m_testImg, { 0, 0 });ยด } inline void onFixedUpdate(double frameTime_s) override @@ -103,20 +89,10 @@ class Window : public ogfx::WindowBase ogfx::BasicRenderer2D m_gfx; ogfx::gui::RawTextInputEventListener m_sigHandler; ogfx::gui::RawTextInputNumberCharacterFilter m_numCharFilter; - - ogfx::Image m_testImg; }; -// void test2(const std::string& str) {} -// void test3(const ostd::String& str) {} -// void test4(const char* str) {} - int main(int argc, char** argv) { - out.p(STR_BOOL(ostd::Hash::md5("") == "d41d8cd98f00b204e9800998ecf8427e")).nl(); - out.p(STR_BOOL(ostd::Hash::md5("abc") == "900150983cd24fb0d6963f7d28e17f72")).nl(); - out.p(STR_BOOL(ostd::Hash::md5("message digest") == "f96b697d7cb7938d525a2f31aaf161d0")).nl(); - Window window; window.initialize(1280, 720, "OmniaFramework - Test Window"); window.setClearColor({ 0, 2 , 15 }); @@ -125,66 +101,5 @@ int main(int argc, char** argv) { window.update(); } - - - // out.fg(ostd::ConsoleColors::Red).p("Hello World!!").reset().nl(); - - // ostd::String str1, str2 = "Hello"; - // bool b = str1 == str2; - // const ostd::String str3 = "CIAO"; - // b = str2 == str1; - // b = str3 == "CICCIO"; - // // b = "ciao" == str2; - // str2 = str3; - // std::string str = "cc"; - // str1 = str; - // test2(str1); - // test3(str); - // str1 = str2 + str; - // str1 = str2 + "str"; - // str1 = str2 + str3; - // str1 = str2 + str1; - // test4(str1); - // test4(str3); - - // str1 += "ciao"; - // str1 += str; - // str1 += str1; - // str1 += str3; - // str1 += 'c'; - - // OX_FATAL(str2); - - // ostd::RegexRichString rgxrstr("Hello World"); - // rgxrstr.fg("Hello", "Blue"); - // std::cout << rgxrstr << "\n"; - - // out.nl().nl(); - // ostd::String test_str = "Hello World, my love"; - // ostd::String test_str_2 = "HEELO"; - // ostd::String test_str_3 = "0123456789"; - // out.p("==========\n"); - // test_str.fixedLength(10, ' ', ".........."); - // test_str_2.fixedLength(10); - // test_str_3.fixedLength(10); - // out.p(test_str).p("|").nl(); - // out.p(test_str_2).p("|").nl(); - // out.p(test_str_3).p("|").nl(); - - // ostd::KeyboardController keyboard; - // keyboard.disableCommandBuffer(); - - // out.p("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"); - // out.p("HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"); - // out.p("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); - // out.p(" "); - // out.p("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); - - // ostd::eKeys k = ostd::eKeys::NoKeyPressed; - // do - // { - // k = keyboard.waitForKeyPress(); - // } while (k != ostd::eKeys::Escape); - return 0; }