# Copyright (c) 2007 SIEGE Development Team
# All rights reserved.
#
# This file is part of libSIEGE.
#
# This software is copyrighted work licensed under the terms of the
# 2-clause BSD license. Please consult the file "license.txt" for
# details.
#
# If you did not recieve the file with this program, please email
# Tim Chas <darkuranium@gmail.com>.

from siege.common cimport *
cimport core

def loadModule(name):
    return bool(sgLoadModule(name))

def loadModules(*names):
    cdef int sum = 0
    for name in names:
        if loadModule(name):
            sum += 1
    return sum

def init(width, height, bpp, flags):
    return sgInit(width, height, bpp, flags)

def _deinit():
    return sgDeinit()

def run():
    return sgRun()

def loop():
    cdef SGint code
    cdef SGbool ret = sgLoop(&code)
    return (bool(ret), code)

def stop(ret):
    sgStop(ret)

def getTick():
    return sgGetTick()
