6.1 C
New York
Saturday, March 15, 2025

{hardware} – Having hassle setting opengl model to three.3


I am making an attempt to know how completely different variations of opengl work. I’m growing a sport aimed to assist opengl3.3 listed below are the specs of my system:

  • OS: Manjaro linux
  • Renderer: Mesa Intel(R) HD Graphics 520 (SKL GT2)

Once I test my supported opengl model I get this:

$ glxinfo | grep "OpenGL model"
OpenGL model string: 4.6 (Compatibility Profile) Mesa 24.2.8-arch1.1

Moreover I’m utilizing conan to produce my dependencies, so I’m utilizing these variations:

From what I perceive opengl is backwards suitable so opengl3.3 code will work on opengl4.6, however I do not wish to use 4.6 whereas growing so I do not by chance use opengl4.6 options by chance.

At present I attempt to set the model to opengl3.3 in my code by way of this:

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);

however then in a while I attempt to print out the present opengl model:

void print_opengl_info() {
    // Get OpenGL model and renderer data
    const char *model = (const char *)glGetString(GL_VERSION);
    const char *vendor = (const char *)glGetString(GL_VENDOR);
    const char *renderer = (const char *)glGetString(GL_RENDERER);
    const char *glslVersion = (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION);

    // Print OpenGL model and {hardware} particulars
    std::cout << "==== OpenGL Info ====" << std::endl;
    std::cout << "OpenGL Model: " << model << std::endl;
    std::cout << "Vendor: " << vendor << std::endl;
    std::cout << "Renderer: " << renderer << std::endl;
    std::cout << "GLSL Model: " << glslVersion << std::endl;
    std::cout << std::endl;

However I get the next output:

==== OpenGL Info ====
OpenGL Model: 4.6 (Core Profile) Mesa 24.2.8-arch1.1
Vendor: Intel
Renderer: Mesa Intel(R) HD Graphics 520 (SKL GT2)
GLSL Model: 4.60

However now I am confused, in my thoughts if I set the window trace to three.3 then this could have returned opengl3.3, but it surely exhibits opengl4.6 so it is not utilizing the model of opengl I requested, how can I make it goal opengl3.3 accurately?

(For much more particulars right here is the file that units up my window: https://github.com/cpp-toolbox/window/blob/essential/window.cpp)

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles