Skip to content

Commit

Permalink
Fixed compile errors on iOS platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBanana committed Jul 3, 2023
1 parent fc61273 commit 8f8a7da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions sources/Renderer/Metal/MTTypes.mm
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ MTLTextureType ToMTLTextureType(const TextureType textureType)
case TextureType::TextureCubeArray: return MTLTextureTypeCubeArray;
case TextureType::Texture2DMS: return MTLTextureType2DMultisample;
case TextureType::Texture2DMSArray:
#ifndef LLGL_OS_IOS
if (@available(macOS 10.14, *))
return MTLTextureType2DMultisampleArray;
#endif
break;
}
MapFailed("TextureType", "MTLTextureType");
Expand Down
25 changes: 15 additions & 10 deletions tests/Test_iOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/

#include <LLGL/LLGL.h>
#include <LLGL/Misc/VertexFormat.h>
#include <iostream>
#include <LLGL/Utils/VertexFormat.h>


#if 0 // TESTING
Expand Down Expand Up @@ -194,7 +193,7 @@ int main()
{
try
{
LLGL::Log::SetReportCallbackStd(&std::cout);
LLGL::Log::RegisterCallbackStd();

// Load render system module
auto renderer = LLGL::RenderSystem::Load("Metal");
Expand All @@ -212,10 +211,16 @@ int main()
// Print rendering capabilities
const auto& info = renderer->GetRendererInfo();

std::cout << "Renderer: " << info.rendererName << std::endl;
std::cout << "Vendor: " << info.vendorName << std::endl;
std::cout << "Device: " << info.deviceName << std::endl;
std::cout << "Shading Language: " << info.shadingLanguageName << std::endl;
LLGL::Log::Printf(
"Renderer: %s\n"
"Vendor: %s\n"
"Device: %s\n"
"Shading Language: %s\n",
info.rendererName.c_str(),
info.vendorName.c_str(),
info.deviceName.c_str(),
info.shadingLanguageName.c_str()
);

// Create command buffer
auto commandQueue = renderer->GetCommandQueue();
Expand Down Expand Up @@ -301,7 +306,7 @@ int main()
if (auto report = shader->GetReport())
{
if (report->HasErrors())
std::cerr << report->GetText() << std::endl;
LLGL::Log::Errorf("%s\n", report->GetText());
}
}

Expand All @@ -314,7 +319,7 @@ int main()
}
auto pipeline = renderer->CreatePipelineState(pipelineDesc);

LLGL::ColorRGBAf bgColor{ 0.0, 1.0f, 0.0f };
LLGL::ClearValue bgColor{ 0.0, 1.0f, 0.0f, 1.0f };

// Main loop
while (canvas.ProcessEvents()/* && !input->KeyDown(LLGL::Key::Escape)*/)
Expand Down Expand Up @@ -342,7 +347,7 @@ int main()
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
LLGL::Log::Errorf("%s\n", e.what());
}
return 0;
}
Expand Down

0 comments on commit 8f8a7da

Please sign in to comment.