summaryrefslogtreecommitdiff
path: root/main.py
blob: 84bbdf2e4ca33399ea8b6de621d20134a908f322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/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"