add opengl backend authored by Hannu Hanhi's avatar Hannu Hanhi
The OpenGL-specific parts of the hardware renderer are partially separated into the OpenGL backend. Ideally this would allow easier adaptation to other 3D rendering APIs by just implementing a new backend for it.
OpenGL backend functions:
`void Init (void)`
`void SetTexture (GLMipmap_t *TexInfo)`
`TexInfo` becomes the current texture, used in future draw calls. If NULL, then a white texture is used. The texture will be uploaded to the GPU if it has not been yet.
`void UpdateTexture (GLMipmap_t *TexInfo)`
Updated data from `TexInfo` is uploaded to the GPU. (`TexInfo` is left as the current texture?)
`void DeleteTexture (GLMipmap_t *TexInfo)`
`TexInfo` is deleted from the GPU.
`void ClearMipMapCache (void)`
All textures are deleted from the GPU.
`INT32 GetTextureUsed (void)`
Returns the number of bytes used by the textures uploaded to the GPU.
`void SetPalette (RGBA_t *ppal)`
`void SetSpecialState (hwdspecialstate_t IdState, INT32 Value)`
`void GClipRect (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip)`
`void SetTransform (FTransform *ptransform)`
`void SetBlend (FBITFIELD PolyFlags)`
`void ClearBuffer (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor)`
`void Draw2DLine (F2DCoord *v1, F2DCoord *v2, RGBA_t Color)`
`void DrawPolygon (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags)`
`void DrawIndexedTriangles (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, UINT32 *IndexArray)`
`void RenderSkyDome (gl_sky_t *sky)`
`void FlushScreenTextures (void)`
`void StartScreenWipe (void)`
`void EndScreenWipe (void)`
`void DoScreenWipe (void)`
`void DrawIntermissionBG (void)`
`void MakeScreenTexture (void)`
`void MakeScreenFinalTexture (void)`
`void DrawScreenFinalTexture (int width, int height)`
`void PostImgRedraw (float points[SCREENVERTS][SCREENVERTS][2])`
`boolean CompileShaders (void)`
`void CleanShaders (void)`
`void SetShader (int type)`
`void UnSetShader (void)`
`void SetShaderInfo (hwdshaderinfo_t info, INT32 value)`
`void LoadCustomShader (int number, char *code, size_t size, boolean isfragment)`
`void DrawModel (model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 hflipped, FSurfaceInfo *Surface)`
`void CreateModelVBOs (model_t *model)`
`void ReadRect (INT32 x, INT32 y, INT32 width, INT32 height, INT32 dst_stride, UINT16 *dst_data)`
\ No newline at end of file