librw/src/rwengine.h

50 lines
1.0 KiB
C
Raw Normal View History

2016-06-16 14:08:09 +02:00
namespace rw {
// TODO: move more stuff into this
2016-06-16 14:08:09 +02:00
struct Engine
{
2016-06-23 16:39:34 +02:00
void *currentCamera;
void *currentWorld;
static PluginList s_plglist;
static void init(void);
static void open(void);
static int32 registerPlugin(int32 size, uint32 id, Constructor ctor,
Destructor dtor){
return s_plglist.registerPlugin(size, id, ctor, dtor, nil);
}
};
extern Engine *engine;
struct Driver
2016-06-16 14:08:09 +02:00
{
ObjPipeline *defaultPipeline;
int32 rasterNativeOffset;
void (*beginUpdate)(Camera*);
void (*endUpdate)(Camera*);
2016-06-16 14:08:09 +02:00
void (*rasterCreate)(Raster*);
uint8 *(*rasterLock)(Raster*, int32 level);
void (*rasterUnlock)(Raster*, int32 level);
int32 (*rasterNumLevels)(Raster*);
void (*rasterFromImage)(Raster*, Image*);
};
extern Driver driver[NUM_PLATFORMS];
#define DRIVER driver[rw::platform]
2016-06-16 14:08:09 +02:00
namespace null {
void beginUpdate(Camera*);
void endUpdate(Camera*);
2016-06-16 14:08:09 +02:00
void rasterCreate(Raster*);
uint8 *rasterLock(Raster*, int32 level);
void rasterUnlock(Raster*, int32 level);
int32 rasterNumLevels(Raster*);
void rasterFromImage(Raster*, Image*);
}
}