Changeset 964
- Timestamp:
- May 19, 2006, 7:44:27 AM (17 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca.h
r941 r964 152 152 caca_display_t * caca_create_display(cucul_canvas_t *); 153 153 void caca_free_display(caca_display_t *); 154 void caca_set_delay(caca_display_t *, unsigned int);155 154 void caca_refresh_display(caca_display_t *); 156 unsigned int caca_get_rendertime(caca_display_t *); 155 void caca_set_display_time(caca_display_t *, unsigned int); 156 unsigned int caca_get_display_time(caca_display_t *); 157 157 unsigned int caca_get_display_width(caca_display_t *); 158 158 unsigned int caca_get_display_height(caca_display_t *); -
libcaca/trunk/caca/graphics.c
r859 r964 29 29 * the X11 and Win32 drivers. 30 30 * 31 * \param dp The libcaca graphicalcontext.31 * \param dp The libcaca display context. 32 32 * \param title The desired display title. 33 33 * \return 0 upon success, a non-zero value if an error occurs. … … 45 45 * 6x10 font is being used. Note that the units are not necessarily pixels. 46 46 * 47 * \param dp The libcaca graphicalcontext.47 * \param dp The libcaca display context. 48 48 * \return The display width. 49 49 */ … … 60 60 * used. Note that the units are not necessarily pixels. 61 61 * 62 * \param dp The libcaca graphicalcontext.62 * \param dp The libcaca display context. 63 63 * \return The display height. 64 64 */ … … 77 77 * default behaviour. 78 78 * 79 * \param dp The libcaca graphicalcontext.79 * \param dp The libcaca display context. 80 80 * \param usec The refresh delay in microseconds. 81 81 */ 82 void caca_set_d elay(caca_display_t *dp, unsigned int usec)82 void caca_set_display_time(caca_display_t *dp, unsigned int usec) 83 83 { 84 84 dp->delay = usec; 85 85 } 86 86 87 /** \brief Get the average rendering time.87 /** \brief Get the display's average rendering time. 88 88 * 89 89 * This function returns the average rendering time, which is the average 90 90 * measured time between two caca_refresh_display() calls, in microseconds. If 91 * constant framerate was activated by calling caca_set_d elay(), the average92 * rendering time will not be considerably shorter than the requested delay93 * even if the real rendering time was shorter.91 * constant framerate was activated by calling caca_set_display_time(), the 92 * average rendering time will not be considerably shorter than the requested 93 * delay even if the real rendering time was shorter. 94 94 * 95 * \param dp The libcaca graphicalcontext.95 * \param dp The libcaca display context. 96 96 * \return The render time in microseconds. 97 97 */ 98 unsigned int caca_get_ rendertime(caca_display_t *dp)98 unsigned int caca_get_display_time(caca_display_t *dp) 99 99 { 100 100 return dp->rendertime; … … 107 107 * called. 108 108 * 109 * If caca_set_d elay() was called with a non-zero value,109 * If caca_set_display_time() was called with a non-zero value, 110 110 * caca_refresh_display() will use that value to achieve constant 111 * framerate: if two consecutive calls to caca_refresh_display() are 112 * within a time range shorter than the value set with caca_set_delay(),111 * framerate: if two consecutive calls to caca_refresh_display() are within 112 * a time range shorter than the value set with caca_set_display_time(), 113 113 * the second call will be delayed before performing the screen refresh. 114 114 * 115 * \param dp The libcaca graphicalcontext.115 * \param dp The libcaca display context. 116 116 */ 117 117 void caca_refresh_display(caca_display_t *dp) … … 155 155 * support it. 156 156 * 157 * \param dp The libcaca graphicalcontext.157 * \param dp The libcaca display context. 158 158 * \param flag 0 hides the pointer, 1 shows the system's default pointer 159 159 * (usually an arrow). Other values are reserved for future use. -
libcaca/trunk/python/pypycaca.c
r819 r964 16 16 static PyMethodDef CacaMethods[] = { 17 17 {"init", pycaca_init, METH_VARARGS, "Init libcaca"}, 18 {"set_d elay", pycaca_set_delay, METH_VARARGS, "Set delay"},19 {"get_ rendertime", pycaca_get_rendertime, METH_NOARGS, "Get render time"},18 {"set_display_time", pycaca_set_display_time, METH_VARARGS, "Set display time"}, 19 {"get_display_time", pycaca_get_display_time, METH_NOARGS, "Get render time"}, 20 20 {"get_width", pycaca_get_width, METH_NOARGS, "Get width"}, 21 21 {"get_height", pycaca_get_height, METH_NOARGS, "Get Height"}, … … 197 197 198 198 static PyObject * 199 pycaca_set_d elay(PyObject *self, PyObject *args)199 pycaca_set_display_time(PyObject *self, PyObject *args) 200 200 { 201 201 int value=0; 202 202 if (!PyArg_ParseTuple(args, "i", &value)) 203 caca_set_d elay(value);203 caca_set_display_time(value); 204 204 return Py_BuildValue("i", 1); /*FIXME*/ 205 205 } 206 206 207 207 static PyObject * 208 pycaca_get_ rendertime(PyObject *self, PyObject *args)209 { 210 int ret = caca_get_ rendertime();208 pycaca_get_display_time(PyObject *self, PyObject *args) 209 { 210 int ret = caca_get_display_time(); 211 211 return Py_BuildValue("i", ret); 212 212 } -
libcaca/trunk/python/pypycaca.h
r819 r964 25 25 pycaca_init(PyObject *self, PyObject *args); 26 26 static PyObject * 27 pycaca_set_d elay(PyObject *self, PyObject *args);27 pycaca_set_display_time(PyObject *self, PyObject *args); 28 28 static PyObject * 29 pycaca_get_ rendertime(PyObject *self, PyObject *args);29 pycaca_get_display_time(PyObject *self, PyObject *args); 30 30 static PyObject * 31 31 pycaca_get_width(PyObject *self, PyObject *args); -
libcaca/trunk/src/aafire.c
r859 r964 114 114 exit (1); 115 115 } 116 caca_set_d elay(dp, 10000);116 caca_set_display_time(dp, 10000); 117 117 XSIZ = cucul_get_canvas_width(cv) * 2; 118 118 YSIZ = cucul_get_canvas_height(cv) * 2 - 4; -
libcaca/trunk/src/cacaball.c
r859 r964 62 62 return 1; 63 63 64 caca_set_d elay(dp, 20000);64 caca_set_display_time(dp, 20000); 65 65 66 66 /* Make the palette eatable by libcaca */ -
libcaca/trunk/src/cacamoir.c
r859 r964 51 51 return 1; 52 52 53 caca_set_d elay(dp, 20000);53 caca_set_display_time(dp, 20000); 54 54 55 55 /* Fill various tables */ -
libcaca/trunk/src/cacaplas.c
r859 r964 55 55 return 1; 56 56 57 caca_set_d elay(dp, 20000);57 caca_set_display_time(dp, 20000); 58 58 59 59 c2 = cucul_create_canvas(cucul_get_canvas_width(cv), -
libcaca/trunk/test/demo.c
r892 r964 56 56 return 1; 57 57 58 caca_set_d elay(dp, 40000);58 caca_set_display_time(dp, 40000); 59 59 60 60 /* Initialize data */ … … 188 188 cucul_get_canvas_height(cv) - 2); 189 189 cucul_printf(cv, 4, 1, "[%i.%i fps]----", 190 1000000 / caca_get_ rendertime(dp),191 (10000000 / caca_get_ rendertime(dp)) % 10);190 1000000 / caca_get_display_time(dp), 191 (10000000 / caca_get_display_time(dp)) % 10); 192 192 caca_refresh_display(dp); 193 193 } -
libcaca/trunk/test/frames.c
r858 r964 43 43 44 44 dp = caca_create_display(cv); 45 caca_set_d elay(dp, 50000);45 caca_set_display_time(dp, 50000); 46 46 47 47 /* Fill the first 16 frames with a different colour */ -
libcaca/trunk/test/gamma.c
r858 r964 56 56 right = cucul_create_dither(32, 256, 4, 4 * 256, 57 57 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); 58 caca_set_d elay(dp, 20000);58 caca_set_display_time(dp, 20000); 59 59 60 60 for(x = 0; ; x++)
Note: See TracChangeset
for help on using the changeset viewer.