secondvoice/run_secondvoice.bat
StillHammer 7dec7a6eed fix: Résolution complète du problème OpenGL/ImGui avec threading
PROBLÈME RÉSOLU: Les shaders ImGui compilent maintenant avec succès!

Changements majeurs:
- Remplacé vcpkg ImGui par FetchContent (compilation from source)
- Créé wrapper GLAD pour ImGui (imgui_opengl3_glad.cpp)
- Ajout de makeContextCurrent() pour gérer le contexte OpenGL multi-thread
- Release du contexte dans initialize(), puis rendu current dans uiThread()

Root Cause Analysis:
1. Rendering s'exécute dans uiThread() (thread séparé)
2. Contexte OpenGL créé dans thread principal n'était pas accessible
3. glCreateShader retournait 0 avec GL_INVALID_OPERATION (erreur 1282)
4. Solution: Transfer du contexte OpenGL du thread principal vers uiThread

Debugging profond:
- Ajout de logs debug dans ImGui pour tracer glCreateShader
- Découvert que handle=0 indiquait échec de création (pas compilation)
- Identifié erreur WGL \"ressource en cours d'utilisation\" = contexte locked

Fichiers modifiés:
- vcpkg.json: Supprimé imgui
- CMakeLists.txt: FetchContent pour ImGui + imgui_backends library
- src/imgui_opengl3_glad.cpp: Nouveau wrapper GLAD
- src/ui/TranslationUI.{h,cpp}: Ajout makeContextCurrent()
- src/core/Pipeline.cpp: Appel makeContextCurrent() dans uiThread()
- build/.../imgui_impl_opengl3.cpp: Debug logs (temporaire)

Résultat: UI fonctionne! NVIDIA RTX 4060 GPU, OpenGL 3.3.0, shaders compilent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 16:37:47 +08:00

39 lines
863 B
Batchfile

@echo off
REM Force SecondVoice to use NVIDIA GPU
echo ========================================
echo SecondVoice - Launcher
echo ========================================
echo.
REM Set NVIDIA GPU preference
set SHIM_MCCOMPAT=0x800000001
set __COMPAT_LAYER=HIGHDPIAWARE
REM Check if .env exists
if not exist "build\mingw-Release\.env" (
echo [WARNING] .env file not found in build\mingw-Release\
echo.
echo Please create it with your API keys:
echo OPENAI_API_KEY=sk-...
echo ANTHROPIC_API_KEY=sk-ant-...
echo.
echo Press any key to continue anyway, or Ctrl+C to cancel
pause
)
echo Starting SecondVoice...
echo Using NVIDIA GPU (if available)
echo.
cd build\mingw-Release
SecondVoice.exe
if %errorlevel% neq 0 (
echo.
echo [ERROR] SecondVoice exited with error code: %errorlevel%
pause
)
exit /b %errorlevel%