mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +03:00
Stub GLES 1.1 backend
This commit is contained in:
parent
f6a5685de8
commit
feefe2e742
28 changed files with 272 additions and 31 deletions
58
vendor/librw/src/gles1/rwgles1.cpp
vendored
Normal file
58
vendor/librw/src/gles1/rwgles1.cpp
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#include "rwgles1.h"
|
||||
|
||||
#ifdef RW_GLES1
|
||||
|
||||
namespace rw {
|
||||
|
||||
namespace gles1 {
|
||||
|
||||
// --- Funciones dummy (para linkear después) ---
|
||||
|
||||
inline void im2DRenderPrimitive(int, void*, int) {}
|
||||
inline void im2DRenderIndexedPrimitive(int, void*, int, void*, int) {}
|
||||
inline void im3DTransform(void*, int, void*, unsigned int) {}
|
||||
inline void im3DRenderPrimitive(int) {}
|
||||
inline void im3DRenderIndexedPrimitive(int, void*, int) {}
|
||||
inline void im3DEnd(void) {}
|
||||
|
||||
// --- Driver lifecycle ---
|
||||
static void*
|
||||
driverOpen(void* object, int32 offset, int32 size)
|
||||
{
|
||||
// stub: no hace nada
|
||||
return object;
|
||||
}
|
||||
|
||||
static void*
|
||||
driverClose(void* object, int32 offset, int32 size)
|
||||
{
|
||||
// stub: no hace nada
|
||||
return object;
|
||||
}
|
||||
|
||||
// --- Raster ---
|
||||
static void
|
||||
registerNativeRaster(void)
|
||||
{
|
||||
// stub por ahora
|
||||
}
|
||||
|
||||
void
|
||||
registerPlatformPlugins(void)
|
||||
{
|
||||
Driver::registerPlugin(PLATFORM_GLES1, 0, PLATFORM_GLES1,
|
||||
driverOpen, driverClose);
|
||||
registerNativeRaster();
|
||||
}
|
||||
|
||||
void*
|
||||
destroyNativeData(void *object, int32, int32)
|
||||
{
|
||||
//freeInstanceData((Geometry*)object);
|
||||
return object;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
108
vendor/librw/src/gles1/rwgles1.h
vendored
Normal file
108
vendor/librw/src/gles1/rwgles1.h
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "../rwbase.h"
|
||||
#include "../rwerror.h"
|
||||
#include "../rwplg.h"
|
||||
#include "../rwpipeline.h"
|
||||
#include "../rwobjects.h"
|
||||
#include "../rwengine.h"
|
||||
|
||||
#ifdef RW_GLES1
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/egl.h>
|
||||
#ifdef __SYMBIAN32__
|
||||
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace rw {
|
||||
|
||||
#ifdef RW_GLES1
|
||||
struct EngineOpenParams
|
||||
{
|
||||
int width, height;
|
||||
const char *windowtitle;
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace gles1 {
|
||||
|
||||
// --- Tipos básicos que charset.cpp y otros esperan ---
|
||||
|
||||
struct Im2DVertex {
|
||||
float x, y, z, w;
|
||||
float camZ;
|
||||
float recipCamZ;
|
||||
unsigned char r, g, b, a;
|
||||
float u, v;
|
||||
|
||||
// --- setters esperados por librw ---
|
||||
|
||||
void setScreenX(float v) { x = v; }
|
||||
void setScreenY(float v) { y = v; }
|
||||
void setScreenZ(float v) { z = v; }
|
||||
|
||||
void setCameraZ(float v) { camZ = v; }
|
||||
void setRecipCameraZ(float v) { recipCamZ = v; }
|
||||
|
||||
void setColor(unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a) {
|
||||
r = _r; g = _g; b = _b; a = _a;
|
||||
}
|
||||
|
||||
void setU(float val, float recipZ) { u = val; }
|
||||
void setV(float val, float recipZ) { v = val; }
|
||||
};
|
||||
|
||||
struct Im3DVertex {
|
||||
float x, y, z;
|
||||
float u, v;
|
||||
uint32 color;
|
||||
|
||||
void setX(float v) { x = v; }
|
||||
void setY(float v) { y = v; }
|
||||
void setZ(float v) { z = v; }
|
||||
|
||||
void setU(float v) { u = v; }
|
||||
void setV(float v) { this->v = v; }
|
||||
|
||||
void setColor(uint8 r, uint8 g, uint8 b, uint8 a) {
|
||||
color = (a<<24) | (r<<16) | (g<<8) | b;
|
||||
}
|
||||
};
|
||||
|
||||
// --- Funciones dummy (para linkear después) ---
|
||||
|
||||
inline void im2DRenderPrimitive(int, void*, int);
|
||||
inline void im2DRenderIndexedPrimitive(int, void*, int, void*, int);
|
||||
inline void im3DTransform(void*, int, void*, unsigned int);
|
||||
inline void im3DRenderPrimitive(int);
|
||||
inline void im3DRenderIndexedPrimitive(int, void*, int);
|
||||
inline void im3DEnd(void);
|
||||
|
||||
// --- Driver lifecycle ---
|
||||
static void*
|
||||
driverOpen(void* object, int32 offset, int32 size);
|
||||
|
||||
static void*
|
||||
driverClose(void* object, int32 offset, int32 size);
|
||||
|
||||
// --- Raster ---
|
||||
static void
|
||||
registerNativeRaster(void);
|
||||
|
||||
void registerPlatformPlugins(void);
|
||||
|
||||
void *destroyNativeData(void *object, int32, int32);
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue