python - Kivy 不检测 OpenGL 2.0

标签 python opengl opengl-es kivy

<分区>

我决定在 Kivy 跨平台上做一些编程,并成功地在我的电脑上安装了 Kivy。问题是当我运行我的代码时,我得到这个错误:

[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)]
[INFO              ] [Factory     ] 179 symbols loaded
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO              ] [OSC         ] using <thread> for socket
[INFO              ] [Window      ] Provider: sdl2
[INFO              ] [GL          ] GLEW initialization succeeded
[INFO              ] [GL          ] OpenGL version <b'1.1.0'>
[INFO              ] [GL          ] OpenGL vendor <b'Microsoft Corporation'>
[INFO              ] [GL          ] OpenGL renderer <b'GDI Generic'>
[INFO              ] [GL          ] OpenGL parsed version: 1, 1
[CRITICAL          ] [GL          ] Minimum required OpenGL version (2.0) NOT found!

OpenGL version detected: 1.1

Version: b'1.1.0'
Vendor: b'Microsoft Corporation'
Renderer: b'GDI Generic'

Try upgrading your graphics drivers and/or your graphics hardware in case of problems.

The application will leave now.

然后弹出这个错误框:

Kivy Fatal Error

我已经通过 GPU Caps Viewer 检查了我的 GPU 的 OpenGL 版本,验证了我的 OpenGL 版本 2.1,但是 Kivy 不知何故没有检测到 OpenGL 2.1,而是默认使用 Microsoft 的 GDI Generic。我在互联网上做了一些研究,发现解决此问题的最佳方法是从您的显卡制造商处更新您的显卡驱动程序,但这对我来说不起作用。

我已经更新了我的图形驱动程序(我在 64 位 Windows 8 上运行 NVIDIA GeForce GT 435M)。

我的问题是:有没有办法让Kivy从GDI通用驱动切换到NVIDIA驱动?还是其他地方有问题?

最佳答案

如果问题仍然存在,请尝试以下操作:

import os
os.environ['KIVY_GL_BACKEND'] = 'angle_sdl2'

它对我有用(Windows 10、OpenGL 3.1、Python 3.6)。

关于python - Kivy 不检测 OpenGL 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34969990/

相关文章:

c - 使用不同颜色的三角形镶嵌球体

java - 如何在 android Java 中使用 GPUImageFilters 编辑色调饱和度和亮度?

Android 顶点数组对象?

python - 使用 Python 渲染 TTF 字形

python - Databricks 中的 Snowflake Python 连接器错误

opengl - 从透视变换到正交矩阵

windows - 如果您使用使用 OpenGL 的库,您在 Windows PC 上需要什么?

java - OpenGL ES 中的旋转

python - Django 时间戳

python - 读取 csv 文件并按列拆分,保留列名。 Pandas