Fixed Windows related problems

This commit is contained in:
OmniaX-Dev 2026-04-03 03:10:03 +02:00
parent 2764741cc3
commit 1e22cf8de6
7 changed files with 19 additions and 6 deletions

10
.clangd
View file

@ -1,2 +1,12 @@
CompileFlags:
CompilationDatabase: bin
Add:
[
"--target=x86_64-w64-mingw32",
"-IC:/msys64/ucrt64/include",
"-IC:/msys64/ucrt64/include/ucrt",
"-IC:/msys64/ucrt64/include/crt",
"-IC:/msys64/ucrt64/include/c++/12.2.0",
"-IC:/msys64/ucrt64/include/c++/12.2.0/x86_64-w64-mingw32",
"-IC:/msys64/ucrt64/usr/include",
]

View file

@ -125,7 +125,7 @@ target_include_directories(${OMNIA_GFX_LIB} PUBLIC ${INCLUDE_DIRS})
target_include_directories(${TEST_TARGET} PUBLIC ${INCLUDE_DIRS})
if (WIN32)
set(MSYS2_UCRT64 "C:/msys64/ucrt64")
set(MSYS2_UCRT64 "C:/msys64/ucrt64")
target_include_directories(${OMNIA_STD_LIB} PRIVATE
"${MSYS2_UCRT64}/include"
"${MSYS2_UCRT64}/include/c++/13.2.0"

View file

@ -22,7 +22,7 @@ Once you have the **MSYS2 UCRT64 terminal** open, run theese two commands to pre
```bash
pacman -Syuu
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-gdb mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-boost mingw-w64-ucrt-x86_64-SDL3 mingw-w64-ucrt-x86_64-SDL3_mixer mingw-w64-ucrt-x86_64-SDL3_image mingw-w64-ucrt-x86_64-SDL3_ttf
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-gdb mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-boost mingw-w64-ucrt-x86_64-sdl3 mingw-w64-ucrt-x86_64-sdl3-image mingw-w64-ucrt-x86_64-sdl3-ttf
```
#### Step 3: build OmniaFramework

1
build
View file

@ -21,6 +21,7 @@ if [[ "$1" == "debug" || "$1" == "release" ]]; then
rm -rf bin
cmake -B bin -S ./ -G "$MAKEFILE_TYPE" -DCMAKE_BUILD_TYPE=$BUILD_TYPE
$MAKE_COMMAND -C bin $NJOBS --no-print-directory
mkdir -p extra
find extra -mindepth 1 -maxdepth 1 -exec cp -r {} bin/ \;
build_number=$(cat other/build.nr)
build_number=$((build_number + 1))

View file

@ -1 +1 @@
2035
2039

View file

@ -45,11 +45,13 @@ namespace ogfx
m_title = title;
setBlockingEventsRefreshFPS(DefaultBlockingEventsFPS);
m_window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SDL_WINDOW_RESIZABLE);
m_window = SDL_CreateWindow("", m_windowWidth, m_windowHeight, SDL_WINDOW_RESIZABLE);
m_renderer = SDL_CreateRenderer(m_window, nullptr);
SDL_SetWindowMinimumSize(m_window, m_windowWidth, m_windowHeight);
SDL_SetWindowPosition(m_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
SDL_SetWindowTitle(m_window, m_title.c_str());
SDL_StartTextInput(m_window);
SDL_ShowWindow(m_window);
m_cursor_Arrow = SDL_CreateSystemCursor(SDL_SystemCursor::SDL_SYSTEM_CURSOR_DEFAULT);
m_cursor_IBeam = SDL_CreateSystemCursor(SDL_SystemCursor::SDL_SYSTEM_CURSOR_TEXT);

View file

@ -56,12 +56,12 @@ class Window : public ogfx::GraphicsWindow
return;
if (data.eventType == ogfx::gui::RawTextInput::eActionEventType::Enter)
{
out.fg(ostd::ConsoleColors::Green).p(data.sender.getText()).reset().nl();
out().fg(ostd::ConsoleColors::Green).p(data.sender.getText()).reset().nl();
data.sender.setText("");
}
else if (data.eventType == ogfx::gui::RawTextInput::eActionEventType::Tab)
{
out.fg(ostd::ConsoleColors::Red).p("TAB").reset().nl();
out().fg(ostd::ConsoleColors::Red).p("TAB").reset().nl();
data.sender.appendText("TAB");
}
}