简体   繁体   English

如何设置OpenGL版本?

[英]How to set OpenGL version?

I am beginner in OpenGL, I am using latest opengl and GLFW libraries for windows context handling. 我是OpenGL的初学者,我使用最新的opengl和GLFW库进行Windows上下文处理。

I have two graphics cards in my laptop: 我的笔记本电脑中有两个图形卡:

  1. Intel HD Graphics 3000 英特尔高清显卡3000

  2. Nvidia GT 540 m 英伟达GT 540 m

But when I run 但是当我跑步时

const GLubyte* renderer = glGetString (GL_RENDERER); // get renderer string
const GLubyte* version = glGetString (GL_VERSION); // version as a string

printf ("Renderer: %s\n", renderer);
printf ("OpenGL version supported %s\n", version);

output: 输出:

Renderer: Intel HD Graphics 3000 OpenGL version supported 3.1.0 - Build 9.17.10.3223 渲染器:支持Intel HD Graphics 3000 OpenGL版本3.1.0-内部版本9.17.10.3223

My question is, how can I set default graphic card to NVIDIA and opengl version to 4.4 我的问题是,如何将默认图形卡设置为NVIDIA并将opengl版本设置为4.4

The videocard combo you have works in switchable mode, meaning that you can offload work to the NVIDIA when performance are needed and fall back to the (less demanding) Intel to save battery. 您拥有的视频卡组合可在可切换模式下工作,这意味着您可以在需要性能时将工作分担给NVIDIA,然后退回到(要求不高的)英特尔以节省电池。

That said, you have either to force enable NVIDIA card from BIOS (if possible) or use Optimus / Bumblebee to launch your application with access to the NVIDIA card. 也就是说,您必须强制从BIOS启用NVIDIA卡(如果可能),或者使用Optimus / Bumblebee启动可以访问NVIDIA卡的应用程序。

Thanks Stefano. 感谢Stefano。

I found a solution to select Nvidia card for my program, using Nvidia control panel 我找到了使用Nvidia控制面板为我的程序选择Nvidia卡的解决方案

Now my results are: 现在我的结果是:

Renderer: Nvidia GT 540M OpenGL version supported 4.4.0 渲染器:支持Nvidia GT 540M OpenGL版本4.4.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM