diff options
| author | Yong He <yonghe@outlook.com> | 2021-01-11 09:11:52 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-11 09:11:52 -0800 |
| commit | 5554777188225266e2295db3588f6cb17cae0c4d (patch) | |
| tree | 9d15992cd24d752cde1047745cf75a25e841f494 /examples/gpu-printing | |
| parent | e24c5a6cb9c3347477b83abe084a09ae8f9fde0a (diff) | |
Make `gfx::Renderer` a COM interface. (#1653)
* Make `gfx::Renderer` a COM interface.
This is a first step towards making the `gfx` library expose a COM compatible DLL interface. Remaining classes will come as separate PRs.
* Fixup project files
* Fix calling conventions
* Make gfx::create*Renderer() functions increase ref count by 1
* Make renderer createFunc return via out parameter
Diffstat (limited to 'examples/gpu-printing')
| -rw-r--r-- | examples/gpu-printing/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/gpu-printing/main.cpp b/examples/gpu-printing/main.cpp index 10af0eef7..75c083a33 100644 --- a/examples/gpu-printing/main.cpp +++ b/examples/gpu-printing/main.cpp @@ -14,7 +14,7 @@ using namespace gfx; #include "gpu-printing.h" -ComPtr<slang::ISession> createSlangSession(gfx::Renderer* renderer) +ComPtr<slang::ISession> createSlangSession(gfx::IRenderer* renderer) { ComPtr<slang::IGlobalSession> slangGlobalSession; slangGlobalSession.attach(spCreateSession(NULL)); @@ -65,7 +65,7 @@ int gWindowHeight = 480; gfx::ApplicationContext* gAppContext; gfx::Window* gWindow; -RefPtr<gfx::Renderer> gRenderer; +ComPtr<gfx::IRenderer> gRenderer; ComPtr<slang::ISession> gSlangSession; ComPtr<slang::IModule> gSlangModule; @@ -118,8 +118,8 @@ Result execute() windowDesc.height = gWindowHeight; gWindow = createWindow(windowDesc); - gRenderer = createD3D11Renderer(); - Renderer::Desc rendererDesc; + createD3D11Renderer(gRenderer.writeRef()); + IRenderer::Desc rendererDesc; rendererDesc.width = gWindowWidth; rendererDesc.height = gWindowHeight; { |
