Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/platform/gl_context.py : 22%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of Xpra.
2# Copyright (C) 2017 Antoine Martin <antoine@xpra.org>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
6import sys
8from xpra.platform import platform_import
10GLContext = None
12def check_support():
13 return GLContext().check_support() #pylint: disable=not-callable
15platform_import(globals(), "gl_context", False, "GLContext", "check_support")
18def main():
19 from xpra.platform import program_context
20 from xpra.platform.gui import init as gui_init
21 from xpra.util import print_nested_dict
22 from xpra.log import enable_color, Logger
23 with program_context("OpenGL Native Context Check"):
24 gui_init()
25 enable_color()
26 log = Logger("opengl")
27 verbose = "-v" in sys.argv or "--verbose" in sys.argv
28 if verbose:
29 log.enable_debug()
30 if not GLContext:
31 log.error("Error: no GLContext available on %s", sys.platform)
32 return 1
33 try:
34 props = check_support()
35 except Exception:
36 log.error("%s().check_support()", exc_info=True)
37 return 1
38 log.info("")
39 log.info("OpenGL properties:")
40 print_nested_dict(props)
41 return 0
44if __name__ == "__main__":
45 sys.exit(main())