Browse Source

* Adapt the C++ bindings to the event API change.

tags/v0.99.beta14
Sam Hocevar sam 17 years ago
parent
commit
33f441b424
3 changed files with 4 additions and 5 deletions
  1. +2
    -2
      cxx/caca++.cpp
  2. +1
    -1
      cxx/caca++.h
  3. +1
    -2
      cxx/cxxtest.cpp

+ 2
- 2
cxx/caca++.cpp View File

@@ -18,10 +18,10 @@
* so on. * so on.
*/ */


#include <iostream>


#include "caca++.h" #include "caca++.h"



Caca::Caca(Cucul *cv) Caca::Caca(Cucul *cv)
{ {
dp = caca_create_display(cv->get_cucul_canvas_t()); dp = caca_create_display(cv->get_cucul_canvas_t());
@@ -78,7 +78,7 @@ int Caca::setTitle(char const *s)


int Caca::getEvent(unsigned int g, Event *n, int aa) int Caca::getEvent(unsigned int g, Event *n, int aa)
{ {
return caca_get_event(dp, g, &n->e, aa);
return caca_get_event(dp, g, n ? &n->e : NULL, aa);
} }


unsigned int Caca::getMouseX() unsigned int Caca::getMouseX()


+ 1
- 1
cxx/caca++.h View File

@@ -47,7 +47,7 @@ class Event
} type; } type;


protected: protected:
caca_event e;
caca_event_t e;
}; };


class Caca class Caca


+ 1
- 2
cxx/cxxtest.cpp View File

@@ -43,7 +43,6 @@ int main(int argc, char *argv[])
{ {
Cucul *qq, *pig; Cucul *qq, *pig;
Caca *kk; Caca *kk;
Event ev;


int x = 0, y = 0, ix = 1, iy = 1; int x = 0, y = 0, ix = 1, iy = 1;


@@ -76,7 +75,7 @@ int main(int argc, char *argv[])


kk->setDisplayTime(20000); kk->setDisplayTime(20000);


while(!kk->getEvent(ev.CACA_EVENT_KEY_PRESS, &ev, 0)) {
while(!kk->getEvent(Event::CACA_EVENT_KEY_PRESS, NULL, 0)) {




/* In case of resize ...*/ /* In case of resize ...*/


Loading…
Cancel
Save