GroveEngine/tests/visual/test_use_sdl.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

46 lines
1.1 KiB
C++

/**
* Test: Actually USE SDL_Init
* Find out if calling SDL functions causes the crash
*/
#include <fstream>
#include <iostream>
#include <SDL.h>
#undef main
int main(int argc, char* argv[]) {
std::ofstream log("use_sdl_test.log");
log << "=== Use SDL Test ===" << std::endl;
log << "Step 1: Program started" << std::endl;
log.flush();
std::cout << "Step 1: Program started" << std::endl;
// Actually call SDL_Init (like test_progressive does)
log << "Step 2: Calling SDL_Init..." << std::endl;
log.flush();
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
log << "ERROR: SDL_Init failed: " << SDL_GetError() << std::endl;
std::cerr << "SDL_Init failed" << std::endl;
return 1;
}
log << "Step 3: SDL_Init SUCCESS" << std::endl;
log.flush();
std::cout << "SDL_Init succeeded!" << std::endl;
SDL_Quit();
log << "Step 4: SDL_Quit done" << std::endl;
log << "Success - no crash!" << std::endl;
log.close();
std::cout << "\nPress Enter to exit..." << std::endl;
std::cin.get();
return 0;
}