def exec_test(path):
    fb = framebuffer_from_json(path)()
    try:
        fb.bind()
        fb.check()
    except LWJGLException as e:
        import traceback, os.path
        top = traceback.extract_stack()[-1]
        print ', '.join([str(e), os.path.basename(top[0]), str(top[1])])
        print "Couldn't make our framebuffer, checking for OpenGL errors"
        GFX.checkNoGLErrors("Error creating textures for inferred rendering:")
    finally:
        fb.unbind()
        fb.delete()
Example #2
0
def main(*argv):
	print "//---------------------------------------------"
	print
	print "Parsing startup arguments for shader editor"
	Drivers.clearMainDriver()
	
	from net.cemetech.sfgp.freebuild.gfx import GFX
	gfxCtx = GFX.init("Shader Editor Viz. Frame")
	if gfxCtx != None:
		print "Success!"
	else:
		print "Initialization failed."

	print 
	print "---------------------------------------------//"
	print
	
	from scripts.editor import shaderUI
	from java.util.concurrent import TimeUnit
	compiler_hook = shaderUI.init_editor()
	
	
	if gfxCtx != None:
		while gfxCtx.open():
			task = compiler_hook.tasks.poll(300,TimeUnit.MILLISECONDS) # This blocks too hard
			if task != None:
				task.run()