File: test.py

package info (click to toggle)
pycg 0.14.1-2
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze
  • size: 184 kB
  • ctags: 17
  • sloc: sh: 124; makefile: 71; python: 28
file content (20 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python2.2
import Cg
import string

context = Cg.cgCreateContext()

if not context: sys.exit(1) ## print "Context is", context

# Load in the program
f = file("simple.cg")
programSource = string.join(f.readlines())

program = Cg.cgCreateProgram(context, Cg.CG_SOURCE, programSource, Cg.CG_PROFILE_ARBVP1, "main", None)
if not program: sys.exit(1) ## print "Program is", program

program = Cg.cgCreateProgram(context, Cg.CG_SOURCE, programSource, Cg.CG_PROFILE_ARBVP1, "main", ["-profileopts", "NumInstructionSlots=3000"])
if not program: sys.exit(1) ## print "Program is", program


Cg.cgDestroyContext(context)