Skip to content

Commit

Permalink
xrEngine: move renderers initialization into separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Nov 11, 2017
1 parent 61369f8 commit 4b0e518
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/xrEngine/EngineAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ void CEngineAPI::InitializeNotDedicated()
}
#endif // DEDICATED_SERVER

void CEngineAPI::Initialize(void)
void CEngineAPI::InitializeRenderers()
{
//////////////////////////////////////////////////////////////////////////
// render
constexpr pcstr r1_name = "xrRender_R1";

#ifndef DEDICATED_SERVER
Expand All @@ -122,11 +120,18 @@ void CEngineAPI::Initialize(void)
R_ASSERT(hRender);
g_current_renderer = 1;
}

// ask current renderer to setup GlobalEnv
using SetupEnvFunc = void (*)();
using SetupEnvFunc = void(*)();
auto setupEnv = (SetupEnvFunc)hRender->getProcAddress("SetupEnv");
R_ASSERT(setupEnv);
setupEnv();
}

void CEngineAPI::Initialize(void)
{
InitializeRenderers();

// game
{
constexpr pcstr g_name = "xrGame";
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/EngineAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class ENGINE_API CEngineAPI
VTResume* tune_resume;
void Initialize();

void InitializeRenderers();
#ifndef DEDICATED_SERVER
void InitializeNotDedicated();
#endif // DEDICATED_SERVER
Expand Down

0 comments on commit 4b0e518

Please sign in to comment.