Skip to content

Instantly share code, notes, and snippets.

@piXelicidio
Created March 27, 2017 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piXelicidio/8989c1b978f3d12cfeb212518018f42d to your computer and use it in GitHub Desktop.
Save piXelicidio/8989c1b978f3d12cfeb212518018f42d to your computer and use it in GitHub Desktop.
Corona SDK or Love2D detect
-- Dirty trick to detect if Corona SDK or Love ;)
-- first time we require this module it will be inialized with the current detected SDK
if display~=nil then
-- maybe is corona sdk
if display.newImage~=nil then
-- pretty sure it is
print "Running: Corona SDK"
api = require('code.coronaapi')
end
elseif love~=nil then
-- maybe is löve
if love.graphics~=nil then
-- pretty sure it is löve
print 'Running: Löve'
api = require('code.loveapi')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment