这篇教程C++ AdjustWindowRect函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AdjustWindowRect函数的典型用法代码示例。如果您正苦于以下问题:C++ AdjustWindowRect函数的具体用法?C++ AdjustWindowRect怎么用?C++ AdjustWindowRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AdjustWindowRect函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DEBUG_INFO//------------------------------------------------------------------------------------------------// Name: acquireGraphics// Desc: Implements a robust algorithm to create the Direct3D device//------------------------------------------------------------------------------------------------bool EvidyonClient::createD3DDevice(bool windowed, unsigned int requiredNumberOfBlendMatrices){ // Get the main Direct3D object from the display structure IDirect3D9* d3d = d3d_; { // Display the adapter that we are using D3DADAPTER_IDENTIFIER9 identifier; if (!APP_WARNING(FAILED(d3d->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &identifier)))("Failed to get adapter information")) DEBUG_INFO("Using /"%s/"", identifier.Description); } // Set up the structure used to create the Direct3D device. D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); // Initialize some parts of the parameters d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; //d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; d3dpp.BackBufferCount = 1; //d3dpp.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL; // Set up the rest of the parameters based on the windowed mode if (windowed) { d3dpp.Windowed = TRUE; d3dpp.BackBufferWidth = config_.getSetting("Graphics", "ResolutionX", 800); d3dpp.BackBufferHeight = config_.getSetting("Graphics", "ResolutionY", 600); d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; // Create the application's window RECT rc = { 0, 0, d3dpp.BackBufferWidth, d3dpp.BackBufferHeight }; AdjustWindowRect(&rc, WS_POPUPWINDOW|WS_CAPTION, FALSE); d3dpp.hDeviceWindow = CreateWindow(STRING_WINDOWCLASS, STRING_WINDOWTITLE, WS_POPUPWINDOW|WS_CAPTION|WS_MINIMIZEBOX, 50, 50, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, GetModuleHandle(NULL), NULL); } else { // Get the current display mode (this should always succeed) D3DDISPLAYMODE displayMode; if (APP_ERROR(FAILED(d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &displayMode)))("Couldn't get current display mode")) return false; // Use the current display mode d3dpp.Windowed = FALSE; d3dpp.BackBufferWidth = config_.getSetting("Graphics", "ResolutionX", (int)displayMode.Width); d3dpp.BackBufferHeight = config_.getSetting("Graphics", "ResolutionY", (int)displayMode.Height); switch (config_.getSetting("Graphics", "ColorDepth", 16)) { default: case 16: d3dpp.BackBufferFormat = D3DFMT_R5G6B5; break; case 15: d3dpp.BackBufferFormat = D3DFMT_X1R5G5B5; break; case 24: d3dpp.BackBufferFormat = D3DFMT_R8G8B8; break; case 32: d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; break; } // Create the application's window d3dpp.hDeviceWindow = CreateWindow(STRING_WINDOWCLASS, STRING_WINDOWTITLE, WS_POPUP, 0, 0, d3dpp.BackBufferWidth, d3dpp.BackBufferHeight, NULL, NULL, GetModuleHandle(NULL), NULL); } // Make sure a window was created if (APP_ERROR(d3dpp.hDeviceWindow == NULL)("Unable to create application window")) { // Try again in windowed mode if this was fullscreen; otherwise, fail if (!windowed) return createD3DDevice(true, requiredNumberOfBlendMatrices); else return false; } // Should we force the rendering into software mode? bool forceSoftwareMode = config_.getSetting("Graphics", "ForceSoftwareRendering", 0) == 1; // Parameters that will be used to create the device bool createHardwareDevice = !forceSoftwareMode; // Use D3DCREATE_HARDWARE_VERTEXPROCESSING; otherwise, D3DCREATE_SOFTWARE_VERTEXPROCESSING bool createPureDevice = false; // Set the D3DCREATE_PUREDEVICE flag. Only valid if createHardwareDevice is true. bool createMixedDevice = false; // Set the D3DCREATE_MIXED_VERTEXPROCESSING flag. Only valid if createHardwareDevice is false. // Get device capabilities so we can determine what kind of device to make D3DCAPS9 devCaps; if (!APP_ERROR(FAILED(d3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &devCaps)))("Couldn't get device capibilities")) { // Determine whether or not we can use a pure hardware device createPureDevice = createHardwareDevice && ((devCaps.DevCaps & D3DDEVCAPS_PUREDEVICE) != 0);//.........这里部分代码省略.........
开发者ID:karlgluck,项目名称:Evidyon,代码行数:101,
示例2: WinMain//-----------------------------------------------------------------------// WinMain//-----------------------------------------------------------------------int APIENTRY WinMain(HINSTANCE _hInstance, HINSTANCE _hPrevInstance, LPSTR _lpCmdLine, int _nCmdShow){ _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); //_CrtSetBreakAlloc(143430); new CEngine(); CEngine& engine = CEngine::GetSingleton(); //*/ // Register the window class WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, APPLICATION_NAME, NULL }; RegisterClassEx(&wc); // Calcular el tamano de nuestra ventana RECT rc = { 0, 0, WIDTH, HEIGHT }; AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE); // Create the application's window HWND hWnd = CreateWindow(APPLICATION_NAME, APPLICATION_NAME, WS_OVERLAPPEDWINDOW, 100, 100, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, wc.hInstance, NULL); // A C++ Admin_sendMessage函数代码示例 C++ AdjustControlSize函数代码示例
|