2016-03-01 15:47:10 +00:00
|
|
|
#ifndef __R_RENDERER_H
|
|
|
|
#define __R_RENDERER_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
struct FRenderer;
|
2018-04-03 18:14:26 +00:00
|
|
|
extern FRenderer *SWRenderer;
|
|
|
|
|
2016-09-20 21:13:12 +00:00
|
|
|
class FSerializer;
|
2016-03-01 15:47:10 +00:00
|
|
|
class FTexture;
|
|
|
|
class AActor;
|
|
|
|
class player_t;
|
|
|
|
struct sector_t;
|
|
|
|
class FCanvasTexture;
|
2016-09-21 07:01:12 +00:00
|
|
|
class FileWriter;
|
2018-04-05 21:08:09 +00:00
|
|
|
class DCanvas;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
struct FRenderer
|
|
|
|
{
|
2018-04-03 22:21:25 +00:00
|
|
|
virtual ~FRenderer() {}
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
// precache one texture
|
2018-04-03 22:21:25 +00:00
|
|
|
virtual void Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist) = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
// render 3D view
|
2018-07-20 03:48:15 +00:00
|
|
|
virtual void RenderView(player_t *player, DCanvas *target, void *videobuffer) = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
// renders view to a savegame picture
|
2018-04-03 22:21:25 +00:00
|
|
|
virtual void WriteSavePic(player_t *player, FileWriter *file, int width, int height) = 0;
|
2018-04-03 20:50:47 +00:00
|
|
|
|
|
|
|
// render to a camera texture
|
2018-04-03 22:21:25 +00:00
|
|
|
virtual void RenderTextureView(FCanvasTexture *tex, AActor *viewpoint, double fov) = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
// draws player sprites with hardware acceleration (only useful for software rendering)
|
2018-04-03 22:21:25 +00:00
|
|
|
virtual void DrawRemainingPlayerSprites() = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2018-04-03 20:50:47 +00:00
|
|
|
// set up the colormap for a newly loaded level.
|
2018-04-03 22:21:25 +00:00
|
|
|
virtual void SetColormap() = 0;
|
|
|
|
|
|
|
|
virtual void SetClearColor(int color) = 0;
|
|
|
|
|
|
|
|
virtual void Init() = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|