From 8325746ddce86688447cc206234f2722318f2321 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 11 Mar 2019 19:47:22 -0500 Subject: Updated readme files for D3D11, D3D12 and GL backend --- Graphics/GraphicsEngineOpenGL/readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/readme.md b/Graphics/GraphicsEngineOpenGL/readme.md index ab987dad..934595bc 100644 --- a/Graphics/GraphicsEngineOpenGL/readme.md +++ b/Graphics/GraphicsEngineOpenGL/readme.md @@ -8,7 +8,7 @@ Implementation of OpenGL/GLES back-end The following code snippet shows how to initialize Diligent Engine in OpenGL/GLES mode. ```cpp -#include "RenderDeviceFactoryOpenGL.h" +#include "EngineFactoryOpenGL.h" using namespace Diligent; // ... @@ -22,11 +22,11 @@ RefCntAutoPtr pRenderDevice; RefCntAutoPtr pImmediateContext; SwapChainDesc SCDesc; RefCntAutoPtr pSwapChain; -auto *pFactoryOpenGL = GetEngineFactoryOpenGL(); -EngineGLCreateInfo CreationAttribs; -CreationAttribs.pNativeWndHandle = NativeWindowHandle; +auto* pFactoryOpenGL = GetEngineFactoryOpenGL(); +EngineGLCreateInfo EngineCI; +EngineCI = NativeWindowHandle; pFactoryOpenGL->CreateDeviceAndSwapChainGL( - CreationAttribs, &pRenderDevice, &pImmediateContext, SCDesc, &pSwapChain); + EngineCI, &pRenderDevice, &pImmediateContext, SCDesc, &pSwapChain); ``` Alternatively, the engine can be initialized by attaching to existing OpenGL context (see [below](#initializing-the-engine-by-attaching-to-existing-gl-context)). @@ -50,13 +50,13 @@ Below are some of the methods that provide access to internal D3D11 objects: ## Creating Diligent Engine Objects from OpenGL Handles -* `void IRenderDeviceGL::CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc &TexDesc, RESOURCE_STATE InitialState, ITexture **ppTexture)` - +* `void IRenderDeviceGL::CreateTextureFromGLHandle(Uint32 GLHandle, const TextureDesc& TexDesc, RESOURCE_STATE InitialState, ITexture** ppTexture)` - creates a diligent engine texture from OpenGL handle. The method takes OpenGL handle GLHandle, texture description TexDesc, and writes the pointer to the created texture object at the memory address pointed to by ppTexture. The engine can automatically set texture width, height, depth, mip levels count, and format, but the remaining field of TexDesc structure must be populated by the application. Note that diligent engine texture object does not take ownership of the GL resource, and the application must not destroy it while it is in use by the engine. -* `void IRenderDeviceGL::CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc &BuffDesc, RESOURCE_STATE InitialState, IBuffer **ppBuffer)` - +* `void IRenderDeviceGL::CreateBufferFromGLHandle(Uint32 GLHandle, const BufferDesc& BuffDesc, RESOURCE_STATE InitialState, IBuffer** ppBuffer)` - creates a diligent engine buffer from OpenGL handle. The method takes OpenGL handle GLHandle, buffer description BuffDesc, and writes the pointer to the created buffer object at the memory address pointed to by ppBuffer. The engine can automatically set the buffer size, but the rest of the fields need to be set by the client. Note that diligent engine buffer object does not @@ -67,7 +67,7 @@ Below are some of the methods that provide access to internal D3D11 objects: The code snippet below shows how diligent engine can be attached to existing GL context ```cpp -auto *pFactoryGL = GetEngineFactoryOpenGL(); +auto* pFactoryGL = GetEngineFactoryOpenGL(); EngineCreationAttribs Attribs; pFactoryGL->AttachToActiveGLContext(Attribs, &m_Device, &m_Context); ``` @@ -83,4 +83,4 @@ For more information about interoperability with OpenGL, please visit [Diligent [diligentgraphics.com](http://diligentgraphics.com) [![Diligent Engine on Twitter](https://github.com/DiligentGraphics/DiligentCore/blob/master/media/twitter.png)](https://twitter.com/diligentengine) -[![Diligent Engine on Facebook](https://github.com/DiligentGraphics/DiligentCore/blob/master/media/facebook.png)](https://www.facebook.com/DiligentGraphics/) \ No newline at end of file +[![Diligent Engine on Facebook](https://github.com/DiligentGraphics/DiligentCore/blob/master/media/facebook.png)](https://www.facebook.com/DiligentGraphics/) -- cgit v1.2.3 From 425fc82bcc66e931ea3aca8ffb0a9eabc0433fc0 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 11 Mar 2019 19:57:59 -0500 Subject: Few more readme updates --- Graphics/GraphicsEngineOpenGL/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/readme.md b/Graphics/GraphicsEngineOpenGL/readme.md index 934595bc..0c3c204b 100644 --- a/Graphics/GraphicsEngineOpenGL/readme.md +++ b/Graphics/GraphicsEngineOpenGL/readme.md @@ -15,7 +15,7 @@ using namespace Diligent; #if ENGINE_DLL GetEngineFactoryOpenGLType GetEngineFactoryOpenGL; - if( !LoadGraphicsEngineOpenGL(GetEngineFactoryOpenGL) ) + if(!LoadGraphicsEngineOpenGL(GetEngineFactoryOpenGL)) return FALSE; #endif RefCntAutoPtr pRenderDevice; -- cgit v1.2.3