#include "sgl.h"
void slInitEvent( void );
void - gives nothing.
void - returns nothing.
void *eventtbl[] = {
init_camera,
init_player1,
init_player2,
init_enemyctrl
};
void InitGame(){
void **evrdptr;
EVENT *evptr;
int cnt;
slInitEvent (); /* Initialize event management variables */
evrptr = eventtbl;
for( cnt = sizeof( eventtbl ) / sizeof( void * ) ; cnt-- > 0 ; ) {
evptr = slSetEvent ( *evrptr++ );
}
slSetSprTVMode ( TV_320x224 );
}
void Game(){
slExecuteEvent (); /* Execute event */
slSynch (); /* Polygon data output and video display synchronization */
}
slGetEvent | slSetEvent | slSetEventNext | slCloseEvent |
slReturnEvent | slExecuteEvent | slGetWork | slReturnWork |
#include "sgl.h"
EVENT *slGetEvent( void );
void - gives nothing.
EVENT * - Pointer to the retrieved event RAM address.
void func() {
/* This is executed in event loop. */
}
EVENT *evnt1, *evnt2;
evnt1 = slGetEvent ();
evnt2 = slSetEvent ( func );
evnt2->user = ( Uint8 * )evnt1;
slInitEvent | slSetEvent | slSetEventNext | slCloseEvent |
slReturnEvent | EventTop | EventCount |
#include "sgl.h"
void *( func )( void );
EVENT *slSetEvent( func );
void *( func )( void ) - Executable function that registers for the event.
EVENT * - EVENT type pointer to the retrieved event.
slInitEvent ();
slSetEvent ( user_func1 );
slSetEvent ( user_func2 );
:
while( -1 ) {
:
slExecuteEvent ();
slSynch ();
}
slInitEvent | slSetEvent | slSetEventNext | slCloseEvent |
slReturnEvent | slExecuteEvent |
#include "sgl.h"
EVENT *event;
void *( func )( void );
EVENT *slSetEventNext( evnt, func );
EVENT *evnt - The event before the event to register for.
void *( func )( void ) - Executable function to register.
EVENT * - Pointer to a structure of type EVENT indicating the retrieved event.
void func() {
/* This is executed in event loop. */
}
ss_main() {
EVENT *event;
evnt = slGetEvent ();
evnt->work = ...
:
slSetEventNext ( evnt, func );
:
slInitEvent | slSetEvent | slGetEvent | slCloseEvent |
slReturnEvent | slExecuteEvent |
#include "sgl.h"
EVENT *event;
void slReturnEvent( evnt );
EVENT *evnt - Pointer to an EVENT type structure representing the event that requires release.
void - returns nothing.
EVENT *event;
evnt = slGetEvent ();
slReturnEvent ( evnt );
slInitEvent | slGetEvent | slSetEvent | slSetEventNext |
slCloseEvent | EventLast |
#include "sgl.h"
EVENT *event;
void slCloseEvent( evnt );
EVENT *evnt - Pointer to an EVENT type structure representing the event to delete.
void - returns nothing.
EVENT *event;
evnt = slSetEvent ( user_func );
:
slCloseEvent ( evnt );
slInitEvent | slGetEvent | slSetEvent | slSetEventNext |
slReturnEvent |
#include "sgl.h"
void slExecuteEvent( void );
void - gives nothing.
void - returns nothing.
slInitEvent ();
slSetEvent ( ... );
:
while( -1 ) {
slExecuteEvent ();
slSynch ();
}
slInitEvent | slSetEvent | slSetEventNext | slSynch |
slInitSynch | EventTop | EventNow | EventCount |
#include "sgl.h"
WORK *slGetWork( void );
void - gives nothing.
WORK * - Pointer to a WORK type structure indicating the allocated work area.
WORK *work;
EVENT *event;
work = slGetWork ();
evnt = slSetEvent ();
evnt->work = work;
slInitEvent | slReturnWork | Work Count |
#include "sgl.h"
WORK *wk;
void slReturnWork( wk );
WORK *wk - Pointer to a WORK structure representing the work RAM to free.
void - returns nothing.
WORK *work;
work = slGetWork ();
:
slReturnWork ( work );
slInitEvent | slGetWork | Work Count |
#include "sgl.h"
extern EVENT EventBuf []; /* buffer for Event use */
slInitEvent | slGetEvent | slReturnEvent |
#include "sgl.h"
extern WORK WorkBuf []; /* buffer for Work use */
slGetWork |
#include "sgl.h"
extern EVENT * RemainEvent[] ; /* Remain Event address buffer */
slSetEvent | slSetEventNext | slReturnEvent | slExecuteEvent |
#include "sgl.h"
extern WORK * RemainWork[] ; /* Remain Work address buffer */
slReturnWork |