I'm using Win11 VisualStudio 2022 sfml2.6.1
My project includes <SFML>&&<SFML-Imgui>&&<openCV>, everything works fine when running in the visual studio.But sth went wrong after I tried to run the exe file Created by Visual Studio Installer Project.
It says:
Failed to activate OpenGL context:
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 1.1 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Created: version = 0.0 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Failed to activate OpenGL context:
Failed to activate the window's context
Failed to activate OpenGL context:
Failed to activate the window's context
Failed to activate OpenGL context:
Failed to activate the window's context
Failed to activate OpenGL context:
Failed to activate the window's context
Failed to activate OpenGL context:
Failed to activate the window's context
.......
The window do come up and the Window's Events are Processed,but there is nothing Shown on the Screen.
I have built other project that includes SFML with Installer Project ,no problem occured .
int main() {
sf::ContextSettings settings;
settings.antialiasingLevel = 8;
sf::RenderWindow window(sf::VideoMode(1240, 800), "Map Maker", sf::Style::Default,settings);
font.loadFromFile("STXIHEI.TTF");
sf::Clock deltaClock;
ImGui::CreateContext();
ImGui::SFML::Init(window);
ImGui::StyleColorsLight();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.Fonts->Clear();
ImFont* Font = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\msyh.ttc", 25.0f, NULL, io.Fonts->GetGlyphRangesChineseFull());
ImGui::SFML::UpdateFontTexture();
while (window.isOpen()) {
window.clear(sf::Color::White);
ImGui::SFML::Update(window, deltaClock.restart());
sf::Event event;
while (window.pollEvent(event)) {
ImGui::SFML::ProcessEvent(event);
if (event.type == sf::Event::Closed)
window.close();
}
ImGui::SFML::Render(window);
window.display();
}
ImGui::SFML::Shutdown();
return 0;
}