Skip to content

Commit

Permalink
Examples: Added "FirstCubeTexture" to be able to test cube textures i…
Browse files Browse the repository at this point in the history
…n a trivial use-case
  • Loading branch information
cofenberg committed Jan 2, 2020
1 parent ffcbfb2 commit a0cfbf0
Show file tree
Hide file tree
Showing 32 changed files with 1,076 additions and 40 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,4 +1,3 @@
/.vs
/Binary
/Library
/External/Example/SDL2
1 change: 1 addition & 0 deletions Example/Source/Examples/ExamplesUnityBuild.cpp
Expand Up @@ -28,6 +28,7 @@
#include "Private/Basics/FirstQueries/FirstQueries.cpp"
#include "Private/Basics/VertexBuffer/VertexBuffer.cpp"
#include "Private/Basics/FirstTexture/FirstTexture.cpp"
#include "Private/Basics/FirstCubeTexture/FirstCubeTexture.cpp"
#include "Private/Basics/FirstRenderToTexture/FirstRenderToTexture.cpp"
#include "Private/Basics/FirstMultipleRenderTargets/FirstMultipleRenderTargets.cpp"
#ifndef __ANDROID__
Expand Down
Expand Up @@ -44,9 +44,10 @@ PRAGMA_WARNING_POP
//[-------------------------------------------------------]
//[ Public methods ]
//[-------------------------------------------------------]
FirstGpgpu::FirstGpgpu(ExampleRunner& exampleRunner, const char* rhiName) :
FirstGpgpu::FirstGpgpu(ExampleRunner& exampleRunner, const char* rhiName, const std::string_view& exampleName) :
mExampleRunner(exampleRunner),
mRhiInstance(nullptr)
mRhiInstance(nullptr),
mExampleName(exampleName)
{
// Copy the given RHI name
if (nullptr != rhiName)
Expand Down
Expand Up @@ -76,8 +76,10 @@ class FirstGpgpu final
* @param[in] rhiName
* Case sensitive ASCII name of the RHI to instance, if null pointer or unknown RHI no RHI will be used.
* Example RHI names: "Null", "Vulkan", "OpenGL", "OpenGLES3", "Direct3D9", "Direct3D10", "Direct3D11", "Direct3D12"
* @param[in] exampleName
* Example name
*/
FirstGpgpu(ExampleRunner& exampleRunner, const char* rhiName);
FirstGpgpu(ExampleRunner& exampleRunner, const char* rhiName, const std::string_view& exampleName);

/**
* @brief
Expand Down Expand Up @@ -159,6 +161,7 @@ class FirstGpgpu final
char mRhiName[32]; ///< Case sensitive ASCII name of the RHI to instance
Rhi::RhiInstance* mRhiInstance; ///< RHI instance, can be a null pointer
Rhi::IRhiPtr mRhi; ///< RHI instance, can be a null pointer
const std::string_view mExampleName;
Rhi::IBufferManagerPtr mBufferManager; ///< Buffer manager, can be a null pointer
Rhi::ITextureManagerPtr mTextureManager; ///< Buffer manager, can be a null pointer
Rhi::IRootSignaturePtr mRootSignature; ///< Root signature, can be a null pointer
Expand Down
Expand Up @@ -140,7 +140,7 @@ void IcosahedronTessellation::onInitialization()
9, 10, 5, // 18
10, 6, 1 // 19
};
Rhi::IIndexBuffer* indexBuffer = mBufferManager->createIndexBuffer(sizeof(INDICES), INDICES);
Rhi::IIndexBufferPtr indexBuffer(mBufferManager->createIndexBuffer(sizeof(INDICES), INDICES));

// Create vertex array object (VAO)
// -> The vertex array object (VAO) keeps a reference to the used vertex buffer object (VBO)
Expand Down
Expand Up @@ -268,7 +268,7 @@ CubeRendererDrawInstanced::CubeRendererDrawInstanced(Rhi::IRhi& rhi, Rhi::IRende
21, 20, 22, // 10
23, 22, 20 // 11
};
Rhi::IIndexBuffer* indexBuffer = mBufferManager->createIndexBuffer(sizeof(INDICES), INDICES);
Rhi::IIndexBufferPtr indexBuffer(mBufferManager->createIndexBuffer(sizeof(INDICES), INDICES));

// Create vertex array object (VAO)
// -> The vertex array object (VAO) keeps a reference to the used vertex buffer object (VBO)
Expand Down

0 comments on commit a0cfbf0

Please sign in to comment.