Skip to content

Commit 995fe8f

Browse files
committed
OpenGL Renderer compilation fix
+ formatting changes and future preparations..
1 parent f55f7ff commit 995fe8f

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

src/Layers/xrRender/ResourceManager.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ class ECORE_API CResourceManager
4040

4141
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
4242
using map_GS = xr_map<const char*, SGS*, str_pred>;
43-
#endif // USE_DX10
44-
#ifdef USE_DX11
43+
#endif
44+
45+
#if defined(USE_DX11)
4546
using map_HS = xr_map<const char*, SHS*, str_pred>;
4647
using map_DS = xr_map<const char*, SDS*, str_pred>;
4748
using map_CS = xr_map<const char*, SCS*, str_pred>;
@@ -163,7 +164,7 @@ class ECORE_API CResourceManager
163164
void _DeleteGS(const SGS* GS);
164165
#endif // USE_DX10
165166

166-
#ifdef USE_DX11
167+
#if defined(USE_DX11)
167168
SHS* _CreateHS(LPCSTR Name);
168169
void _DeleteHS(const SHS* HS);
169170

@@ -172,7 +173,7 @@ class ECORE_API CResourceManager
172173

173174
SCS* _CreateCS(LPCSTR Name);
174175
void _DeleteCS(const SCS* CS);
175-
#endif // USE_DX10
176+
#endif
176177

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

190191
#ifdef USE_OGL
191192
SDeclaration* _CreateDecl (u32 FVF);
192-
#endif // USE_OGL
193+
#endif
194+
193195
SDeclaration* _CreateDecl(D3DVERTEXELEMENT9* dcl);
194196
void _DeleteDecl(const SDeclaration* dcl);
195197

@@ -237,7 +239,8 @@ class ECORE_API CResourceManager
237239
#else
238240
SGeometry* CreateGeom(D3DVERTEXELEMENT9* decl, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib);
239241
SGeometry* CreateGeom(u32 FVF, ID3DVertexBuffer* vb, ID3DIndexBuffer* ib);
240-
#endif // USE_OGL
242+
#endif
243+
241244
void DeleteGeom(const SGeometry* VS);
242245
void DeferredLoad(BOOL E) { bDeferredLoad = E; }
243246
void DeferredUpload();

src/Layers/xrRender/SH_Atomic.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ SVS::SVS() : vs(0)
3737
SVS::~SVS()
3838
{
3939
RImplementation.Resources->_DeleteVS(this);
40+
4041
#if defined(USE_DX10) || defined(USE_DX11)
4142
//_RELEASE(signature);
4243
// Now it is release automatically
43-
#endif //USE_DX10
44+
#endif
45+
4446
#ifdef USE_OGL
4547
CHK_GL(glDeleteProgram(vs));
4648
#else
4749
_RELEASE(vs);
48-
#endif // USE_OGL
50+
#endif
4951
}
5052

5153
///////////////////////////////////////////////////////////////////////
@@ -70,26 +72,42 @@ SGS::~SGS()
7072
CHK_GL(glDeleteProgram(sh));
7173
#else
7274
_RELEASE(sh);
73-
#endif // USE_OGL
75+
#endif
76+
7477
RImplementation.Resources->_DeleteGS(this);
7578
}
7679

77-
#ifdef USE_DX11
80+
#if defined(USE_DX11)
7881
SHS::~SHS()
7982
{
83+
#ifdef USE_OGL
84+
CHK_GL(glDeleteProgram(sh));
85+
#else
8086
_RELEASE(sh);
87+
#endif
88+
8189
RImplementation.Resources->_DeleteHS(this);
8290
}
8391

8492
SDS::~SDS()
8593
{
94+
#ifdef USE_OGL
95+
CHK_GL(glDeleteProgram(sh));
96+
#else
8697
_RELEASE(sh);
98+
#endif
99+
87100
RImplementation.Resources->_DeleteDS(this);
88101
}
89102

90103
SCS::~SCS()
91104
{
105+
#ifdef USE_OGL
106+
CHK_GL(glDeleteProgram(sh));
107+
#else
92108
_RELEASE(sh);
109+
#endif
110+
93111
RImplementation.Resources->_DeleteCS(this);
94112
}
95113
#endif

src/Layers/xrRender/SH_Atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct ECORE_API SGS : public xr_resource_named
6868
typedef resptr_core<SGS, resptr_base<SGS>> ref_gs;
6969
#endif // USE_DX10
7070

71-
#if defined(USE_DX11) || defined(USE_OGL)
71+
#if defined(USE_DX11)
7272

7373
struct ECORE_API SHS : public xr_resource_named
7474
{

0 commit comments

Comments
 (0)