当前位置: 首页>>代码示例>>C++>>正文


C++ ProxyHelper类代码示例

本文整理汇总了C++中ProxyHelper的典型用法代码示例。如果您正苦于以下问题:C++ ProxyHelper类的具体用法?C++ ProxyHelper怎么用?C++ ProxyHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ProxyHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProxyHelper

/**
* Loads stereo mode effect file.
***/
void StereoView::InitShaderEffects()
{
	shaderEffect[ANAGLYPH_RED_CYAN] = "AnaglyphRedCyan.fx";
	shaderEffect[ANAGLYPH_RED_CYAN_GRAY] = "AnaglyphRedCyanGray.fx";
	shaderEffect[ANAGLYPH_YELLOW_BLUE] = "AnaglyphYellowBlue.fx";
	shaderEffect[ANAGLYPH_YELLOW_BLUE_GRAY] = "AnaglyphYellowBlueGray.fx";
	shaderEffect[ANAGLYPH_GREEN_MAGENTA] = "AnaglyphGreenMagenta.fx";
	shaderEffect[ANAGLYPH_GREEN_MAGENTA_GRAY] = "AnaglyphGreenMagentaGray.fx";
	shaderEffect[SIDE_BY_SIDE] = "SideBySide.fx";
	shaderEffect[DIY_RIFT] = "SideBySideRift.fx";
	shaderEffect[OVER_UNDER] = "OverUnder.fx";
	shaderEffect[INTERLEAVE_HORZ] = "InterleaveHorz.fx";
	shaderEffect[INTERLEAVE_VERT] = "InterleaveVert.fx";
	shaderEffect[CHECKERBOARD] = "Checkerboard.fx";

	char viewPath[512];
	ProxyHelper helper = ProxyHelper();
	helper.GetPath(viewPath, "fx\\");

	strcat_s(viewPath, 512, shaderEffect[stereo_mode].c_str());

	if (FAILED(D3DXCreateEffectFromFile(m_pActualDevice, viewPath, NULL, NULL, D3DXFX_DONOTSAVESTATE, NULL, &viewEffect, NULL))) {
		OutputDebugString("Effect creation failed\n");
	}
}
开发者ID:DrBeef,项目名称:Perception,代码行数:28,代码来源:StereoView.cpp

示例2: new_selection3

	void new_selection3() {
		int selection = (int)SendMessage(combobox_handle, CB_GETCURSEL, 0, 0);
		if ( selection != CB_ERR ) {
			// save the adapter to xml file
			ProxyHelper helper = ProxyHelper();
			helper.SaveDisplayAdapter(selection);
		}
	}
开发者ID:unclok,项目名称:Perception,代码行数:8,代码来源:Main.cpp

示例3: ParsePaths

void ParsePaths()
{
	proxyDllW = (LPCWSTR)malloc(512*sizeof(wchar_t));

	ProxyHelper helper = ProxyHelper();
	dllDir = _strdup(helper.GetPath("bin\\").c_str());
	proxyDll = _strdup(helper.GetPath("bin\\d3d9.dll").c_str());
	mbstowcs_s(NULL, (wchar_t*)proxyDllW, 512, proxyDll, 512);
}
开发者ID:Innovative-Ideas,项目名称:Perception,代码行数:9,代码来源:dllmain.cpp

示例4: ParsePaths

void ParsePaths()
{
	dllDir = (LPCSTR)malloc(512*sizeof(char));
	proxyDll = (LPCSTR)malloc(512*sizeof(char));
	proxyDllW = (LPCWSTR)malloc(512*sizeof(wchar_t));

	ProxyHelper helper = ProxyHelper();
	helper.GetPath((char*)dllDir, "bin\\");
	helper.GetPath((char*)proxyDll, "bin\\d3d9.dll");
	mbstowcs_s(NULL, (wchar_t*)proxyDllW, 512, proxyDll, 512);
}
开发者ID:Enterfrize,项目名称:Perception,代码行数:11,代码来源:dllmain.cpp

示例5: ProxyHelper

void OculusRiftView::InitShaderEffects()
{
	shaderEffect[OCULUS_RIFT] = "OculusRift.fx";
	shaderEffect[OCULUS_RIFT_CROPPED] = "OculusRiftCropped.fx";

	char viewPath[512];
	ProxyHelper helper = ProxyHelper();
	helper.GetPath(viewPath, "fx\\");

	strcat_s(viewPath, 512, shaderEffect[stereo_mode].c_str());

	D3DXCreateEffectFromFile(device, viewPath, NULL, NULL, 0, NULL, &viewEffect, NULL);
}
开发者ID:CarlKenner,项目名称:Perception,代码行数:13,代码来源:OculusRiftView.cpp

示例6: OutputDebugString

/**
* Create D3D device proxy. 
* First it creates the device, then it loads the game configuration
* calling the ProxyHelper class. Last it creates and returns the
* device proxy calling D3DProxyDeviceFactory::Get().
***/
HRESULT WINAPI BaseDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface)
{
	// Create real interface
	HRESULT hResult = m_pD3D->CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags,
		pPresentationParameters, ppReturnedDeviceInterface);
	if(FAILED(hResult))
		return hResult;

	OutputDebugString("[OK] Normal D3D device created\n");

	char buf[64];
	sprintf_s(buf, "Number of back buffers = %d\n", pPresentationParameters->BackBufferCount);
	OutputDebugString(buf);

	// load configuration file
	ProxyHelper helper = ProxyHelper();
	ProxyHelper::ProxyConfig cfg;
	ProxyHelper::OculusProfile oculusProfile;
	if(!helper.LoadConfig(cfg, oculusProfile)) {
		OutputDebugString("[ERR] Config loading failed, config could not be loaded. Returning normal D3DDevice. Vireio will not be active.\n");
		return hResult;
	}

	// load HUD/GUI settings
	helper.LoadHUDConfig(cfg);
	helper.LoadGUIConfig(cfg);

	OutputDebugString("[OK] Config loading - OK\n");

	if(cfg.stereo_mode == StereoView::DISABLED) {
		OutputDebugString("[WARN] stereo_mode == disabled. Returning normal D3DDevice. Vireio will not be active.\n");
		return hResult;
	}

	OutputDebugString("[OK] Stereo mode is enabled.\n");

	char buf1[32];
	LPCSTR psz = NULL;

	wsprintf(buf1,"Config type: %d", cfg.game_type);
	psz = buf1;
	OutputDebugString(psz);
	OutputDebugString("\n");

	// Create and return proxy
	*ppReturnedDeviceInterface = D3DProxyDeviceFactory::Get(cfg, *ppReturnedDeviceInterface, this);

	OutputDebugString("[OK] Vireio D3D device created.\n");

	return hResult;
}
开发者ID:HunLyxxod,项目名称:Perception,代码行数:57,代码来源:Direct3D9.cpp

示例7: ProxyHelper

HRESULT WINAPI BaseDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
	DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
	IDirect3DDevice9** ppReturnedDeviceInterface)
{
	// load configuration file
	ProxyHelper helper = ProxyHelper();
	ProxyHelper::ProxyConfig cfg;
	bool stereoificatorCfgLoaded = helper.LoadConfig(cfg);

	if (cfg.forceAdapterNumber >= (int)GetAdapterCount()) {
		OutputDebugString("[ERR] forceAdapterNumber outside of range of valid adapters. Using original Adapter instead.\n");
	}

	// Create real interface
	HRESULT hResult = m_pD3D->CreateDevice( (cfg.forceAdapterNumber >= (int)GetAdapterCount() || (cfg.forceAdapterNumber < 0)) ? Adapter : cfg.forceAdapterNumber, DeviceType, hFocusWindow, BehaviorFlags,
		pPresentationParameters, ppReturnedDeviceInterface);
	if(FAILED(hResult))
		return hResult;

	OutputDebugString("[OK] Normal D3D device created\n");

	char buf[64];
	sprintf_s(buf, "Number of back buffers = %d\n", pPresentationParameters->BackBufferCount);
	OutputDebugString(buf);

	
	if(!stereoificatorCfgLoaded) {
		OutputDebugString("[ERR] Config loading failed, config could not be loaded. Returning normal D3DDevice. Stereoificator will not be active.\n");
		return hResult;
	}

	OutputDebugString("[OK] Config loading - OK\n");

	

	char buf1[32];
	LPCSTR psz = NULL;

	wsprintf(buf1,"Config type: %d", cfg.game_type);
	psz = buf1;
	OutputDebugString(psz);
	OutputDebugString("\n");

	// Create and return proxy
	D3DProxyDevice* newDev = new D3DProxyDevice(*ppReturnedDeviceInterface, this, cfg);
	*ppReturnedDeviceInterface = newDev;

	OutputDebugString("[OK] Stereoificator D3D device created.\n");

	return hResult;
}
开发者ID:ChrisJD,项目名称:Stereoificator,代码行数:51,代码来源:Direct3D9.cpp

示例8: SendMessage

void combobox_control::new_selection2() {
    char string[120];
    int selection = (int)SendMessage(combobox_handle, CB_GETCURSEL, 0, 0);
    if ( selection != CB_ERR ) {
        SendMessage(combobox_handle, CB_GETLBTEXT, selection, (LPARAM)string);
        int length = 0;
        char * s = string;
        while ( *s++ != '\t' ) length++;
		// save the tracker mode to xml file
		ProxyHelper helper = ProxyHelper();
		int mode = atoi(s);
		helper.SaveConfig2(mode);
	}
}
开发者ID:Maebbie,项目名称:Perception,代码行数:14,代码来源:Main.cpp

示例9: ProxyHelper

void StereoView::InitShaderEffects()
{
	
	shaderEffect[SIDE_BY_SIDE] = "SideBySide.fx";

	char viewPath[512];
	ProxyHelper helper = ProxyHelper();
	helper.GetPath(viewPath, "fx\\");

	strcat_s(viewPath, 512, shaderEffect[stereo_mode].c_str());

	if (FAILED(D3DXCreateEffectFromFile(m_pActualDevice, viewPath, NULL, NULL, D3DXFX_DONOTSAVESTATE, NULL, &viewEffect, NULL))) {
		OutputDebugString("Effect creation failed\n");
	}
}
开发者ID:ChrisJD,项目名称:Stereoificator,代码行数:15,代码来源:StereoView.cpp

示例10: DllMain

// CBT Hook-style injection.
BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD fdwReason, LPVOID lpReserved )
{
    if (fdwReason == DLL_PROCESS_ATTACH)  // When initializing....
    {
        hDLL = hModule;

        // We don't need thread notifications for what we're doing.  Thus, get
        // rid of them, thereby eliminating some of the overhead of this DLL
        DisableThreadLibraryCalls(hModule);

        // Only hook the APIs if this is the right process.
        GetModuleFileName(GetModuleHandle(NULL), targetExe, sizeof(targetExe));
        PathStripPath(targetExe);

		GetModuleFileName(GetModuleHandle(NULL), targetPath, sizeof(targetPath));
		targetPathString = std::string(targetPath);
		targetPathString = targetPathString.substr(0, targetPathString.find_last_of("\\/"));

        OutputDebugString("HIJACKDLL checking process: ");
        OutputDebugString(targetExe);
        OutputDebugString("\n");

		ParsePaths();
		ProxyHelper helper = ProxyHelper();

        if (helper.HasProfile(targetExe))
		{
			if (HookAPICalls(&D3DHook))
			{
				OutputDebugString("HookAPICalls(D3D): TRUE\n");
			} 
			else if(HookAPICalls(&KernelHook))
			{	
				OutputDebugString("HookAPICalls(Kernel): TRUE\n");
			} 
			else 
			{
				OutputDebugString("HookAPICalls(Both): FALSE\n");
			}

			SetDllDirectory(dllDir);
			SaveExeName(targetExe);
		}
    }

    return TRUE;
}
开发者ID:Enterfrize,项目名称:Perception,代码行数:48,代码来源:dllmain.cpp

示例11: ProxyHelper

/**
* Loads Oculus Rift shader effect files.
***/ 
void OculusRiftView::InitShaderEffects()
{
	//Currently, RiftUp DK1 and DK2 share the same shader effects
	shaderEffect[RIFTUP] = "OculusRift.fx";
	shaderEffect[OCULUS_RIFT_DK1] = "OculusRift.fx";
	shaderEffect[OCULUS_RIFT_DK1_CROPPED] = "OculusRiftCropped.fx";
	shaderEffect[OCULUS_RIFT_DK2] = "OculusRiftDK2.fx";
	shaderEffect[OCULUS_RIFT_DK2_CROPPED] = "OculusRiftDK2Cropped.fx";

	char viewPath[512];
	ProxyHelper helper = ProxyHelper();
	helper.GetPath(viewPath, "fx\\");

	strcat_s(viewPath, 512, shaderEffect[stereo_mode].c_str());

	D3DXCreateEffectFromFile(m_pActualDevice, viewPath, NULL, NULL, 0, NULL, &viewEffect, NULL);
}
开发者ID:DreamNik,项目名称:Perception,代码行数:20,代码来源:OculusRiftView.cpp

示例12: frame_window

	frame_window(LPCSTR window_class_identity) : window_class_name(window_class_identity) {         
		int screen_width = GetSystemMetrics(SM_CXFULLSCREEN);  
		int screen_height = GetSystemMetrics(SM_CYFULLSCREEN);  
		instance_handle = GetModuleHandle(NULL);  

		WNDCLASS window_class = { CS_OWNDC, main_window_proc, 0, 0,    
			instance_handle, NULL,    
			NULL, NULL, NULL,    
			window_class_name };   

		window_class.hIcon = LoadIcon(instance_handle, MAKEINTRESOURCE(IDI_ICON_BIG));

		RegisterClass(&window_class);   
		window_handle = CreateWindowEx(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_TOPMOST,    
			window_class_name,    
			"Vireio Perception", 
			WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), 
			//WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,   
			(screen_width-585)/2, (screen_height-240)/2, 
			585, 270,
			NULL, NULL, instance_handle, NULL);
		SetWindowLongPtr(window_handle, GWL_USERDATA, (LONG)this);  
		GetClientRect(window_handle, &client_rectangle);
		int width = client_rectangle.right - client_rectangle.left;
		int height = client_rectangle.bottom - client_rectangle.top;
		text = new static_control(instance_handle, window_handle);
		combobox = new combobox_control(instance_handle, window_handle, text, 20, 81, 1001);
		combobox2 = new combobox_control(instance_handle, window_handle, text, 20, 115, 1002);
		combobox3 = new combobox_control(instance_handle, window_handle, text, 20, 149, 1003);

		ProxyHelper helper = ProxyHelper();
		std::string viewPath = helper.GetPath("img\\logo.bmp");

		logo_bitmap = (HBITMAP)LoadImage(NULL,viewPath.c_str(),IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
		OutputDebugString("Load the bitmap\n");

		ProxyConfig cfg;
		helper.LoadUserConfig(cfg, oculusProfile);

		SetCursor(LoadCursor(NULL, IDC_ARROW)); 
		ShowWindow(window_handle, SW_SHOW);   
		UpdateWindow(window_handle); 

		//Refresh on timer for FPS readings
		SetTimer(window_handle, 1, 500, NULL);
	}  
开发者ID:unclok,项目名称:Perception,代码行数:46,代码来源:Main.cpp

示例13: wWinMain

int WINAPI wWinMain(HINSTANCE instance_handle, HINSTANCE, LPWSTR, INT) {  

	InitConfig();
	InitModes();
	InstallHook();

	frame_window main_window("perception");
	main_window.add_item("Disabled\t0");
	main_window.add_item("DIY Rift\t25");
	main_window.add_item("Oculus Rift\t26");
	main_window.add_item("Oculus Rift Cropped\t27");
	main_window.add_item("Side by Side\t20");
	main_window.add_item("Over Under\t30");
	main_window.add_item("Horizontal Interleave\t40");
	main_window.add_item("Vertical Interleave\t50");
	main_window.add_item("Checkerboard\t60");
	main_window.add_item("Anaglyph (Red/Cyan)\t1");
	main_window.add_item("Anaglyph (Red/Cyan) B+W\t2");
	main_window.add_item("Anaglyph (Yellow/Blue)\t5");
	main_window.add_item("Anaglyph (Yellow/Blue) B+W\t6");
	main_window.add_item("Anaglyph (Green/Magenta)\t10");
	main_window.add_item("Anaglyph (Green/Magenta) B+W\t11");

	main_window.add_item2("No Tracking\t0");
	main_window.add_item2("Hillcrest Labs\t10");
	main_window.add_item2("FreeTrack\t20");
	main_window.add_item2("Shared Memory Tracker\t30");
	main_window.add_item2("OculusTrack\t40");

	int mode;
	int mode2;
	ProxyHelper helper = ProxyHelper();
	helper.GetConfig(mode, mode2);

	SendMessage(main_window.combobox->combobox_handle, CB_SETCURSEL, stereoModes[mode], 0);
	SendMessage(main_window.combobox2->combobox_handle, CB_SETCURSEL, trackerModes[mode2], 0);

	main_window.run();

	RemoveHook();

	return 0;   
}
开发者ID:HunLyxxod,项目名称:Perception,代码行数:43,代码来源:Main.cpp

示例14: if


//.........这里部分代码省略.........
	}

	if(KEY_DOWN(VK_F6))
	{
		if(KEY_DOWN(VK_SHIFT))
		{
			separation = 0.0f;
			convergence = 0.0f;
			offset = 0.0f;
			yaw_multiplier = 25.0f;
			pitch_multiplier = 25.0f;
			roll_multiplier = 1.0f;
			//matrixIndex = 0;
			saveWaitCount = 500;
			doSaveNext = true;
		}
		else if(keyWaitCount <= 0)
		{
			swap_eyes = !swap_eyes;
			stereoView->SwapEyes(swap_eyes);
			keyWaitCount = 200;
		}
	}
	
	if(KEY_DOWN(VK_F7) && keyWaitCount <= 0)
	{
		matrixIndex++;
		if(matrixIndex > 15) 
		{
			matrixIndex = 0;
		}
		keyWaitCount = 200;
	}

	if(KEY_DOWN(VK_F8))
	{
		if(KEY_DOWN(VK_SHIFT))
		{
			pitch_multiplier -= mouseSpeed;
		}  
		else if(KEY_DOWN(VK_CONTROL))
		{
			roll_multiplier -= rollSpeed;
		}  
		else 
		{
			yaw_multiplier -= mouseSpeed;
		}

		if(trackerInitialized && tracker->isAvailable())
		{
			tracker->setMultipliers(yaw_multiplier, pitch_multiplier, roll_multiplier);
		}

		saveWaitCount = 500;
		doSaveNext = true;
	}
	if(KEY_DOWN(VK_F9))
	{
		if(KEY_DOWN(VK_SHIFT))
		{
			pitch_multiplier += mouseSpeed;
		}  
		else if(KEY_DOWN(VK_CONTROL))
		{
			roll_multiplier += rollSpeed;
		}  
		else 
		{
			yaw_multiplier += mouseSpeed;
		}

		if(trackerInitialized && tracker->isAvailable())
		{
			tracker->setMultipliers(yaw_multiplier, pitch_multiplier, roll_multiplier);
		}
		saveWaitCount = 500;
		doSaveNext = true;
	}

	if(saveDebugFile)
	{
		debugFile.close();
	}
	saveDebugFile = false;

	if(KEY_DOWN(VK_F12) && keyWaitCount <= 0)
	{
		// uncomment to save text debug file
		//saveDebugFile = true;
		keyWaitCount = 200;
	}

	if(doSaveNext && saveWaitCount < 0)
	{
		doSaveNext = false;
		ProxyHelper* helper = new ProxyHelper();
		helper->SaveProfile(separation, convergence, yaw_multiplier, pitch_multiplier, roll_multiplier);
	}
}
开发者ID:tmilker,项目名称:Perception,代码行数:101,代码来源:D3DProxyDevice.cpp

示例15: SHOW_CALL


//.........这里部分代码省略.........
			if (activePopup.popupType == VPT_STATS)
			{
				DismissPopup(VPT_STATS);
			}
			else
			{
				VireioPopup popup(VPT_STATS);
				ShowPopup(popup);
			}
		}

		//Toggle positional tracking
		if (config.HotkeyTogglePositionalTracking->IsPressed(controls) && HotkeysActive())
		{
			m_bPosTrackingToggle = !m_bPosTrackingToggle;

			ShowPopup(VPT_NOTIFICATION, VPS_TOAST, 1200,
				retprintf("HMD Positional Tracking %s",
					m_bPosTrackingToggle?"Enabled":"Disabled"));

			if (!m_bPosTrackingToggle)
				m_spShaderViewAdjustment->UpdatePosition(0.0f, 0.0f, 0.0f);
		}

		//Toggle mirror mode
		if (config.HotkeyMirrorMode->IsPressed(controls) && HotkeysActive())
		{
			config.mirror_mode = 1 - config.mirror_mode;

			ShowPopup(VPT_NOTIFICATION, VPS_TOAST, 1200,
				retprintf("Mirroring Mode %s",
					config.mirror_mode ? "Distorted Rift View" : "Undistorted"));

			ProxyHelper ph;
			ph.SaveUserConfigMirrorMode(config.mirror_mode);
		}

		//Toggle SDK Pose Prediction- LSHIFT + DELETE
		if (hmdInfo->GetHMDManufacturer() == HMD_OCULUS	&&
			config.HotkeyTogglePosePrediction->IsPressed(controls) && HotkeysActive() && tracker)
		{
			tracker->useSDKPosePrediction = !tracker->useSDKPosePrediction;

			ShowPopup(VPT_NOTIFICATION, VPS_TOAST, 1200,
				retprintf("SDK Pose Prediction %s",
					tracker->useSDKPosePrediction?"Enabled":"Disabled"));
		}

		//Toggle chromatic abberation correction - SHIFT+J
		if (config.HotkeyToggleChromaticAbberationCorrection->IsPressed(controls) && HotkeysActive())
		{
			stereoView->chromaticAberrationCorrection = !stereoView->chromaticAberrationCorrection;

			ShowPopup(VPT_NOTIFICATION, VPS_TOAST, 1200,
				retprintf("Chromatic Aberration Correction %s",
					stereoView->chromaticAberrationCorrection?"Enabled":"Disabled"));
		}

		//Double clicking the NUMPAD0 key will invoke the VR mouse
		//Double clicking when VR mouse is enabled will either:
		//   - Toggle between GUI and HUD scaling if double click occurs within 2 seconds
		//   - Disable VR Mouse if double click occurs after 2 seconds
		static DWORD numPad0Click = 0;
		if ((config.HotkeyVRMouse->IsPressed(controls) || numPad0Click != 0) && HotkeysActive())
		{
			if (config.HotkeyVRMouse->IsPressed(controls) && numPad0Click == 0)
开发者ID:evilc0des,项目名称:Perception,代码行数:67,代码来源:Hotkeys.cpp


注:本文中的ProxyHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。