GroveEngine/tests/visual/test_use_sdl_and_iio.cpp
StillHammer 0540fbf526 fix: Resolve bgfx Frame 1 crash on Windows DLL + MinGW GCC 15 compatibility
- Add BGFX_CONFIG_MULTITHREADED=0 to fix TLS crash when bgfx runs from DLL
- Add -include stdint.h for MinGW GCC 15+ compatibility with bgfx third-party code
- Guard SDL2-dependent visual tests with if(SDL2_FOUND)
- Clean up debug logging in BgfxDevice::frame() and BgfxRendererModule::process()
- Re-enable all modules in test_full_stack_interactive.cpp
- Add grove::fs namespace for cross-platform filesystem operations
- Add InputModule C export for feedEvent across DLL boundary

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 11:03:06 +07:00

66 lines
1.6 KiB
C++

/**
* Test: USE SDL_Init + IntraIOManager together
* This reproduces what test_progressive does
*/
#include <fstream>
#include <iostream>
#include <SDL.h>
#include <grove/IntraIOManager.h>
#undef main
int main(int argc, char* argv[]) {
std::ofstream log("use_sdl_iio_test.log");
log << "=== Use SDL + IIO Test ===" << std::endl;
log << "Step 1: Program started" << std::endl;
log.flush();
std::cout << "Step 1: Program started" << std::endl;
// Test SDL
log << "Step 2: Calling SDL_Init..." << std::endl;
log.flush();
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
log << "ERROR: SDL_Init failed" << std::endl;
return 1;
}
log << "Step 3: SDL_Init OK" << std::endl;
log.flush();
// Test IntraIOManager
log << "Step 4: Getting IntraIOManager instance..." << std::endl;
log.flush();
try {
auto& ioManager = grove::IntraIOManager::getInstance();
log << "Step 5: IntraIOManager OK" << std::endl;
log.flush();
auto testIO = ioManager.createInstance("test");
log << "Step 6: Created IIO instance" << std::endl;
log.flush();
ioManager.removeInstance("test");
log << "Step 7: Removed IIO instance" << std::endl;
} catch (const std::exception& e) {
log << "ERROR: " << e.what() << std::endl;
SDL_Quit();
return 1;
}
SDL_Quit();
log << "Step 8: All tests passed!" << std::endl;
log << "Success - no crash!" << std::endl;
log.close();
std::cout << "Success! Check use_sdl_iio_test.log" << std::endl;
std::cout << "\nPress Enter to exit..." << std::endl;
std::cin.get();
return 0;
}