SRB2/src/hardware/hw_drv.h

139 lines
5.4 KiB
C
Raw Normal View History

2020-01-23 23:12:15 +00:00
// SONIC ROBO BLAST 2
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
2023-03-31 12:53:31 +00:00
// Copyright (C) 1999-2023 by Sonic Team Junior.
2014-03-15 16:59:03 +00:00
//
2020-01-23 23:12:15 +00:00
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
2020-01-23 23:12:15 +00:00
/// \file hw_drv.h
2014-03-15 16:59:03 +00:00
/// \brief imports/exports for the 3D hardware low-level interface API
#ifndef __HWR_DRV_H__
#define __HWR_DRV_H__
// this must be here 19991024 by Kin
#include "../screen.h"
#include "hw_data.h"
#include "hw_defs.h"
#include "hw_md2.h"
#include "hw_dll.h"
// ==========================================================================
// STANDARD DLL EXPORTS
// ==========================================================================
EXPORT boolean HWRAPI(Init) (void);
2014-07-25 23:10:24 +00:00
#ifndef HAVE_SDL
2014-03-15 16:59:03 +00:00
EXPORT void HWRAPI(Shutdown) (void);
#endif
EXPORT void HWRAPI(SetTexturePalette) (RGBA_t *ppal);
2014-03-15 16:59:03 +00:00
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
2020-06-07 18:32:52 +00:00
EXPORT void HWRAPI(DrawIndexedTriangles) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, UINT32 *IndexArray);
EXPORT void HWRAPI(RenderSkyDome) (gl_sky_t *sky);
2014-03-15 16:59:03 +00:00
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor);
EXPORT void HWRAPI(SetTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *TexInfo);
2021-10-08 19:07:58 +00:00
EXPORT void HWRAPI(ReadScreenTexture) (int tex, UINT8 *dst_data);
2014-03-15 16:59:03 +00:00
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip);
EXPORT void HWRAPI(ClearMipMapCache) (void);
EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value);
//Hurdler: added for new development
2021-12-10 06:41:35 +00:00
EXPORT void HWRAPI(DrawModel) (model_t *model, INT32 frameIndex, float duration, float tics, INT32 nextFrameIndex, FTransform *pos, float hscale, float vscale, UINT8 flipped, UINT8 hflipped, FSurfaceInfo *Surface);
EXPORT void HWRAPI(CreateModelVBOs) (model_t *model);
2014-03-15 16:59:03 +00:00
EXPORT void HWRAPI(SetTransform) (FTransform *ptransform);
EXPORT INT32 HWRAPI(GetTextureUsed) (void);
EXPORT void HWRAPI(FlushScreenTextures) (void);
2022-03-12 00:04:57 +00:00
EXPORT void HWRAPI(DoScreenWipe) (int wipeStart, int wipeEnd, FSurfaceInfo *surf, FBITFIELD polyFlags);
EXPORT void HWRAPI(DrawScreenTexture) (int tex, FSurfaceInfo *surf, FBITFIELD polyflags);
EXPORT void HWRAPI(MakeScreenTexture) (int tex);
EXPORT void HWRAPI(DrawScreenFinalTexture) (int tex, int width, int height);
#define SCREENVERTS 10
EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]);
EXPORT boolean HWRAPI(InitShaders) (void);
EXPORT void HWRAPI(LoadShader) (int slot, char *code, hwdshaderstage_t stage);
EXPORT boolean HWRAPI(CompileShader) (int slot);
EXPORT void HWRAPI(SetShader) (int slot);
EXPORT void HWRAPI(UnSetShader) (void);
EXPORT void HWRAPI(SetShaderInfo) (hwdshaderinfo_t info, INT32 value);
EXPORT void HWRAPI(SetPaletteLookup)(UINT8 *lut);
EXPORT UINT32 HWRAPI(CreateLightTable)(RGBA_t *hw_lighttable);
EXPORT void HWRAPI(ClearLightTables)(void);
EXPORT void HWRAPI(SetScreenPalette)(RGBA_t *palette);
2014-03-15 16:59:03 +00:00
// ==========================================================================
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
// ==========================================================================
#if !defined (_CREATE_DLL_)
struct hwdriver_s
{
Init pfnInit;
SetTexturePalette pfnSetTexturePalette;
2014-03-15 16:59:03 +00:00
FinishUpdate pfnFinishUpdate;
Draw2DLine pfnDraw2DLine;
DrawPolygon pfnDrawPolygon;
2020-06-07 18:20:52 +00:00
DrawIndexedTriangles pfnDrawIndexedTriangles;
2019-09-18 02:38:04 +00:00
RenderSkyDome pfnRenderSkyDome;
2014-03-15 16:59:03 +00:00
SetBlend pfnSetBlend;
ClearBuffer pfnClearBuffer;
SetTexture pfnSetTexture;
2020-01-28 03:16:38 +00:00
UpdateTexture pfnUpdateTexture;
2020-08-08 08:16:47 +00:00
DeleteTexture pfnDeleteTexture;
2021-10-08 19:07:58 +00:00
ReadScreenTexture pfnReadScreenTexture;
2014-03-15 16:59:03 +00:00
GClipRect pfnGClipRect;
ClearMipMapCache pfnClearMipMapCache;
SetSpecialState pfnSetSpecialState;
DrawModel pfnDrawModel;
CreateModelVBOs pfnCreateModelVBOs;
2014-03-15 16:59:03 +00:00
SetTransform pfnSetTransform;
GetTextureUsed pfnGetTextureUsed;
#ifdef _WINDOWS
GetModeList pfnGetModeList;
#endif
2014-07-25 23:10:24 +00:00
#ifndef HAVE_SDL
2014-03-15 16:59:03 +00:00
Shutdown pfnShutdown;
#endif
PostImgRedraw pfnPostImgRedraw;
FlushScreenTextures pfnFlushScreenTextures;
2014-03-15 16:59:03 +00:00
DoScreenWipe pfnDoScreenWipe;
DrawScreenTexture pfnDrawScreenTexture;
2014-03-15 16:59:03 +00:00
MakeScreenTexture pfnMakeScreenTexture;
DrawScreenFinalTexture pfnDrawScreenFinalTexture;
InitShaders pfnInitShaders;
LoadShader pfnLoadShader;
CompileShader pfnCompileShader;
SetShader pfnSetShader;
UnSetShader pfnUnSetShader;
SetShaderInfo pfnSetShaderInfo;
SetPaletteLookup pfnSetPaletteLookup;
CreateLightTable pfnCreateLightTable;
ClearLightTables pfnClearLightTables;
SetScreenPalette pfnSetScreenPalette;
2014-03-15 16:59:03 +00:00
};
extern struct hwdriver_s hwdriver;
#define HWD hwdriver
#endif //not defined _CREATE_DLL_
#endif //__HWR_DRV_H__