Moved image code from bgfx into bimg library.

This commit is contained in:
Branimir Karadžić
2017-04-02 19:26:02 -07:00
parent 369198a1d4
commit f475cf0623
151 changed files with 70010 additions and 22 deletions

61
scripts/bimg.lua Normal file
View File

@@ -0,0 +1,61 @@
--
-- Copyright 2010-2017 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
--
project "bimg"
kind "StaticLib"
includedirs {
path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
}
files {
path.join(BIMG_DIR, "src/image.*"),
}
project "bimg_decode"
kind "StaticLib"
includedirs {
path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BIMG_DIR, "3rdparty"),
path.join(BIMG_DIR, "3rdparty/nvtt"),
path.join(BIMG_DIR, "3rdparty/iqa/include"),
}
files {
path.join(BIMG_DIR, "src/image_decode.*"),
}
project "bimg_encode"
kind "StaticLib"
includedirs {
path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BIMG_DIR, "3rdparty"),
path.join(BIMG_DIR, "3rdparty/nvtt"),
path.join(BIMG_DIR, "3rdparty/iqa/include"),
}
files {
path.join(BIMG_DIR, "src/image_encode.*"),
path.join(BIMG_DIR, "3rdparty/libsquish/**.cpp"),
path.join(BIMG_DIR, "3rdparty/libsquish/**.h"),
path.join(BIMG_DIR, "3rdparty/edtaa3/**.cpp"),
path.join(BIMG_DIR, "3rdparty/edtaa3/**.h"),
path.join(BIMG_DIR, "3rdparty/etc1/**.cpp"),
path.join(BIMG_DIR, "3rdparty/etc1/**.h"),
path.join(BIMG_DIR, "3rdparty/etc2/**.cpp"),
path.join(BIMG_DIR, "3rdparty/etc2/**.hpp"),
path.join(BIMG_DIR, "3rdparty/nvtt/**.cpp"),
path.join(BIMG_DIR, "3rdparty/nvtt/**.h"),
path.join(BIMG_DIR, "3rdparty/pvrtc/**.cpp"),
path.join(BIMG_DIR, "3rdparty/pvrtc/**.h"),
path.join(BIMG_DIR, "3rdparty/tinyexr/**.h"),
path.join(BIMG_DIR, "3rdparty/iqa/include/**.h"),
path.join(BIMG_DIR, "3rdparty/iqa/source/**.c"),
}

74
scripts/genie.lua Normal file
View File

@@ -0,0 +1,74 @@
--
-- Copyright 2010-2017 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
--
newoption {
trigger = "with-amalgamated",
description = "Enable amalgamated build.",
}
newoption {
trigger = "with-shared-lib",
description = "Enable building shared library.",
}
newoption {
trigger = "with-tools",
description = "Enable building tools.",
}
solution "bimg"
configurations {
"Debug",
"Release",
}
if _ACTION == "xcode4" then
platforms {
"Universal",
}
else
platforms {
"x32",
"x64",
"Native", -- for targets where bitness is not specified
}
end
language "C++"
startproject "example-00-helloworld"
MODULE_DIR = path.getabsolute("..")
BIMG_DIR = path.getabsolute("..")
BX_DIR = os.getenv("BX_DIR")
local BIMG_BUILD_DIR = path.join(BIMG_DIR, ".build")
local BIMG_THIRD_PARTY_DIR = path.join(BIMG_DIR, "3rdparty")
if not BX_DIR then
BX_DIR = path.getabsolute(path.join(BIMG_DIR, "../bx"))
end
if not os.isdir(BX_DIR) then
print("bx not found at " .. BX_DIR)
print("For more info see: https://bkaradzic.github.io/bgfx/build.html")
os.exit()
end
dofile (path.join(BX_DIR, "scripts/toolchain.lua"))
if not toolchain(BIMG_BUILD_DIR, BIMG_THIRD_PARTY_DIR) then
return -- no action specified
end
function copyLib()
end
group "libs"
dofile "bimg.lua"
dofile(path.join(BX_DIR, "scripts/bx.lua"))
if _OPTIONS["with-tools"] then
group "tools"
dofile "texturec.lua"
end

57
scripts/texturec.lua Normal file
View File

@@ -0,0 +1,57 @@
--
-- Copyright 2010-2017 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
--
project "texturec"
kind "ConsoleApp"
includedirs {
path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BIMG_DIR, "3rdparty"),
path.join(BIMG_DIR, "3rdparty/nvtt"),
path.join(BIMG_DIR, "3rdparty/iqa/include"),
}
files {
path.join(BIMG_DIR, "3rdparty/libsquish/**.cpp"),
path.join(BIMG_DIR, "3rdparty/libsquish/**.h"),
path.join(BIMG_DIR, "3rdparty/edtaa3/**.cpp"),
path.join(BIMG_DIR, "3rdparty/edtaa3/**.h"),
path.join(BIMG_DIR, "3rdparty/etc1/**.cpp"),
path.join(BIMG_DIR, "3rdparty/etc1/**.h"),
path.join(BIMG_DIR, "3rdparty/etc2/**.cpp"),
path.join(BIMG_DIR, "3rdparty/etc2/**.hpp"),
path.join(BIMG_DIR, "3rdparty/nvtt/**.cpp"),
path.join(BIMG_DIR, "3rdparty/nvtt/**.h"),
path.join(BIMG_DIR, "3rdparty/pvrtc/**.cpp"),
path.join(BIMG_DIR, "3rdparty/pvrtc/**.h"),
path.join(BIMG_DIR, "3rdparty/tinyexr/**.h"),
path.join(BIMG_DIR, "3rdparty/iqa/include/**.h"),
path.join(BIMG_DIR, "3rdparty/iqa/source/**.c"),
path.join(BIMG_DIR, "tools/texturec/**.cpp"),
path.join(BIMG_DIR, "tools/texturec/**.h"),
}
links {
"bimg_decode",
"bimg_encode",
"bimg",
"bx",
}
configuration { "mingw-*" }
targetextension ".exe"
configuration { "osx" }
links {
"Cocoa.framework",
}
configuration { "vs20* or mingw*" }
links {
"psapi",
}
configuration {}