Example #1
0
def main():
    fgt.config(description = 'full-graphics raws parser/compiler')
    fgt.config.add_data_args()
    fgt.config.add_argument('-dump-dir', metavar='dir-name', 
            help="dump intermediate representation, dispatch, blitcode and the texture album here")
    fgt.config.add_argument('-lint', nargs='?', metavar='zstart', type=int, const=-1,
            help="cross-check compiler output, starting at z-level zstart; results written to 'lint.out'")
    fgt.config.parse_args()
    
    if fgt.config.dump_dir is not None and not os.path.isdir(fgt.config.dump_dir):
        os.mkdir(fgt.config.dump_dir)
    
    fgt.gl.sdl_offscreen_init()
    
    mo = fgt.raw.MapObject(     
        dfprefix = fgt.config.dfdir,
        fgraws = [ fgt.config.std ] + fgt.config.ext,
        apidir = fgt.config.apidir,
        dump_dir = fgt.config.dump_dir)

    mo.use_dump(fgt.config.dfdump, fgt.config.dump_dir)

    if fgt.config.lint is not None:
        mo.lint(fgt.config.lint)

    fgt.gl.sdl_fini()
    return 0
Example #2
0
def main():
    fgt.config(description="full-graphics renderer backend test")
    fgt.config.add_render_args(psize=96, par=0.8, ss="dumb", choke=2)
    fgt.config.add_gl_args()
    fgt.config.add_ui_args(uifont=",96")
    fgt.config.parse_args()

    window, context = sdl_init()
    glinfo()

    bg_color = (0, 1, 0, 1)
    fbo_color = (1, 0, 0, 1)

    grid = test_grid(window)
    hud = Hud()

    panels = []
    panels.append(HudTextPanel(["Yokarny Babai"]))
    panels[0].moveto(Coord2(100, 400))
    panels.append(HudTextPanel(["Skoromorkovka"]))
    panels[1].moveto(Coord2(400, 100))
    hud.reshape(Size2(window._w, window._h))
    loop(window, bg_color, fbo_color, grid, hud, panels, fgt.config.choke)
    sdl_fini()
    return 0
Example #3
0
def main():
    fgt.config(description = 'full-graphics ui layout engine test')
    fgt.config.add_render_args(psize=96, par=0.8, ss='dumb', choke=2)
    fgt.config.add_gl_args()
    fgt.config.add_ui_args(uifont = 'ubuntu mono 16')
    fgt.config.parse_args()

    window, context = sdl_init()
    glinfo()

    bg_color = ( 0,0.7,0,1 )

    ui = DumbUI()
    ui.loop(window, bg_color, fgt.config.choke)
    sdl_fini()
    return 0
Example #4
0
def main():
    fgt.config(description = 'full-graphics renderer testbed')
    fgt.config.add_render_args()
    fgt.config.add_gl_args()
    fgt.config.add_ui_args(uifont = ',18')
    fgt.config.add_data_args()
    fgt.config.add_argument('-afps', metavar='afps', type=float, default=12, help="animation fps")
    fgt.config.add_argument('-zeddown', metavar='zlevels', type=int, 
            help="number of z-levels to draw below current", default=4)
    fgt.config.parse_args()
    
    window, context = fgt.gl.sdl_init()
    
    mo = fgt.raw.MapObject(     
            dfprefix = fgt.config.dfdir,
            fgraws = [ fgt.config.std ] + fgt.config.ext,
            apidir = fgt.config.apidir,
            dump_dir = None)
    mo.use_dump(fgt.config.dfdump)

    rednr = fgt.gui.Rednerer(window, fgt.config.ss, mo, fgt.config.psize, 
                fgt.config.par, fgt.config.zeddown, fgt.config.afps)
    rednr.loop(fgt.config.choke)
    rednr.fini()