# Problem with generating triangles

**URL:** <https://discourse.glfw.org/t/problem-with-generating-triangles/2147>\
**Category:** support\
**Created:** [September 6, 2022, 1:16pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147 "2022-09-06T13:16:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![controltheorist86](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@controltheorist86](https://discourse.glfw.org/u/controltheorist86)\
**Post date:** [September 6, 2022, 1:16pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147/1 "2022-09-06T13:16:34Z")

</div>

Hi all, I am new. The title says all. I am trying to follow the basic tutorial for generating shapes in opengl using glfw. When it comes these lines:

```auto
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR,4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,4);
glfwWindowHint(GLFW_OPENGL_PROFILE,GLFW_OPENGL_CORE_PROFILE);

```

GLFW error 65543: Requested OpenGL version 4.4, got version 2.1  
Failed to create a glfw window

Even though I use a version 2 or 3 for both major and minor context version I return an error. This things is solved if I comment those lines. However I am never able to generate any shapes exept changing background color.

Another strange thing is that: if I ask read the output of

```auto
std::cout << "Renderer: " << glGetString(GL_RENDERER) << std::endl;
std::cout << "Version: " << glGetString(GL_VERSION) << std::endl;
std::cout << "Shading Language: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl;

```

I obtain:  
**2.1 Mesa 10.0.2 (git-675cd84)**  
**Renderer: Gallium 0.4 on llvmpipe (LLVM 3.4, 256 bits)**  
**Version: 2.1 Mesa 10.0.2 (git-675cd84)**  
**Shading Language: 1.30**

So it looks like I have a 2.1 of opengl. However if I use the application OpenGL Extensions Viewer 6.3.7.0 I got an OpenGL version 4.3 and the information are:

**Renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2**  
**Vendor: NVIDIA Corporation**  
**Version: 4.6.0 NVIDIA 512.52**  
**Shading language version: 4.60 NVIDIA**

Max texture size: 32768 x 32768  
Max vertex texture image units: 32  
Max texture image units: 32  
Max geometry texture units: 32  
Max anisotropic filtering value: 16  
Max viewport size: 32768 x 32768  
Max Clip Distances: 8  
Max samples: 16  
[…]

Where I am wrong?  
Thank you all!

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [September 6, 2022, 2:13pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147/2 "2022-09-06T14:13:44Z")

</div>

What operating system are you on, and do you have a CPU with an integrated GPU (if so is your PC a laptop with NVIDIA Optimus technology or similar)?

---

<div class="post-metadata">

**Author:** ![controltheorist86](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@controltheorist86](https://discourse.glfw.org/u/controltheorist86)\
**Post date:** [September 6, 2022, 3:52pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147/3 "2022-09-06T15:52:13Z")

</div>

Thanks for the reply. I do have a desktop computer Intel Core i5 8400 CPU 2.8GHz, 2808Mhz,6cores,6 logic processors with Windows 10 64bit with a separated graphic card (Nvidia Geforce GTX 1050 Ti)

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [September 6, 2022, 5:30pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147/4 "2022-09-06T17:30:54Z")

</div>

Are you running the application under WSL2, MSYS2 or in a Virtual Machine? Normally you shouldn’t be seeing Mesa/Gallium unless you’ve installed it yourself somehow.

---

<div class="post-metadata">

**Author:** ![controltheorist86](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@controltheorist86](https://discourse.glfw.org/u/controltheorist86)\
**Post date:** [September 6, 2022, 6:18pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147/5 "2022-09-06T18:18:12Z")

</div>

Interesting point. I actually work directly on my computer. However last year I enabled a kind of virtual machina to use Ubuntu on Windows. It is a feature available on Windows 10. I hope there are no interaction between them as I have installed several graphic libraries to visualize CFD results.  
Is there any way to force it to see the correct opengl version?

---

<div class="post-metadata">

**Author:** ![controltheorist86](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@controltheorist86](https://discourse.glfw.org/u/controltheorist86)\
**Post date:** [September 6, 2022, 7:30pm UTC](https://discourse.glfw.org/t/problem-with-generating-triangles/2147/6 "2022-09-06T19:30:37Z")

</div>

I repeated all using, instead of Dev C++, Visual Studio 2022 and all works sweet.  
So I must have made error in using glfw library. Instead in Visual Studio I had to generate the library by myself via CMake and the thing works better.

If I have some time I will try to repeat the same passage I have done with VS2022 with Dev C++.

Thank you. Topic can be closed.
