paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/src/core pgtimerobject.cpp,NONE,1.1.2.1 Makef


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/core pgtimerobject.cpp,NONE,1.1.2.1 Makefile.am,1.1.6.1,1.1.6.2
Date: Tue, 28 May 2002 16:18:14 -0400

Update of /cvsroot/paragui/paragui/src/core
In directory subversions:/tmp/cvs-serv26030/src/core

Modified Files:
      Tag: devel-1-0
        Makefile.am 
Added Files:
      Tag: devel-1-0
        pgtimerobject.cpp 
Log Message:
added PG_TimerObject class
adapted animation sample



--- NEW FILE ---
#include "pgtimerobject.h"

Uint32 PG_TimerObject::my_objectcount = 0;

PG_TimerObject::PG_TimerObject() {
        if(my_objectcount == 0) {
                SDL_Init(SDL_INIT_TIMER);
        }
        
        my_timerid = 0;
        my_objectcount++;
}

PG_TimerObject::~PG_TimerObject() {
        my_objectcount--;
}
        
SDL_TimerID PG_TimerObject::AddTimer(Uint32 interval) {
        my_timerid = SDL_AddTimer(interval, &PG_TimerObject::callbackTimer, 
this);
        return my_timerid;
}
        
bool PG_TimerObject::RemoveTimer() {
        SDL_TimerID id = my_timerid;
        my_timerid = 0;
        return SDL_RemoveTimer(id);
}
        
Uint32 PG_TimerObject::eventTimer(Uint32 interval) {
        return interval;
}

Uint32 PG_TimerObject::callbackTimer(Uint32 interval, void* data) {
        PG_TimerObject* caller = static_cast<PG_TimerObject*>(data);
        return caller->eventTimer(interval);
}

Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/Makefile.am,v
retrieving revision 1.1.6.1
retrieving revision 1.1.6.2
diff -C2 -r1.1.6.1 -r1.1.6.2
*** Makefile.am 2 May 2002 08:45:36 -0000       1.1.6.1
--- Makefile.am 28 May 2002 20:18:09 -0000      1.1.6.2
***************
*** 15,19 ****
        pgnavigator.cpp \
        pgrectlist.cpp \
!       pgsurfacecache.cpp
  
  libpgcore_la_LIBADD = 
--- 15,20 ----
        pgnavigator.cpp \
        pgrectlist.cpp \
!       pgsurfacecache.cpp \
!       pgtimerobject.cpp
  
  libpgcore_la_LIBADD = 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]