3#include "../IGraphicsDevice.h"
5#include "BuffersD3D11.h"
6#include "CapabilitiesD3D11.h"
7#include "ContextD3D11.h"
8#include "EffectsD3D11.h"
9#include "RenderTargetsD3D11.h"
10#include "SwapChainD3D11.h"
11#include "TexturesD3D11.h"
12#include "SyncObjectsD3D11.h"
14#include "Foundation/Memory/Allocator.h"
37 void setSize(
int newWidth,
int newHeight);
38 bool getSize(
int& w,
int& h)
const override;
39 bool resizeSharedSurfaces();
51 virtual void* getNativeDevice()
override {
return device; }
52 ResourcePointer<ID3D11Device>& getDevice() {
return device; }
53 Memory::Allocator * getResourceAllocator() {
return resourceAllocator.get(); }
54 ResourceStatistics getResourceStatistics()
override;
57 bool initializeDeviceAndSwapChain();
58 bool initializeDeviceShared();
60 void setupDebugging();
65 std::unique_ptr<Memory::Allocator> resourceAllocator;
67#ifdef COGS_RENDERING_D3D9SUPPORT
68 std::unique_ptr<struct SharedResources> sharedResources;
71 ResourcePointer<ID3D11Device> device;
72 ResourcePointer<ID3D11Device1> device1;
73 ResourcePointer<ID3D11Device5> device5;
74 ResourcePointer<ID3D11InfoQueue> infoQueue;
76 SwapChainD3D11 defaultSwapChain;
78 CapabilitiesD3D11 capabilities;
80 TexturesD3D11 textures;
82 RenderTargetsD3D11 renderTargets;
83 SyncObjectsD3D11 syncObjects;
87 HRESULT createDevice(IDXGIAdapter* adapter,
88 D3D_DRIVER_TYPE driverType,
90 const std::vector<D3D_FEATURE_LEVEL>& featureLevelsRequested,
91 D3D_FEATURE_LEVEL& apiFeatureLevel);
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains all Cogs related functionality.
GraphicsDeviceType
Contains types of graphics devices that may be supported.
@ Direct3D11
Graphics device using the Direct3D 11 API.
ITextures * getTextures()
Get a pointer to the texture management interface.
bool initialize()
Initializes the graphics device with the settings previous set through calling setSettings.
SwapChainD3D11 * getDefaultSwapChain() override
Get a pointer to the default swap chain for this graphics device.
IPipelineStates * getPipelineStates()
Get a pointer to the pipeline state management interface.
ICapabilities * getCapabilities()
Get a pointer to the capability management interface used to query the graphics device capability fla...
void setSize(int newWidth, int newHeight)
Set the size of the main drawing buffer used by the graphics device in pixels.
IBuffers * getBuffers()
Get a pointer to the buffer management interface.
ISyncObjects * getSyncObjects() override
Get a pointer to the sync object management interface.
IContext * getImmediateContext()
Get a pointer to the immediate context used to issue commands to the graphics device.
void beginFrame()
Signal the beginning of a new frame to the graphics device.
IRenderTargets * getRenderTargets()
Get a pointer to the render target management interface.
IEffects * getEffects()
Get a pointer to the effect management interface.
void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None)
Signal the end of a frame to the graphics device.
virtual ISwapChain * createSwapChain(struct WindowData *windowData) override
Create a new swap chain for the specified window.
void releaseResources()
Release all resources allocated.
GraphicsDeviceType getType() const override
Get the type of the graphics device.
virtual void deleteSwapChain(ISwapChain *swapChain) override
Deletes the specified swap chain.
bool getSize(int &w, int &h) const override
Retrieve the size previously set by setSize.
std::string getIdentifier() const override
Get the graphics device identifier.
Provides buffer management functionality.
Provides capability query functionality.
Represents a graphics device context which can receive rendering commands.
Provides effects and shader management functionality.
Provides render target management functionality.
Provides sync object management.
Provides texture management functionality.