/
redgpu
/
xess
Обзор
Документация
Войти
/
redgpu
/
xess
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/basic_sample_low_latency/DXSample.h
85 строк
2 KB
Intel XeSS
Updated to XeSS SDK 2.1.0
30 июл 2025, 22:47
30 июл 2025, 22:47
c159ef4
Код
Авторство
О чём код?
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // Copyright (c) 2023 Intel Corporation // // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once #include "DXSampleHelper.h" #include "Win32Application.h" class DXSample { public: DXSample(UINT width, UINT height, std::wstring name); virtual ~DXSample(); virtual void OnInit() = 0; virtual void OnUpdate() = 0; virtual void OnRender() = 0; virtual void OnDestroy() = 0; virtual void SetViewPort(UINT width, UINT height) = 0; virtual void OnSleep() = 0; // Samples override the event handlers to handle specific messages. virtual void OnKeyDown(UINT8 /*key*/) {} virtual void OnKeyUp(UINT8 /*key*/) {} virtual void OnMouseWheel(WORD wValue) {} // Accessors. UINT GetWidth() const { return m_width; } UINT GetHeight() const { return m_height; } const WCHAR* GetTitle() const { return m_title.c_str(); } void ParseCommandLineArgs(_In_reads_(argc) WCHAR* argv[], int argc); // Flip mode bool m_useAsyncFlip = false; // Target FPS float m_frameMS = 0; // as fast as possible // Use Full Screen bool m_fullScreen = false; #ifdef ENABLE_XELL bool m_latencyReductionEnabled = false; #endif UINT GetFrameCountLimit() const { return m_frame_count_limit; } protected: std::wstring GetAssetFullPath(LPCWSTR assetName); void GetHardwareAdapter( _In_ IDXGIFactory1* pFactory, _Outptr_result_maybenull_ IDXGIAdapter1** ppAdapter, bool requestHighPerformanceAdapter = false); void SetCustomWindowText(LPCWSTR text); // Viewport dimensions. UINT m_width; UINT m_height; float m_aspectRatio; // Adapter info. bool m_useWarpDevice; INT m_hardwareAdapterId; UINT m_frame_count_limit = 0; private: // Root assets path. std::wstring m_assetsPath; // Window title. std::wstring m_title; };