KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
vblank.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 dc/vblank.h
4 Copyright (C) 2003 Megan Potter
5
6*/
7
8/** \file dc/vblank.h
9 \brief VBlank handler registration.
10 \ingroup system_vblank
11
12 This file allows functions to be registered to be called on each vblank
13 interrupt that occurs. This gives a way to schedule small functions that
14 must occur regularly, without using threads.
15
16 \author Megan Potter
17*/
18
19#ifndef __DC_VBLANK_H
20#define __DC_VBLANK_H
21
22#include <sys/cdefs.h>
23__BEGIN_DECLS
24
25#include <dc/asic.h>
26
27/** \defgroup system_vblank VBlank
28 \brief VBlank interrupt handler management
29 \ingroup system
30
31 @{
32*/
33
34/** \brief Add a vblank handler.
35
36 This function adds a handler to the vblank handler list. The function will
37 be called at the start of every vblank period with the same parameters that
38 were passed to the IRQ handler for vblanks.
39
40 \param hnd The handler to add.
41 \param data A user pointer that will be passed to the callback.
42
43 \return The handle id on success, or <0 on failure.
44*/
46
47/** \brief Remove a vblank handler.
48
49 This function removes the specified handler from the vblank handler list.
50
51 \param handle The handle id to remove (returned by
52 vblank_handler_add() when the handler was added).
53
54 \retval 0 On success.
55 \retval -1 On failure.
56*/
57int vblank_handler_remove(int handle);
58
59/* \cond */
60/** Initialize the vblank handler. This must be called after the asic module
61 is initialized. */
62int vblank_init(void);
63
64/** Shut down the vblank handler. */
65int vblank_shutdown(void);
66/* \endcond */
67
68/** @} */
69
70__END_DECLS
71
72#endif /* __DC_VBLANK_H */
73
Dreamcast ASIC event handling support.
void(* asic_evt_handler)(uint32_t code, void *data)
ASIC event handler type.
Definition asic.h:189
int vblank_handler_remove(int handle)
Remove a vblank handler.
int vblank_handler_add(asic_evt_handler hnd, void *data)
Add a vblank handler.