Changeset 964


Ignore:
Timestamp:
May 19, 2006, 7:44:27 AM (17 years ago)
Author:
Sam Hocevar
Message:
  • Renamed caca_set_delay() and caca_get_rendertime() into caca_set_display_time() and caca_get_display_time() for consistency.
Location:
libcaca/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r941 r964  
    152152caca_display_t * caca_create_display(cucul_canvas_t *);
    153153void caca_free_display(caca_display_t *);
    154 void caca_set_delay(caca_display_t *, unsigned int);
    155154void caca_refresh_display(caca_display_t *);
    156 unsigned int caca_get_rendertime(caca_display_t *);
     155void caca_set_display_time(caca_display_t *, unsigned int);
     156unsigned int caca_get_display_time(caca_display_t *);
    157157unsigned int caca_get_display_width(caca_display_t *);
    158158unsigned int caca_get_display_height(caca_display_t *);
  • libcaca/trunk/caca/graphics.c

    r859 r964  
    2929 *  the X11 and Win32 drivers.
    3030 *
    31  *  \param dp The libcaca graphical context.
     31 *  \param dp The libcaca display context.
    3232 *  \param title The desired display title.
    3333 *  \return 0 upon success, a non-zero value if an error occurs.
     
    4545 *  6x10 font is being used. Note that the units are not necessarily pixels.
    4646 *
    47  *  \param dp The libcaca graphical context.
     47 *  \param dp The libcaca display context.
    4848 *  \return The display width.
    4949 */
     
    6060 *  used. Note that the units are not necessarily pixels.
    6161 *
    62  *  \param dp The libcaca graphical context.
     62 *  \param dp The libcaca display context.
    6363 *  \return The display height.
    6464 */
     
    7777 *  default behaviour.
    7878 *
    79  *  \param dp The libcaca graphical context.
     79 *  \param dp The libcaca display context.
    8080 *  \param usec The refresh delay in microseconds.
    8181 */
    82 void caca_set_delay(caca_display_t *dp, unsigned int usec)
     82void caca_set_display_time(caca_display_t *dp, unsigned int usec)
    8383{
    8484    dp->delay = usec;
    8585}
    8686
    87 /** \brief Get the average rendering time.
     87/** \brief Get the display's average rendering time.
    8888 *
    8989 *  This function returns the average rendering time, which is the average
    9090 *  measured time between two caca_refresh_display() calls, in microseconds. If
    91  *  constant framerate was activated by calling caca_set_delay(), the average
    92  *  rendering time will not be considerably shorter than the requested delay
    93  *  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.
    9494 *
    95  *  \param dp The libcaca graphical context.
     95 *  \param dp The libcaca display context.
    9696 *  \return The render time in microseconds.
    9797 */
    98 unsigned int caca_get_rendertime(caca_display_t *dp)
     98unsigned int caca_get_display_time(caca_display_t *dp)
    9999{
    100100    return dp->rendertime;
     
    107107 *  called.
    108108 *
    109  *  If caca_set_delay() was called with a non-zero value,
     109 *  If caca_set_display_time() was called with a non-zero value,
    110110 *  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(),
    113113 *  the second call will be delayed before performing the screen refresh.
    114114 *
    115  *  \param dp The libcaca graphical context.
     115 *  \param dp The libcaca display context.
    116116 */
    117117void caca_refresh_display(caca_display_t *dp)
     
    155155 *  support it.
    156156 *
    157  *  \param dp The libcaca graphical context.
     157 *  \param dp The libcaca display context.
    158158 *  \param flag 0 hides the pointer, 1 shows the system's default pointer
    159159 *              (usually an arrow). Other values are reserved for future use.
  • libcaca/trunk/python/pypycaca.c

    r819 r964  
    1616static PyMethodDef CacaMethods[] = {
    1717    {"init", pycaca_init, METH_VARARGS, "Init libcaca"},
    18     {"set_delay", 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"},
    2020    {"get_width", pycaca_get_width, METH_NOARGS, "Get width"},
    2121    {"get_height", pycaca_get_height, METH_NOARGS, "Get Height"},
     
    197197
    198198static PyObject *
    199 pycaca_set_delay(PyObject *self, PyObject *args)
     199pycaca_set_display_time(PyObject *self, PyObject *args)
    200200{
    201201  int value=0;
    202202  if (!PyArg_ParseTuple(args, "i", &value))
    203   caca_set_delay(value);
     203  caca_set_display_time(value);
    204204  return Py_BuildValue("i", 1); /*FIXME*/
    205205}
    206206
    207207static PyObject *
    208 pycaca_get_rendertime(PyObject *self, PyObject *args)
    209 {
    210   int ret = caca_get_rendertime();
     208pycaca_get_display_time(PyObject *self, PyObject *args)
     209{
     210  int ret = caca_get_display_time();
    211211  return Py_BuildValue("i", ret);
    212212}
  • libcaca/trunk/python/pypycaca.h

    r819 r964  
    2525pycaca_init(PyObject *self, PyObject *args);
    2626static PyObject *
    27 pycaca_set_delay(PyObject *self, PyObject *args);
     27pycaca_set_display_time(PyObject *self, PyObject *args);
    2828static PyObject *
    29 pycaca_get_rendertime(PyObject *self, PyObject *args);
     29pycaca_get_display_time(PyObject *self, PyObject *args);
    3030static PyObject *
    3131pycaca_get_width(PyObject *self, PyObject *args);
  • libcaca/trunk/src/aafire.c

    r859 r964  
    114114      exit (1);
    115115    }
    116   caca_set_delay(dp, 10000);
     116  caca_set_display_time(dp, 10000);
    117117  XSIZ = cucul_get_canvas_width(cv) * 2;
    118118  YSIZ = cucul_get_canvas_height(cv) * 2 - 4;
  • libcaca/trunk/src/cacaball.c

    r859 r964  
    6262        return 1;
    6363
    64     caca_set_delay(dp, 20000);
     64    caca_set_display_time(dp, 20000);
    6565
    6666    /* Make the palette eatable by libcaca */
  • libcaca/trunk/src/cacamoir.c

    r859 r964  
    5151        return 1;
    5252
    53     caca_set_delay(dp, 20000);
     53    caca_set_display_time(dp, 20000);
    5454
    5555    /* Fill various tables */
  • libcaca/trunk/src/cacaplas.c

    r859 r964  
    5555        return 1;
    5656
    57     caca_set_delay(dp, 20000);
     57    caca_set_display_time(dp, 20000);
    5858
    5959    c2 = cucul_create_canvas(cucul_get_canvas_width(cv),
  • libcaca/trunk/test/demo.c

    r892 r964  
    5656        return 1;
    5757
    58     caca_set_delay(dp, 40000);
     58    caca_set_display_time(dp, 40000);
    5959
    6060    /* Initialize data */
     
    188188                                          cucul_get_canvas_height(cv) - 2);
    189189            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);
    192192            caca_refresh_display(dp);
    193193        }
  • libcaca/trunk/test/frames.c

    r858 r964  
    4343
    4444    dp = caca_create_display(cv);
    45     caca_set_delay(dp, 50000);
     45    caca_set_display_time(dp, 50000);
    4646
    4747    /* Fill the first 16 frames with a different colour */
  • libcaca/trunk/test/gamma.c

    r858 r964  
    5656    right = cucul_create_dither(32, 256, 4, 4 * 256,
    5757                                0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
    58     caca_set_delay(dp, 20000);
     58    caca_set_display_time(dp, 20000);
    5959
    6060    for(x = 0; ; x++)
Note: See TracChangeset for help on using the changeset viewer.