Обнаружение профиля контекста OpenGL перед версией 3.2C++

Программы на C++. Форум разработчиков
Anonymous
Обнаружение профиля контекста OpenGL перед версией 3.2

Сообщение Anonymous »

Я пытаюсь обнаружить профиль контекста Opengl, созданный по умолчанию, созданный с помощью GLFW. Это то, как я его реализовал (на основе страницы вики) < /p>

Код: Выделить всё

std::string openGLProfile(){
// Prints the profile of the current context

GLint profile = 0;
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profile);

bool core_profile = profile & GL_CONTEXT_CORE_PROFILE_BIT;
bool compatibility_profile = profile & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;

std::string str = "No profile";

if (core_profile == true)
str = "Core profile";

else if (compatibility_profile == true)
str = "Compatibility";

std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/73745603/detect-the-opengl-context-profile-before-version-3-2[/url]

Вернуться в «C++»