Compare commits

...

4 Commits

Author SHA1 Message Date
Mr_Goldberg 7ea90b03c4
Fixed some dedicated servers not booting up correctly. 2021-01-23 23:03:10 -05:00
Mr_Goldberg ccc48d83a8
Fix dx9 overlay graphics bug with black mesa. 2021-01-23 16:48:45 -05:00
Mr_Goldberg 58b09d4f11
Fix old steamnetworkingsockets headers. 2021-01-23 16:47:22 -05:00
Mr_Goldberg cfff531a23
Put back the if new frame for overlay. 2021-01-23 16:46:44 -05:00
20 changed files with 29 additions and 49 deletions

View File

@ -221,10 +221,11 @@ void ImGui_ImplOpenGL3_Shutdown()
ImGui_ImplOpenGL3_DestroyDeviceObjects();
}
void ImGui_ImplOpenGL3_NewFrame()
bool ImGui_ImplOpenGL3_NewFrame()
{
if (!g_ShaderHandle)
ImGui_ImplOpenGL3_CreateDeviceObjects();
return ImGui_ImplOpenGL3_CreateDeviceObjects();
return true;
}
static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height, GLuint vertex_array_object)

View File

@ -27,7 +27,7 @@
// Backend API
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_NewFrame();
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
// (Optional) Called by Init/NewFrame/Shutdown

View File

@ -467,8 +467,10 @@ void ImGui_ImplDX10_Shutdown()
if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; }
}
void ImGui_ImplDX10_NewFrame()
bool ImGui_ImplDX10_NewFrame()
{
if (!g_pFontSampler)
ImGui_ImplDX10_CreateDeviceObjects();
return ImGui_ImplDX10_CreateDeviceObjects();
return true;
}

View File

@ -16,7 +16,7 @@ struct ID3D10Device;
IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device);
IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame();
IMGUI_IMPL_API bool ImGui_ImplDX10_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state.

View File

@ -595,8 +595,9 @@ void ImGui_ImplDX11_Shutdown()
if (g_pd3dDeviceContext) { g_pd3dDeviceContext->Release(); g_pd3dDeviceContext = NULL; }
}
void ImGui_ImplDX11_NewFrame()
bool ImGui_ImplDX11_NewFrame()
{
if (!g_pFontSampler)
ImGui_ImplDX11_CreateDeviceObjects();
return ImGui_ImplDX11_CreateDeviceObjects();
return true;
}

View File

@ -17,7 +17,7 @@ struct ID3D11DeviceContext;
IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context);
IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame();
IMGUI_IMPL_API bool ImGui_ImplDX11_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state.

View File

@ -634,8 +634,9 @@ void ImGui_ImplDX12_Shutdown()
g_frameIndex = UINT_MAX;
}
void ImGui_ImplDX12_NewFrame()
bool ImGui_ImplDX12_NewFrame()
{
if (!g_pPipelineState)
ImGui_ImplDX12_CreateDeviceObjects();
return ImGui_ImplDX12_CreateDeviceObjects();
return true;
}

View File

@ -35,7 +35,7 @@ struct D3D12_GPU_DESCRIPTOR_HANDLE;
IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap,
D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle);
IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame();
IMGUI_IMPL_API bool ImGui_ImplDX12_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list);
// Use if you want to reset your rendering device without losing Dear ImGui state.

View File

@ -130,6 +130,7 @@ void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
if (g_pd3dDevice->CreateStateBlock(D3DSBT_ALL, &d3d9_state_block) < 0)
return;
d3d9_state_block->Capture();
// Backup the DX9 transform (DX9 documentation suggests that it is included in the StateBlock but it doesn't appear to)
D3DMATRIX last_world, last_view, last_projection;
g_pd3dDevice->GetTransform(D3DTS_WORLD, &last_world);
@ -277,8 +278,9 @@ void ImGui_ImplDX9_InvalidateDeviceObjects()
if (g_FontTexture) { g_FontTexture->Release(); g_FontTexture = NULL; ImGui::GetIO().Fonts->TexID = NULL; } // We copied g_pFontTextureView to io.Fonts->TexID so let's clear that as well.
}
void ImGui_ImplDX9_NewFrame()
bool ImGui_ImplDX9_NewFrame()
{
if (!g_FontTexture)
ImGui_ImplDX9_CreateDeviceObjects();
return ImGui_ImplDX9_CreateDeviceObjects();
return true;
}

View File

@ -16,7 +16,7 @@ struct IDirect3DDevice9;
IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device);
IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame();
IMGUI_IMPL_API bool ImGui_ImplDX9_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state.

View File

@ -187,7 +187,7 @@ static void *create_client_interface(const char *ver)
STEAMAPI_API void * S_CALLTYPE SteamInternal_CreateInterface( const char *ver )
{
PRINT_DEBUG("SteamInternal_CreateInterface %s\n", ver);
if (!get_steam_client()->user_logged_in) return NULL;
if (!get_steam_client()->user_logged_in && !get_steam_client()->IsServerInit()) return NULL;
return create_client_interface(ver);
}
@ -509,6 +509,7 @@ STEAMAPI_API bool S_CALLTYPE SteamAPI_InitSafe()
STEAMAPI_API ISteamClient *SteamClient() {
PRINT_DEBUG("SteamClient()\n");
load_old_interface_versions();
if (!get_steam_client()->user_logged_in) return NULL;
return (ISteamClient *)SteamInternal_CreateInterface(old_client);
}

View File

@ -80,8 +80,7 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
initialized = true;
}
ImGui_ImplDX10_NewFrame();
if (ImGui_ImplDX10_NewFrame())
{
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);

View File

@ -121,8 +121,7 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
initialized = true;
}
ImGui_ImplDX11_NewFrame();
if (ImGui_ImplDX11_NewFrame())
{
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);

View File

@ -176,8 +176,7 @@ void DX12_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
pDevice->Release();
}
ImGui_ImplDX12_NewFrame();
if (ImGui_ImplDX12_NewFrame())
{
Windows_Hook::Inst()->prepareForOverlay(sc_desc.OutputWindow);

View File

@ -75,8 +75,7 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
initialized = true;
}
ImGui_ImplDX9_NewFrame();
if (ImGui_ImplDX9_NewFrame())
{
Windows_Hook::Inst()->prepareForOverlay(param.hFocusWindow);

View File

@ -84,8 +84,7 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC)
initialized = true;
}
ImGui_ImplOpenGL3_NewFrame();
if (ImGui_ImplOpenGL3_NewFrame())
{
Windows_Hook::Inst()->prepareForOverlay(hWnd);

View File

@ -55,7 +55,6 @@ public:
/// man-in-the-middle attacks.
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P
///
/// nVirtualPort specifies how clients can connect to this socket using
@ -80,7 +79,6 @@ public:
/// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort ) = 0;
#endif
/// Accept an incoming connection that has been received on a listen socket.
///
@ -292,8 +290,6 @@ public:
/// even if they are not signed into Steam.)
virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Clients connecting to dedicated servers hosted in a data center,
// using central-authority-granted tickets.
@ -365,8 +361,6 @@ public:
/// Note that this call MUST be made through the SteamGameServerNetworkingSockets() interface
virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
// Invoke all callbacks queued for this interface.
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
// So if you have code that is also targeting Steam, you should call this at about the

View File

@ -43,7 +43,6 @@ public:
/// man-in-the-middle attacks.
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P
///
/// nVirtualPort specifies how clients can connect to this socket using
@ -68,7 +67,6 @@ public:
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort ) = 0;
#endif
/// Accept an incoming connection that has been received on a listen socket.
///
@ -331,8 +329,6 @@ public:
#endif
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Clients connecting to dedicated servers hosted in a data center,
// using central-authority-granted tickets.
@ -447,8 +443,6 @@ public:
/// and don't share it directly with clients.
virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
// Invoke all callbacks queued for this interface.
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
// So if you have code that is also targeting Steam, you should call this at about the

View File

@ -43,7 +43,6 @@ public:
/// man-in-the-middle attacks.
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr *address ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P
///
/// nVirtualPort specifies how clients can connect to this socket using
@ -68,7 +67,6 @@ public:
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
/// when your app initializes
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity *identityRemote, int nVirtualPort ) = 0;
#endif
/// Accept an incoming connection that has been received on a listen socket.
///
@ -331,8 +329,6 @@ public:
#endif
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Clients connecting to dedicated servers hosted in a data center,
// using central-authority-granted tickets.
@ -447,8 +443,6 @@ public:
/// and don't share it directly with clients.
virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
// Invoke all callbacks queued for this interface.
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
// So if you have code that is also targeting Steam, you should call this at about the

View File

@ -52,7 +52,6 @@ public:
/// setting the options "immediately" after creation.
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P
///
/// nVirtualPort specifies how clients can connect to this socket using
@ -81,7 +80,6 @@ public:
/// SteamNetworkingConfigValue_t for more about why this is preferable to
/// setting the options "immediately" after creation.
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
#endif
/// Accept an incoming connection that has been received on a listen socket.
///
@ -370,8 +368,6 @@ public:
/// details, pass non-NULL to receive them.
virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
// Clients connecting to dedicated servers hosted in a data center,
// using central-authority-granted tickets.
@ -567,7 +563,6 @@ public:
/// If you expect to be using relayed connections, then you probably want
/// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes
virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Certificate provision by the application. (On Steam, Steam will handle all this automatically)
#ifndef STEAMNETWORKINGSOCKETS_STEAM