mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Fixed Android build.
This commit is contained in:
48
src/bgfx.cpp
48
src/bgfx.cpp
@@ -2621,6 +2621,54 @@ namespace bgfx
|
||||
};
|
||||
static_assert(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
|
||||
|
||||
void* findModule(const char* _name)
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
// NOTE: there was some reason to do it this way instead of simply calling GetModuleHandleA,
|
||||
// but not sure what it was.
|
||||
HANDLE process = GetCurrentProcess();
|
||||
DWORD size;
|
||||
BOOL result = EnumProcessModules(process
|
||||
, NULL
|
||||
, 0
|
||||
, &size
|
||||
);
|
||||
if (0 != result)
|
||||
{
|
||||
HMODULE* modules = (HMODULE*)BX_STACK_ALLOC(size);
|
||||
result = EnumProcessModules(process
|
||||
, modules
|
||||
, size
|
||||
, &size
|
||||
);
|
||||
|
||||
if (0 != result)
|
||||
{
|
||||
char moduleName[MAX_PATH];
|
||||
|
||||
for (uint32_t ii = 0, num = uint32_t(size/sizeof(HMODULE) ); ii < num; ++ii)
|
||||
{
|
||||
result = GetModuleBaseNameA(process
|
||||
, modules[ii]
|
||||
, moduleName
|
||||
, BX_COUNTOF(moduleName)
|
||||
);
|
||||
|
||||
if (0 != result
|
||||
&& 0 == bx::strCmpI(_name, moduleName) )
|
||||
{
|
||||
return (void*)modules[ii];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
BX_UNUSED(_name);
|
||||
#endif // BX_PLATFORM_WINDOWS
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build)
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
|
||||
@@ -427,6 +427,7 @@ namespace bgfx
|
||||
};
|
||||
};
|
||||
|
||||
void* findModule(const char* _name);
|
||||
bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build = UINT32_MAX);
|
||||
|
||||
constexpr bool isShaderType(uint32_t _magic, char _type)
|
||||
|
||||
@@ -17,52 +17,6 @@
|
||||
|
||||
namespace bgfx
|
||||
{
|
||||
void* findModule(const char* _name)
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
// NOTE: there was some reason to do it this way instead of simply calling GetModuleHandleA,
|
||||
// but not sure what it was.
|
||||
HANDLE process = GetCurrentProcess();
|
||||
DWORD size;
|
||||
BOOL result = EnumProcessModules(process
|
||||
, NULL
|
||||
, 0
|
||||
, &size
|
||||
);
|
||||
if (0 != result)
|
||||
{
|
||||
HMODULE* modules = (HMODULE*)BX_STACK_ALLOC(size);
|
||||
result = EnumProcessModules(process
|
||||
, modules
|
||||
, size
|
||||
, &size
|
||||
);
|
||||
|
||||
if (0 != result)
|
||||
{
|
||||
char moduleName[MAX_PATH];
|
||||
for (uint32_t ii = 0, num = uint32_t(size/sizeof(HMODULE) ); ii < num; ++ii)
|
||||
{
|
||||
result = GetModuleBaseNameA(process
|
||||
, modules[ii]
|
||||
, moduleName
|
||||
, BX_COUNTOF(moduleName)
|
||||
);
|
||||
if (0 != result
|
||||
&& 0 == bx::strCmpI(_name, moduleName) )
|
||||
{
|
||||
return (void*)modules[ii];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
BX_UNUSED(_name);
|
||||
#endif // BX_PLATFORM_WINDOWS
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pRENDERDOC_GetAPI RENDERDOC_GetAPI;
|
||||
static RENDERDOC_API_1_1_2* s_renderDoc = NULL;
|
||||
static void* s_renderDocDll = NULL;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
namespace bgfx
|
||||
{
|
||||
void* findModule(const char* _name);
|
||||
void* loadRenderDoc();
|
||||
void unloadRenderDoc(void*);
|
||||
void renderDocTriggerCapture();
|
||||
|
||||
Reference in New Issue
Block a user