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.
|
2020-01-23 23:12:15 +00:00
|
|
|
// Copyright (C) 1999-2020 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
|
|
|
|
// ==========================================================================
|
|
|
|
|
2019-12-25 19:22:01 +00:00
|
|
|
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
|
|
|
|
#ifdef _WINDOWS
|
|
|
|
EXPORT void HWRAPI(GetModeList) (vmode_t **pvidmodes, INT32 *numvidmodes);
|
|
|
|
#endif
|
2019-12-09 01:12:56 +00:00
|
|
|
EXPORT void HWRAPI(SetPalette) (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);
|
2020-07-17 05:48:05 +00:00
|
|
|
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);
|
2021-01-27 20:48:57 +00:00
|
|
|
EXPORT void HWRAPI(SetTexture) (GLMipmap_t *TexInfo);
|
|
|
|
EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *TexInfo);
|
|
|
|
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *TexInfo);
|
2014-03-15 16:59:03 +00:00
|
|
|
EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height, INT32 dst_stride, UINT16 *dst_data);
|
|
|
|
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip);
|
|
|
|
EXPORT void HWRAPI(ClearMipMapCache) (void);
|
|
|
|
|
|
|
|
//Hurdler: added for backward compatibility
|
|
|
|
EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value);
|
|
|
|
|
|
|
|
//Hurdler: added for new development
|
2020-06-07 20:11:36 +00:00
|
|
|
EXPORT void HWRAPI(DrawModel) (model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 hflipped, FSurfaceInfo *Surface);
|
2018-12-26 15:58:37 +00:00
|
|
|
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);
|
|
|
|
|
2018-03-07 05:19:06 +00:00
|
|
|
EXPORT void HWRAPI(FlushScreenTextures) (void);
|
2014-03-15 16:59:03 +00:00
|
|
|
EXPORT void HWRAPI(StartScreenWipe) (void);
|
|
|
|
EXPORT void HWRAPI(EndScreenWipe) (void);
|
2018-12-27 20:23:33 +00:00
|
|
|
EXPORT void HWRAPI(DoScreenWipe) (void);
|
2014-03-15 16:59:03 +00:00
|
|
|
EXPORT void HWRAPI(DrawIntermissionBG) (void);
|
|
|
|
EXPORT void HWRAPI(MakeScreenTexture) (void);
|
2014-11-14 00:06:38 +00:00
|
|
|
EXPORT void HWRAPI(MakeScreenFinalTexture) (void);
|
|
|
|
EXPORT void HWRAPI(DrawScreenFinalTexture) (int width, int height);
|
2019-12-25 19:22:01 +00:00
|
|
|
|
|
|
|
#define SCREENVERTS 10
|
|
|
|
EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]);
|
|
|
|
|
2020-08-07 21:17:05 +00:00
|
|
|
EXPORT boolean HWRAPI(CompileShaders) (void);
|
|
|
|
EXPORT void HWRAPI(CleanShaders) (void);
|
2020-10-09 05:06:13 +00:00
|
|
|
EXPORT void HWRAPI(SetShader) (int type);
|
2019-12-25 19:22:01 +00:00
|
|
|
EXPORT void HWRAPI(UnSetShader) (void);
|
|
|
|
|
2020-01-24 00:25:54 +00:00
|
|
|
EXPORT void HWRAPI(SetShaderInfo) (hwdshaderinfo_t info, INT32 value);
|
2020-08-07 21:17:05 +00:00
|
|
|
EXPORT void HWRAPI(LoadCustomShader) (int number, char *code, size_t size, boolean isfragment);
|
2019-12-25 19:22:01 +00:00
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
// ==========================================================================
|
|
|
|
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
|
|
|
|
// ==========================================================================
|
|
|
|
|
|
|
|
#if !defined (_CREATE_DLL_)
|
|
|
|
|
|
|
|
struct hwdriver_s
|
|
|
|
{
|
|
|
|
Init pfnInit;
|
|
|
|
SetPalette pfnSetPalette;
|
|
|
|
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;
|
2014-03-15 16:59:03 +00:00
|
|
|
ReadRect pfnReadRect;
|
|
|
|
GClipRect pfnGClipRect;
|
|
|
|
ClearMipMapCache pfnClearMipMapCache;
|
|
|
|
SetSpecialState pfnSetSpecialState;//Hurdler: added for backward compatibility
|
2018-12-16 01:57:11 +00:00
|
|
|
DrawModel pfnDrawModel;
|
2018-12-26 15:58:37 +00:00
|
|
|
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;
|
2018-03-07 05:19:06 +00:00
|
|
|
FlushScreenTextures pfnFlushScreenTextures;
|
2014-03-15 16:59:03 +00:00
|
|
|
StartScreenWipe pfnStartScreenWipe;
|
|
|
|
EndScreenWipe pfnEndScreenWipe;
|
|
|
|
DoScreenWipe pfnDoScreenWipe;
|
|
|
|
DrawIntermissionBG pfnDrawIntermissionBG;
|
|
|
|
MakeScreenTexture pfnMakeScreenTexture;
|
2014-11-14 00:06:38 +00:00
|
|
|
MakeScreenFinalTexture pfnMakeScreenFinalTexture;
|
|
|
|
DrawScreenFinalTexture pfnDrawScreenFinalTexture;
|
2019-12-25 19:22:01 +00:00
|
|
|
|
2020-08-07 21:17:05 +00:00
|
|
|
CompileShaders pfnCompileShaders;
|
|
|
|
CleanShaders pfnCleanShaders;
|
2020-01-24 00:25:54 +00:00
|
|
|
SetShader pfnSetShader;
|
|
|
|
UnSetShader pfnUnSetShader;
|
2019-12-25 19:22:01 +00:00
|
|
|
|
2020-01-24 00:25:54 +00:00
|
|
|
SetShaderInfo pfnSetShaderInfo;
|
|
|
|
LoadCustomShader pfnLoadCustomShader;
|
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__
|
|
|
|
|