CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Windows/GPU/D3D9Context.h
Views: 1401
// Copyright (c) 2015- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617// Modelled on OpenD3DBase. Might make a cleaner interface later.1819#pragma once2021#include "Common/CommonWindows.h"22#include "Windows/GPU/WindowsGraphicsContext.h"23#include <d3d9.h>24#include <wrl/client.h>2526namespace Draw {27class DrawContext;28}2930class D3D9Context : public WindowsGraphicsContext {31public:32D3D9Context() : draw_(nullptr), has9Ex_(false), d3d_(nullptr), d3dEx_(nullptr), adapterId_(-1), device_(nullptr), deviceEx_(nullptr), hDC_(nullptr), hWnd_(nullptr), hD3D9_(nullptr), presentParams_{} {33}3435bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override;36void Shutdown() override;3738void Resize() override;3940Draw::DrawContext *GetDrawContext() override { return draw_; }4142private:43Draw::DrawContext *draw_;44bool has9Ex_;45Microsoft::WRL::ComPtr<IDirect3D9> d3d_;46Microsoft::WRL::ComPtr<IDirect3D9Ex> d3dEx_;47int adapterId_;48Microsoft::WRL::ComPtr<IDirect3DDevice9> device_;49Microsoft::WRL::ComPtr<IDirect3DDevice9Ex> deviceEx_;50HDC hDC_; // Private GDI Device Context51HWND hWnd_; // Holds Our Window Handle52HMODULE hD3D9_;53D3DPRESENT_PARAMETERS presentParams_;54int swapInterval_ = 0;55};56575859