source: libcaca/trunk/cpp/caca++.cpp @ 785

Last change on this file since 785 was 784, checked in by Jean-Yves Lamoureux, 15 years ago
  • Added license in C++ files.
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1/*
2 *  libcaca++      C++ bindings for libcaca
3 *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
4 *                All Rights Reserved
5 *
6 *  $Id: caca++.cpp 784 2006-04-17 11:06:48Z jylam $
7 *
8 *  This library is free software; you can redistribute it and/or
9 *  modify it under the terms of the Do What The Fuck You Want To
10 *  Public License, Version 2, as published by Sam Hocevar. See
11 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12 */
13
14/*
15 *  This file contains the main functions used by \e libcaca++ applications to
16 *  initialise the library, get the screen properties, set the framerate and
17 *  so on.
18 */
19
20
21#include "caca++.h"
22
23
24Caca::Caca(void)
25{
26
27}
28Caca::Caca(Cucul *qq)
29{
30    kk = caca_attach(qq->get_cucul_t());
31    if(!kk) throw -1;
32}
33Caca::~Caca()
34{
35    caca_detach(kk);
36}
37void Caca::attach(Cucul *qq)
38{
39    kk = caca_attach(qq->get_cucul_t());
40    if(!kk) throw -1;
41}
42void    Caca::detach ()
43{
44    caca_detach(kk);
45}
46void    Caca::set_delay (unsigned int d)
47{
48    caca_set_delay(kk, d);
49}
50void    Caca::display ()
51{
52    caca_display(kk);
53}
54unsigned int    Caca::get_rendertime ()
55{
56    return caca_get_rendertime(kk);
57}
58unsigned int    Caca::get_window_width ()
59{
60    return caca_get_window_width(kk);
61}
62unsigned int    Caca::get_window_height ()
63{
64    return caca_get_window_height(kk);
65}
66int     Caca::set_window_title (char const *s)
67{
68    return caca_set_window_title(kk, s);
69}
70int     Caca::get_event (unsigned int g, Caca::Event *n, int aa)
71{
72    return caca_get_event(kk, g, n->e, aa);
73}
74unsigned int    Caca::get_mouse_x ()
75{
76    return caca_get_mouse_x(kk);
77}
78unsigned int    Caca::get_mouse_y ()
79{
80    return caca_get_mouse_x(kk);
81}
82void    Caca::set_mouse (int v)
83{
84     caca_set_mouse(kk, v);
85}
Note: See TracBrowser for help on using the repository browser.