//================================================================
// E3D
//
// - Basic type definitions
//
// AUTHOR:  Gabor Nagy
// DATE:    2025-Apr-11 03:39:01
//
// Copyright (C) 2014-2026 by Gabor Nagy. All rights reserved.
//================================================================
#ifndef	_E3D_GPU_h
#define	_E3D_GPU_h

#include <ETypes.h>

#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
extern "C" {
#endif


typedef struct E3dShaderVariant_S  E3dShaderVariant;


#ifdef EGLES
#define EGLESContextPart\
	uint16_t           MatrixStackIndex;  /* E3dMatrixStackMODELVIEW or E3dMatrixStackPROJECTION */\
	EBool              LightingOn, TexturesOn;\
\
	E3dMatrixStack     MatrixStacks[2]
#else
#define EGLESContextPart
#endif

#define E3dGPUContextCore\
	const char*        API;\
\
	E3dShaderVariant*  CurrentShaderVariant;\
	uint32_t           TexturesOn:1, TransparencyOn:1;\
\
	EGLESContextPart

typedef struct E3dGPUContext_S  E3dGPUContext;

struct E3dGPUContext_S
{
	E3dGPUContextCore;
};


enum
{
	E3dFBOSharingPARTIAL = 1,
	E3dFBOSharingFULL
};


#define E3dGL_MATRIX_STACK_DEPTH  256

enum
{
	E3dMatrixStackMODELVIEW = 0,
	E3dMatrixStackPROJECTION
};


extern void  E3dGPUContext_Init(E3dGPUContext* PContext);
extern void  E3dGPUContext_FreeContents(E3dGPUContext* PContext);

extern void  E3dGPUContext_Free(E3dGPUContext* PContext);

extern EBool  E3dRenderers_UseGPUFrameBuffersForHDRPass;


#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
}	// Close scope of 'extern "C"' declaration
#endif


#endif	// _E3D_GPU_h
