-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
127 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule kaacore
updated
51 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cdef extern from "<chrono>" namespace "std::chrono" nogil: | ||
cdef cppclass duration[Repr, Period=*]: | ||
duration() | ||
duration(Repr) except + | ||
|
||
Repr count() | ||
|
||
|
||
cdef extern from "kaacore/clock.h" nogil: | ||
ctypedef duration[long double] CSeconds "kaacore::Seconds" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
from libcpp cimport bool | ||
from libc.stdint cimport uint32_t | ||
from libcpp.functional cimport function | ||
|
||
from .scenes cimport CScene | ||
from .clock cimport CSeconds | ||
from .exceptions cimport raise_py_error | ||
from .glue cimport CPythonicCallbackWrapper, CPythonicCallbackResult | ||
|
||
|
||
cdef extern from "kaacore/timers.h" nogil: | ||
ctypedef function[void()] CTimerCallback "kaacore::TimerCallback" | ||
cdef cppclass CTimerContext "kaacore::TimerContext": | ||
CSeconds interval | ||
CScene* scene | ||
|
||
cdef cppclass CTimerCallback "kaacore::TimerCallback": | ||
pass | ||
|
||
cdef cppclass CTimer "kaacore::Timer": | ||
CTimer() | ||
CTimer(const CTimerCallback callback, const uint32_t interval, | ||
const bool single_shot | ||
) | ||
CTimer(const CTimerCallback callback) | ||
|
||
void start() except +raise_py_error | ||
void start_global(const CSeconds seconds) except +raise_py_error | ||
void start(const CSeconds seconds, CScene* const scene) except +raise_py_error | ||
bool is_running() | ||
void stop() | ||
uint32_t interval() | ||
void interval(uint32_t) except +raise_py_error | ||
bool single_shot() | ||
void single_shot(bool) except +raise_py_error | ||
|
||
cdef extern from "extra/include/pythonic_callback.h": | ||
ctypedef CPythonicCallbackResult[void] (*CythonTimerCallback)(const CPythonicCallbackWrapper&) | ||
CythonTimerCallback bind_cython_timer_callback( | ||
ctypedef CPythonicCallbackResult[CSeconds] (*CythonTimerCallback)(const CPythonicCallbackWrapper&, CTimerContext) | ||
CTimerCallback bind_cython_timer_callback( | ||
const CythonTimerCallback cy_handler, | ||
const CPythonicCallbackWrapper callback | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.