1 // SONIC ROBO BLAST 2
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 2020 by Sonic Team Junior.
4 //
5 // This program is free software distributed under the
6 // terms of the GNU General Public License, version 2.
7 // See the 'LICENSE' file for more details.
8 //-----------------------------------------------------------------------------
9 /// \file hw_batching.h
10 /// \brief Draw call batching and related things.
11 
12 #ifndef __HWR_BATCHING_H__
13 #define __HWR_BATCHING_H__
14 
15 #include "hw_defs.h"
16 #include "hw_data.h"
17 #include "hw_drv.h"
18 
19 typedef struct
20 {
21 	FSurfaceInfo surf;// surf also has its own polyflags for some reason, but it seems unused
22 	unsigned int vertsIndex;// location of verts in unsortedVertexArray
23 	FUINT numVerts;
24 	FBITFIELD polyFlags;
25 	GLMipmap_t *texture;
26 	int shader;
27 	// this tells batching that the plane belongs to a horizon line and must be drawn in correct order with the skywalls
28 	boolean horizonSpecial;
29 } PolygonArrayEntry;
30 
31 void HWR_StartBatching(void);
32 void HWR_SetCurrentTexture(GLMipmap_t *texture);
33 void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, int shader, boolean horizonSpecial);
34 void HWR_RenderBatches(void);
35 
36 #endif
37