Exemplo n.º 1
0
Arquivo: Fove.cpp Projeto: bjth/xenko
	DLL_EXPORT_API npBool xnFoveStartup()
	{
		if (!__libFove)
		{
			__libFove = LoadDynamicLibrary("FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x86\\FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x64\\FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x64/FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x64/FoveClient");
			if (!__libFove)
			{
				return false;
			}

			GetFVRHeadsetPtr get_fvr_headset_ptr = (GetFVRHeadsetPtr)GetSymbolAddress(__libFove, "CGetFVRHeadset");
			if (!get_fvr_headset_ptr) return false;
			sHeadSet = get_fvr_headset_ptr();

			CGetFVRCompositorPtr get_fvr_compositor_ptr = (CGetFVRCompositorPtr)GetSymbolAddress(__libFove, "CGetFVRCompositor");
			if (!get_fvr_compositor_ptr) return false;
			sCompositor = get_fvr_compositor_ptr();
		}

		if(sHeadSet && !sFoveInitialized)
		{
			sFoveInitialized = sHeadSet->Initialise();
		}

		return sFoveInitialized;
	}
Exemplo n.º 2
0
void RobboIniz ()
{
  char STR[16];
  printf ("RobboBaseLib Dynamic_Link\n");
  if (LoadDynamicLibrary (LIB_NAME0) || LoadDynamicLibrary (LIB_NAME1))
    {
      FUNC_CALL (RobboBaseLibStartUp) (TRUE); /* background */
      FUNC_CALL (GetRobboBaseLibraryVersion) (STR);
      printf ("RobboBaseLib Version %s (dynamic)\n", STR);
    }
}
Exemplo n.º 3
0
		npBool xnAudioInit()
		{
			if (OpenSLESLibrary) return true;

			OpenSLESLibrary = LoadDynamicLibrary("libOpenSLES");
			if (!OpenSLESLibrary) return false;

			SL_IID_ENGINE_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_ENGINE");
			if (!SL_IID_ENGINE_PTR) return false;

			SL_IID_BUFFERQUEUE_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_BUFFERQUEUE");
			if (!SL_IID_BUFFERQUEUE_PTR) return false;

			SL_IID_VOLUME_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_VOLUME");
			if (!SL_IID_VOLUME_PTR) return false;

			SL_IID_PLAY_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_PLAY");
			if (!SL_IID_PLAY_PTR) return false;

			SL_IID_PLAYBACKRATE_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_PLAYBACKRATE");
			if (!SL_IID_PLAYBACKRATE_PTR) return false;

			slCreateEngineFunc = (slCreateEnginePtr)GetSymbolAddress(OpenSLESLibrary, "slCreateEngine");
			if (!slCreateEngineFunc) return false;

			return true;
		}
Exemplo n.º 4
0
/*==========================================================================*
 * FUNCTION : LoadStdPortDriverLib
 * PURPOSE  : open and load a std port driver named pszDrvName
 * CALLS    : 
 * CALLED BY: 
 * ARGUMENTS: IN char           *pszDrvName : 
 *            OUT STD_PORT_DRV  *pPort      : 
 * RETURN   : static BOOL : TRUE for OK.
 * COMMENTS : 
 *==========================================================================*/
static BOOL LoadStdPortDriverLib(IN char *pszDrvName,
								  OUT STD_PORT_DRV *pPort)
{
	static const char *pszSymName[] =
	{
		SYM_HAL_COMMOPEN,		//"HAL_CommOpen"
		SYM_HAL_COMMACCEPT,		//"HAL_CommAccept"
		SYM_HAL_COMMREAD,		//"HAL_CommRead"
		SYM_HAL_COMMWRITE,		//"HAL_CommWrite"
		SYM_HAL_COMMCONTROL,		//"HAL_CommControl"
		SYM_HAL_COMMCLOSE		//"HAL_CommClose"
	};

	HANDLE	*pfnProc[] =
	{
		(HANDLE *)&pPort->pfnOpen,
		(HANDLE *)&pPort->pfnAccept,
		(HANDLE *)&pPort->pfnRead,
		(HANDLE *)&pPort->pfnWrite,
		(HANDLE *)&pPort->pfnControl,
		(HANDLE *)&pPort->pfnClose
	};

	pPort->hLib = LoadDynamicLibrary(pszDrvName,
		ITEM_OF(pszSymName),
		pszSymName, pfnProc,			// symbol names and addresses
		TRUE);					// all symbols shall be found.

	return (pPort->hLib != NULL) ? TRUE : FALSE;
}
Exemplo n.º 5
0
IGraphicsApi* CreateGraphicsApi(IWindow* targetWindow, unsigned backBufferWidth, unsigned backBufferHeight, eGraphicsApiType type) {
	// try to load the dynamic libraries and return an api
	switch (type) {
		case eGraphicsApiType::GRAPHICS_API_D3D11:
			if (hDllD3D11) {
				if (CreateGraphicsApiD3D11)
					return CreateGraphicsApiD3D11(targetWindow, backBufferWidth, backBufferHeight);
				else
					return 0;
			}
			else {
				hDllD3D11 = LoadDynamicLibrary("GraphicsApiD3D11");
				if (!hDllD3D11) {
					return nullptr;
				}
				CreateGraphicsApiD3D11 = (IGraphicsApi*(*)(IWindow*, unsigned, unsigned))GetFunctionAddress(hDllD3D11, "CreateGraphicsApiD3D11");
				if (!CreateGraphicsApiD3D11) {
					assert(false);
					return nullptr;
				}
				return CreateGraphicsApiD3D11(targetWindow, backBufferWidth, backBufferHeight);
			}
			break;
		case eGraphicsApiType::GRAPHICS_API_OPENGL43:
			if (hDllOpenGL43) {
				if (CreateGraphicsApiGL43)
					return CreateGraphicsApiGL43(targetWindow, backBufferWidth, backBufferHeight);
				else
					return nullptr;
			}
			else {
				hDllOpenGL43 = LoadDynamicLibrary("GraphicsApiGL");
				if (!hDllOpenGL43) {
					return nullptr;
				}
				CreateGraphicsApiGL43 = (IGraphicsApi*(*)(IWindow*, unsigned, unsigned))GetFunctionAddress(hDllOpenGL43, "CreateGraphicsApiDL");
				if (!CreateGraphicsApiGL43) {
					assert(false);
					return nullptr;
				}
				return CreateGraphicsApiGL43(targetWindow, backBufferWidth, backBufferHeight);
			}
			break;
		default:
			return nullptr;
	}
}
Exemplo n.º 6
0
void LoadAllDynamicLibraries(const str_type::string& path, asIScriptEngine *pASEngine)
{
	const str_type::string content = enml::GetStringFromAnsiFile(path + _ETH_DYNAMIC_LIBRARY_LIST);
	if (content == GS_L(""))
		return;

	std::vector<str_type::string> v = splitString(content, GS_L("\n"));
	for (std::size_t t = 0; t < v.size(); t++)
	{
		LoadDynamicLibrary(str_type::string(path + v[t]).c_str(), pASEngine);
	}
}