Skip to content

Commit

Permalink
OpenGL Renderer compilation fix
Browse files Browse the repository at this point in the history
+ formatting changes and future preparations..
  • Loading branch information
Xottab-DUTY committed May 28, 2018
1 parent f55f7ff commit 995fe8f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
15 changes: 9 additions & 6 deletions src/Layers/xrRender/ResourceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class ECORE_API CResourceManager

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
using map_GS = xr_map<const char*, SGS*, str_pred>;
#endif // USE_DX10
#ifdef USE_DX11
#endif

#if defined(USE_DX11)
using map_HS = xr_map<const char*, SHS*, str_pred>;
using map_DS = xr_map<const char*, SDS*, str_pred>;
using map_CS = xr_map<const char*, SCS*, str_pred>;
Expand Down Expand Up @@ -163,7 +164,7 @@ class ECORE_API CResourceManager
void _DeleteGS(const SGS* GS);
#endif // USE_DX10

#ifdef USE_DX11
#if defined(USE_DX11)
SHS* _CreateHS(LPCSTR Name);
void _DeleteHS(const SHS* HS);

Expand All @@ -172,7 +173,7 @@ class ECORE_API CResourceManager

SCS* _CreateCS(LPCSTR Name);
void _DeleteCS(const SCS* CS);
#endif // USE_DX10
#endif

SPS* _CreatePS(LPCSTR Name);
void _DeletePS(const SPS* PS);
Expand All @@ -189,7 +190,8 @@ class ECORE_API CResourceManager

#ifdef USE_OGL
SDeclaration* _CreateDecl (u32 FVF);
#endif // USE_OGL
#endif

SDeclaration* _CreateDecl(D3DVERTEXELEMENT9* dcl);
void _DeleteDecl(const SDeclaration* dcl);

Expand Down Expand Up @@ -237,7 +239,8 @@ class ECORE_API CResourceManager
#else
SGeometry* CreateGeom(D3DVERTEXELEMENT9* decl, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib);
SGeometry* CreateGeom(u32 FVF, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib);
#endif // USE_OGL
#endif

void DeleteGeom(const SGeometry* VS);
void DeferredLoad(BOOL E) { bDeferredLoad = E; }
void DeferredUpload();
Expand Down
26 changes: 22 additions & 4 deletions src/Layers/xrRender/SH_Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ SVS::SVS() : vs(0)
SVS::~SVS()
{
RImplementation.Resources->_DeleteVS(this);

#if defined(USE_DX10) || defined(USE_DX11)
//_RELEASE(signature);
// Now it is release automatically
#endif //USE_DX10
#endif

#ifdef USE_OGL
CHK_GL(glDeleteProgram(vs));
#else
_RELEASE(vs);
#endif // USE_OGL
#endif
}

///////////////////////////////////////////////////////////////////////
Expand All @@ -70,26 +72,42 @@ SGS::~SGS()
CHK_GL(glDeleteProgram(sh));
#else
_RELEASE(sh);
#endif // USE_OGL
#endif

RImplementation.Resources->_DeleteGS(this);
}

#ifdef USE_DX11
#if defined(USE_DX11)
SHS::~SHS()
{
#ifdef USE_OGL
CHK_GL(glDeleteProgram(sh));
#else
_RELEASE(sh);
#endif

RImplementation.Resources->_DeleteHS(this);
}

SDS::~SDS()
{
#ifdef USE_OGL
CHK_GL(glDeleteProgram(sh));
#else
_RELEASE(sh);
#endif

RImplementation.Resources->_DeleteDS(this);
}

SCS::~SCS()
{
#ifdef USE_OGL
CHK_GL(glDeleteProgram(sh));
#else
_RELEASE(sh);
#endif

RImplementation.Resources->_DeleteCS(this);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/SH_Atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct ECORE_API SGS : public xr_resource_named
typedef resptr_core<SGS, resptr_base<SGS>> ref_gs;
#endif // USE_DX10

#if defined(USE_DX11) || defined(USE_OGL)
#if defined(USE_DX11)

struct ECORE_API SHS : public xr_resource_named
{
Expand Down

0 comments on commit 995fe8f

Please sign in to comment.