2020-04-30 17:54:38 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
2016-06-27 21:59:35 +02:00
|
|
|
|
|
|
|
#include "../rwbase.h"
|
|
|
|
#include "../rwerror.h"
|
|
|
|
#include "../rwplg.h"
|
|
|
|
#include "../rwpipeline.h"
|
|
|
|
#include "../rwobjects.h"
|
|
|
|
#include "../rwengine.h"
|
|
|
|
#ifdef RW_OPENGL
|
|
|
|
#include <GL/glew.h>
|
|
|
|
#endif
|
|
|
|
#include "rwgl3.h"
|
|
|
|
#include "rwgl3shader.h"
|
|
|
|
|
|
|
|
#include "rwgl3impl.h"
|
|
|
|
|
|
|
|
namespace rw {
|
|
|
|
namespace gl3 {
|
|
|
|
|
|
|
|
// TODO: make some of these things platform-independent
|
|
|
|
|
2017-08-26 20:08:23 +02:00
|
|
|
static void*
|
2016-06-27 21:59:35 +02:00
|
|
|
driverOpen(void *o, int32, int32)
|
|
|
|
{
|
|
|
|
#ifdef RW_OPENGL
|
2017-08-09 10:57:32 +02:00
|
|
|
engine->driver[PLATFORM_GL3]->defaultPipeline = makeDefaultPipeline();
|
2016-06-27 21:59:35 +02:00
|
|
|
#endif
|
2017-08-09 10:57:32 +02:00
|
|
|
engine->driver[PLATFORM_GL3]->rasterNativeOffset = nativeRasterOffset;
|
|
|
|
engine->driver[PLATFORM_GL3]->rasterCreate = rasterCreate;
|
|
|
|
engine->driver[PLATFORM_GL3]->rasterLock = rasterLock;
|
|
|
|
engine->driver[PLATFORM_GL3]->rasterUnlock = rasterUnlock;
|
|
|
|
engine->driver[PLATFORM_GL3]->rasterNumLevels = rasterNumLevels;
|
2020-04-17 21:44:32 +02:00
|
|
|
engine->driver[PLATFORM_GL3]->imageFindRasterFormat = imageFindRasterFormat;
|
2017-08-09 10:57:32 +02:00
|
|
|
engine->driver[PLATFORM_GL3]->rasterFromImage = rasterFromImage;
|
2016-06-27 21:59:35 +02:00
|
|
|
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
2017-08-26 20:08:23 +02:00
|
|
|
static void*
|
2016-06-27 21:59:35 +02:00
|
|
|
driverClose(void *o, int32, int32)
|
|
|
|
{
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-08-26 20:08:23 +02:00
|
|
|
registerPlatformPlugins(void)
|
2016-06-27 21:59:35 +02:00
|
|
|
{
|
|
|
|
Driver::registerPlugin(PLATFORM_GL3, 0, PLATFORM_GL3,
|
|
|
|
driverOpen, driverClose);
|
|
|
|
registerNativeRaster();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|