Only import glfw on demand
This commit is contained in:
parent
e1017929c4
commit
3f93b5353e
@ -15,8 +15,6 @@ from contextlib import contextmanager
|
|||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
|
|
||||||
import glfw
|
|
||||||
|
|
||||||
from .constants import terminfo_dir
|
from .constants import terminfo_dir
|
||||||
|
|
||||||
libc = ctypes.CDLL(None)
|
libc = ctypes.CDLL(None)
|
||||||
@ -127,6 +125,7 @@ def get_logical_dpi():
|
|||||||
|
|
||||||
|
|
||||||
def get_dpi():
|
def get_dpi():
|
||||||
|
import glfw
|
||||||
if not hasattr(get_dpi, 'ans'):
|
if not hasattr(get_dpi, 'ans'):
|
||||||
m = glfw.glfwGetPrimaryMonitor()
|
m = glfw.glfwGetPrimaryMonitor()
|
||||||
width, height = glfw.glfwGetMonitorPhysicalSize(m)
|
width, height = glfw.glfwGetMonitorPhysicalSize(m)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user