#!/usr/bin/env python from ctypes import * import os import sys import drm import pylladium os.environ["LD_BIND_NOW"] = "Yes, please!" raw = CDLL(sys.argv[1]) raw.drmOpen.argtypes = [c_char_p, c_char_p] raw.drmOpen.restype = c_int raw.drm_api_create.restype = POINTER(drm.drm_api) da = drm.DrmApi(raw) print "Loaded drm_api object, name %s" % da.name s = da.create_screen(raw.drmOpen(da.name, None)) print "Created screen, name %s vendor %s" % (s.name, s.vendor) if s.params["GLSL"]: print "Whoo, GLSL!" else: print "No GLSL..." b = pylladium.Bindings() b.RENDER_TARGET = True b.SAMPLER_VIEW = True g = pylladium.Geom() for name, number in pylladium.by_name.iteritems(): if s.is_format_supported(number, 2, b, g): print "%s is an acceptable FBO colorbuf" % name c = pylladium.Context(s) print "Created context"