metal: initial work on windowing and instance creation

This commit is contained in:
Alex Szpakowski
2020-01-30 20:35:33 -04:00
parent 74cf9b8236
commit d687b4c099
9 changed files with 243 additions and 81 deletions
+22 -1
View File
@@ -88,6 +88,22 @@ static GLenum getGLBlendFactor(BlendFactor factor)
return 0;
}
love::graphics::Graphics *createInstance()
{
love::graphics::Graphics *instance = nullptr;
try
{
instance = new Graphics();
}
catch (love::Exception &e)
{
printf("Cannot create OpenGL renderer: %s\n", e.what());
}
return instance;
}
Graphics::Graphics()
: windowHasStencil(false)
, mainVAO(0)
@@ -1322,7 +1338,12 @@ void Graphics::setWireframe(bool enable)
Graphics::Renderer Graphics::getRenderer() const
{
return GLAD_ES_VERSION_2_0 ? RENDERER_OPENGLES : RENDERER_OPENGL;
return RENDERER_OPENGL;
}
bool Graphics::usesGLSLES() const
{
return GLAD_ES_VERSION_2_0;
}
Graphics::RendererInfo Graphics::getRendererInfo() const
+1
View File
@@ -108,6 +108,7 @@ public:
bool isCanvasFormatSupported(PixelFormat format, bool readable) const override;
bool isImageFormatSupported(PixelFormat format, bool sRGB) const override;
Renderer getRenderer() const override;
bool usesGLSLES() const override;
RendererInfo getRendererInfo() const override;
Shader::Language getShaderLanguageTarget() const override;