Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android compatibility #7

Merged
merged 61 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
10afd6d
refactor: removed timeline semaphore
BykadorovR May 14, 2024
8a5c352
refactor: render passes
BykadorovR May 15, 2024
d3bde09
refactor: render pass for each render
BykadorovR May 16, 2024
524015f
refactor: render pass reworked + half of samples adopted
BykadorovR May 16, 2024
9d5e424
fix: completed samples
BykadorovR May 17, 2024
8c5a0a2
refactor: Core is facade now
BykadorovR May 18, 2024
352faef
refactor: removed robustness2
BykadorovR May 19, 2024
4c36b77
refactor: removed robustness2
BykadorovR May 19, 2024
802198e
refactor: shaders paths
BykadorovR May 19, 2024
08ceb16
Merge remote-tracking branch 'remotes/origin/android_compatibility' i…
BykadorovR May 19, 2024
310e7f3
fix: removed extensions
BykadorovR May 19, 2024
93f85a9
refactor: __ANDROID__ defines
BykadorovR May 20, 2024
0debc9f
fix: glfw as fetch content
BykadorovR May 20, 2024
5c04742
feat: added platform specific folder
BykadorovR May 20, 2024
960ddbf
fix: add_library twice
BykadorovR May 20, 2024
b425d6b
fix: vulkan wrapper name
BykadorovR May 20, 2024
c7b7131
fix: vulkan include in settings
BykadorovR May 20, 2024
1d0dc2b
fix: glfw define + terrain shader
BykadorovR May 20, 2024
35cc64c
feat: game activity for Android
BykadorovR May 20, 2024
e3bc07a
fix: Window put under define
BykadorovR May 20, 2024
d54f5dc
fix: glfw under android define
BykadorovR May 20, 2024
8ca784e
fix: updated glm
BykadorovR May 20, 2024
08f224b
fix: returned windows include
BykadorovR May 20, 2024
daf722f
fix: android vk surface in cmake
BykadorovR May 20, 2024
e1a68b4
fix: android val. layers
BykadorovR May 20, 2024
e26b751
fix: android log libraries
BykadorovR May 20, 2024
403168a
fix: removed impl of game activity
BykadorovR May 20, 2024
875194c
fix: include native_app_glue
BykadorovR May 20, 2024
6594499
fix: removed android log libs
BykadorovR May 20, 2024
13e4ada
fix: android compl. errors
BykadorovR May 20, 2024
038e4cd
fix: includes for android are back
BykadorovR May 20, 2024
d5631e9
fix: trying to include game activity
BykadorovR May 20, 2024
0bd06ef
fix: try another path
BykadorovR May 20, 2024
2b3f57a
fix: try via extern
BykadorovR May 20, 2024
9eaf67e
fix: reverted android poll
BykadorovR May 20, 2024
efcd6bc
refactor: window system
BykadorovR May 21, 2024
bc11498
fix: filename to error
BykadorovR May 21, 2024
94af558
fix: glfw window/state, cmake library linkage
BykadorovR May 21, 2024
01dfdf9
fix: void* instead of any
BykadorovR May 21, 2024
f556a54
fix: Android compilation
BykadorovR May 22, 2024
2ffd8b3
feat: refactored descriptors in Shape3D
BykadorovR May 25, 2024
b88926b
fix: specular coefficients buffer
BykadorovR May 25, 2024
90540d3
fix: clean shape3D code
BykadorovR May 25, 2024
76ee3b1
feat: shaders compile flag
BykadorovR May 25, 2024
0a350a1
fix: shape and line vertex structure
BykadorovR May 26, 2024
63b40f4
refactor: descriptors for models
BykadorovR May 26, 2024
f2c67fa
fix: animation small fixes
BykadorovR May 27, 2024
9f09d05
fix: animation index
BykadorovR May 29, 2024
a6863f1
fix: sample uncommented
BykadorovR May 29, 2024
bd29cd2
refactor: sprites
BykadorovR May 28, 2024
087a0b6
fix: camera speed setter
BykadorovR May 29, 2024
9bcdbb0
fix: added particles
BykadorovR May 30, 2024
691ad4c
feat: refactored terrain
BykadorovR May 30, 2024
30831c8
refactor: skybox, ibl and terrain
BykadorovR Jun 1, 2024
1af53ce
refactor: textures in materials can be changed dynamically
BykadorovR Jun 1, 2024
08ded3c
fix: cleaned descriptors
BykadorovR Jun 1, 2024
777c2f2
fix: sprite normals
BykadorovR Jun 1, 2024
1c1de2a
fix: directional light shadows + warnings
BykadorovR Jun 2, 2024
ecb2fc4
feat: android sample
BykadorovR Jun 2, 2024
ae1d3d7
feat: README
BykadorovR Jun 2, 2024
6d9e620
fix: FIFO on android, instead of MAILBOX
BykadorovR Jun 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 62 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,23 @@ endfunction()

set(CMAKE_CXX_STANDARD 20)

#need for mismatch resolving
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/libraries)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/libraries)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
if(MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
endif()
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
include(FetchContent)

ExternalProject_Add(
glfw
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 4afa227a056681d2628894b0893527bf69496a41
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DBUILD_SHARED_LIBS=ON -G "${CMAKE_GENERATOR}" ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/glfw/src/glfw
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/glfw/src/glfw/include ${CMAKE_BINARY_DIR}/include
)
if (NOT ANDROID)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Disable GLFW examples")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "Disable GLFW tests")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "Disable GLFW docs")
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 4afa227a056681d2628894b0893527bf69496a41
)
endif()


set(TINYGLTF_BUILD_LOADER_EXAMPLE OFF CACHE BOOL "Disable tinygltf loader example")
set(TINYGLTF_HEADER_ONLY ON CACHE BOOL "Build header only tinygltf")
Expand Down Expand Up @@ -69,7 +64,7 @@ FetchContent_Declare(
FetchContent_Declare(
glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG aa6a2757a5152bfa0db667380fa93c64d5999d63
GIT_TAG 45008b225e28eb700fa0f7d3ff69b7c1db94fadf
)

file(MAKE_DIRECTORY ${FETCHCONTENT_BASE_DIR}/imgui)
Expand Down Expand Up @@ -98,14 +93,21 @@ FetchContent_Declare(
GIT_TAG release-v3
)

FetchContent_MakeAvailable(glm imgui tinygltf thread-pool mikktspace nvtx)
if (NOT ANDROID)
FetchContent_MakeAvailable(glm imgui tinygltf thread-pool mikktspace nvtx glfw)
else()
FetchContent_MakeAvailable(glm imgui tinygltf thread-pool mikktspace nvtx)
endif()

#affects all projects, add folder "include" to include section in VS
include_directories("include/Graphic")
include_directories("include/Primitive")
include_directories("include/Utility")
include_directories("include/Engine")
include_directories("include/Vulkan")
if (ANDROID)
include_directories("include/Platform/Android")
endif()

file(GLOB_RECURSE app_source_graphic "src/Graphic/*.c*")
source_group("Graphic\\src" FILES ${app_source_graphic})
Expand All @@ -127,16 +129,38 @@ file(GLOB_RECURSE app_source_engine "src/Engine/*.c*")
source_group("Engine\\src" FILES ${app_source_engine})
file(GLOB_RECURSE app_header_engine "include/Engine/*.h*")
source_group("Engine\\include" FILES ${app_header_engine})
if (ANDROID)
file(GLOB_RECURSE app_header_platform "include/Platform/Android/*.h*")
source_group("Platform\\include" FILES ${app_header_platform})
file(GLOB_RECURSE app_source_platform "src/Platform/Android/*.c*")
source_group("Platform\\src" FILES ${app_source_platform})
endif()


###############################
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

#include headers to project (so they will be shown in include folder)
add_library(${PROJECT_NAME} SHARED ${app_header_graphic} ${app_source_graphic}
${app_header_primitive} ${app_source_primitive}
${app_header_utility} ${app_source_utility}
${app_header_vulkan} ${app_source_vulkan}
${app_header_engine} ${app_source_engine})
if (NOT ANDROID)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/libraries)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/libraries)
add_library(${PROJECT_NAME} SHARED ${app_header_graphic} ${app_source_graphic}
${app_header_primitive} ${app_source_primitive}
${app_header_utility} ${app_source_utility}
${app_header_vulkan} ${app_source_vulkan}
${app_header_engine} ${app_source_engine})
else()
add_library(${PROJECT_NAME} SHARED ${app_header_graphic} ${app_source_graphic}
${app_header_primitive} ${app_source_primitive}
${app_header_utility} ${app_source_utility}
${app_header_vulkan} ${app_source_vulkan}
${app_header_engine} ${app_source_engine}
${app_header_platform} ${app_source_platform})
endif()
###############################

#enable multiple cores compilation for VS
Expand All @@ -146,19 +170,22 @@ endif()

find_package(Vulkan REQUIRED)
target_include_directories(${PROJECT_NAME} PRIVATE ${Vulkan_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${Vulkan_LIBRARIES})

add_dependencies(${PROJECT_NAME} glfw)
target_link_libraries(${PROJECT_NAME} PRIVATE ${Vulkan_LIBRARIES})

file(COPY ${glm_SOURCE_DIR}/glm DESTINATION ${CMAKE_BINARY_DIR}/include)
file(COPY ${imgui_SOURCE_DIR}/imgui.h ${imgui_SOURCE_DIR}/imconfig.h DESTINATION ${CMAKE_BINARY_DIR}/include)
file(COPY ${tinygltf_SOURCE_DIR}/tiny_gltf.h ${tinygltf_SOURCE_DIR}/stb_image.h ${tinygltf_SOURCE_DIR}/stb_image_write.h ${tinygltf_SOURCE_DIR}/json.hpp DESTINATION ${CMAKE_BINARY_DIR}/include)
file(COPY ${thread-pool_SOURCE_DIR}/include/ DESTINATION ${CMAKE_BINARY_DIR}/include)
file(COPY ${mikktspace_SOURCE_DIR}/mikktspace.h DESTINATION ${CMAKE_BINARY_DIR}/include)
file(COPY ${nvtx_SOURCE_DIR}/c/include/ DESTINATION ${CMAKE_BINARY_DIR}/include)
if (NOT ANDROID)
file(COPY ${glfw_SOURCE_DIR}/include/ DESTINATION ${CMAKE_BINARY_DIR}/include)
endif()

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/include)
#link glfw libraries
target_link_libraries(${PROJECT_NAME} ${CMAKE_BINARY_DIR}/libraries/glfw3dll.lib)

target_link_libraries(${PROJECT_NAME} imgui mikktspace)
if (NOT ANDROID)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/include)
target_link_libraries(${PROJECT_NAME} PRIVATE glfw imgui mikktspace)
else()
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/include ${ANDROID_NDK}/sources/third_party/vulkan/src/include)
target_link_libraries(${PROJECT_NAME} PRIVATE android log imgui mikktspace)
endif()
24 changes: 16 additions & 8 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@
import sys


folder = "shaders"
compiler_path = sys.argv[1]
debug = True
input_path = sys.argv[1]
output_path = sys.argv[2]
if not os.path.exists(output_path):
os.makedirs(output_path)
compiler_path = sys.argv[3]
debug = int(sys.argv[4])

files = [os.path.join(dp, f) for dp, dn, fn in os.walk(os.path.expanduser(folder)) for f in fn]
files = [os.path.join(dp, f) for dp, dn, fn in os.walk(os.path.expanduser(input_path)) for f in fn]

for f in files:
file_name = os.path.splitext(f)[0]
sub_path = f.replace(input_path,"")
file = os.path.basename(sub_path)
folder_name = sub_path.replace(file, "")
if not os.path.exists(output_path + folder_name):
os.makedirs(output_path + folder_name)
file_name = folder_name + os.path.splitext(file)[0]
print(file_name)
extension = os.path.splitext(f)[1][1:]
extension = os.path.splitext(file)[1][1:]
extension_new = ""
if extension == "frag":
extension_new = "_fragment.spv"
Expand All @@ -29,9 +37,9 @@
else:
continue

debug_key = ""
debug_key = "-Os"
if debug:
debug_key = "-g"
command_line = f"{compiler_path} -c {debug_key} {f} -o {file_name}{extension_new}"
command_line = f"{compiler_path} -c {debug_key} {f} -o {output_path}{file_name}{extension_new}"
#print(command_line)
subprocess.call(command_line)
26 changes: 22 additions & 4 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
directory = 'Unpacked'

for source_dir in os.listdir(directory):
sourse_path = r'{}'.format(directory + "\\" + source_dir)
print('sourse_path = ' + str(sourse_path))
source_path = r'{}'.format(directory + "\\" + source_dir)
print('source_path = ' + str(source_path))

dir_in_lower_case = source_dir.lower()
print(dir_in_lower_case)
Expand All @@ -31,8 +31,26 @@

if os.path.isdir(target_dir):
shutil.rmtree(target_dir)
print('moving from '+ str(sourse_path) + ' to ' + str(target_dir))
os.rename(sourse_path, target_dir)
print('moving from '+ str(source_path) + ' to ' + str(target_dir))
os.rename(source_path, target_dir)

# Android uses the same resources as Scene sample
files_to_copy = ['assets/', 'samples/sprite/assets/', 'samples/IBL/assets/', 'samples/scene/assets/Terrain', 'samples/particles/assets', 'samples/scene/assets/Skybox']
def copytree(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
if not os.path.exists(d):
shutil.copytree(s, d, symlinks, ignore)
else:
shutil.copy2(s, d)

assets_folder = 'samples/android/app/src/main/assets'
if not os.path.exists(assets_folder):
os.makedirs(assets_folder)
for item in files_to_copy:
copytree(item, assets_folder)

os.remove("resources.zip")
os.rmdir("Unpacked")
88 changes: 65 additions & 23 deletions include/Engine/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,30 @@
#include "BS_thread_pool.hpp"
#include "ResourceManager.h"
#include "Animation.h"
#include "Render.h"
#include "Shape3D.h"
#include "Sprite.h"
#include "Line.h"
#include "Model.h"
#include "Equirectangular.h"
#include "IBL.h"

class Core {
private:
#ifdef __ANDROID__
AAssetManager* _assetManager;
ANativeWindow* _nativeWindow;
#endif
std::shared_ptr<State> _state;
std::shared_ptr<Swapchain> _swapchain;
std::shared_ptr<ImageView> _depthAttachmentImageView;
// for compute render pass isn't needed
std::shared_ptr<RenderPass> _renderPassLightDepth, _renderPassGraphic, _renderPassDebug;
std::vector<std::shared_ptr<Framebuffer>> _frameBufferGraphic, _frameBufferDebug;
// store for each light, number in flight frame buffers
std::vector<std::vector<std::shared_ptr<Framebuffer>>> _frameBufferDirectionalLightDepth;
std::vector<std::vector<std::vector<std::shared_ptr<Framebuffer>>>> _frameBufferPointLightDepth;

std::shared_ptr<ResourceManager> _resourceManager;
std::shared_ptr<CommandPool> _commandPoolRender, _commandPoolTransfer, _commandPoolParticleSystem,
_commandPoolEquirectangular, _commandPoolPostprocessing, _commandPoolGUI;
Expand All @@ -35,11 +54,11 @@ class Core {
std::shared_ptr<LoggerCPU> _loggerCPU;

std::vector<std::shared_ptr<Semaphore>> _semaphoreImageAvailable, _semaphoreRenderFinished;
std::vector<std::shared_ptr<Semaphore>> _semaphoreParticleSystem, _semaphoreGUI;
std::vector<std::shared_ptr<Fence>> _fenceInFlight, _fenceParticleSystem;
std::vector<std::shared_ptr<Semaphore>> _semaphoreParticleSystem, _semaphorePostprocessing, _semaphoreGUI;
std::vector<std::shared_ptr<Fence>> _fenceInFlight;

std::vector<std::shared_ptr<Texture>> _textureRender, _textureBlurIn, _textureBlurOut;

std::set<std::shared_ptr<Material>> _materials;
std::shared_ptr<GUI> _gui;
std::shared_ptr<Camera> _camera;

Expand All @@ -62,17 +81,9 @@ class Core {
std::function<void()> _callbackUpdate;
std::function<void(int width, int height)> _callbackReset;

std::vector<std::vector<VkSubmitInfo>> _frameSubmitInfoGraphic, _frameSubmitInfoCompute;
std::mutex _frameSubmitMutexGraphic, _frameSubmitMutexCompute;

// we use timeline semaphore here, because we want to submit compute queue before graphic
// but postprocessing depends on object render loop. Timeline semaphore allows to submit queue
// even if dependencies haven't been submitted yet
struct TimelineSemaphore {
std::vector<VkTimelineSemaphoreSubmitInfo> timelineInfo;
std::vector<uint64_t> particleSignal;
std::vector<std::shared_ptr<Semaphore>> semaphore;
} _graphicTimelineSemaphore;
std::vector<std::vector<VkSubmitInfo>> _frameSubmitInfoPreCompute, _frameSubmitInfoPostCompute,
_frameSubmitInfoGraphic, _frameSubmitInfoDebug;
std::mutex _frameSubmitMutexGraphic;

void _directionalLightCalculator(int index);
void _pointLightCalculator(int index, int face);
Expand All @@ -89,25 +100,56 @@ class Core {

public:
Core(std::shared_ptr<Settings> settings);
#ifdef __ANDROID__
void setAssetManager(AAssetManager* assetManager);
void setNativeWindow(ANativeWindow* window);
#endif
void initialize();
void draw();
void registerUpdate(std::function<void()> update);
void registerReset(std::function<void(int width, int height)> reset);

void startRecording();
void endRecording();
void setCamera(std::shared_ptr<Camera> camera);
void addDrawable(std::shared_ptr<Drawable> drawable, AlphaType type = AlphaType::TRANSPARENT);
void addShadowable(std::shared_ptr<Shadowable> shadowable);
void addSkybox(std::shared_ptr<Skybox> skybox);
void addAnimation(std::shared_ptr<Animation> animation);

const std::vector<std::shared_ptr<Drawable>>& getDrawables(AlphaType type);
void removeDrawable(std::shared_ptr<Drawable> drawable);
// TODO: everything should be drawable
void addSkybox(std::shared_ptr<Skybox> skybox);
void addParticleSystem(std::shared_ptr<ParticleSystem> particleSystem);
void removeDrawable(std::shared_ptr<Drawable> drawable);

std::tuple<std::shared_ptr<uint8_t[]>, std::tuple<int, int, int>> loadImageCPU(std::string path);
std::shared_ptr<BufferImage> loadImageGPU(std::string path);
std::shared_ptr<Texture> createTexture(std::string name, VkFormat format, int mipMapLevels);
std::shared_ptr<Cubemap> createCubemap(std::vector<std::string> paths, VkFormat format, int mipMapLevels);
std::shared_ptr<ModelGLTF> createModelGLTF(std::string path);
std::shared_ptr<Animation> createAnimation(std::shared_ptr<ModelGLTF> modelGLTF);
std::shared_ptr<Equirectangular> createEquirectangular(std::string path);
std::shared_ptr<MaterialColor> createMaterialColor(MaterialTarget target);
std::shared_ptr<MaterialPhong> createMaterialPhong(MaterialTarget target);
std::shared_ptr<MaterialPBR> createMaterialPBR(MaterialTarget target);
std::shared_ptr<Shape3D> createShape3D(ShapeType shapeType, VkCullModeFlagBits cullMode = VK_CULL_MODE_BACK_BIT);
std::shared_ptr<Model3D> createModel3D(std::shared_ptr<ModelGLTF> modelGLTF);
std::shared_ptr<Sprite> createSprite();
std::shared_ptr<Terrain> createTerrain(std::string heightmap, std::pair<int, int> patches);
std::shared_ptr<Line> createLine();
std::shared_ptr<IBL> createIBL();
std::shared_ptr<ParticleSystem> createParticleSystem(std::vector<Particle> particles,
std::shared_ptr<Texture> particleTexture);
std::shared_ptr<Skybox> createSkybox();
std::shared_ptr<PointLight> createPointLight(std::tuple<int, int> resolution);
std::shared_ptr<DirectionalLight> createDirectionalLight(std::tuple<int, int> resolution);
std::shared_ptr<AmbientLight> createAmbientLight();

std::shared_ptr<CommandBuffer> getCommandBufferTransfer();
std::shared_ptr<LightManager> getLightManager();
std::shared_ptr<ResourceManager> getResourceManager();
const std::vector<std::shared_ptr<Drawable>>& getDrawables(AlphaType type);
std::vector<std::shared_ptr<PointLight>> getPointLights();
std::vector<std::shared_ptr<DirectionalLight>> getDirectionalLights();
std::shared_ptr<Postprocessing> getPostprocessing();
std::shared_ptr<Blur> getBlur();
std::shared_ptr<State> getState();
std::shared_ptr<GUI> getGUI();
std::tuple<int, int> getFPS();
void draw();
void registerUpdate(std::function<void()> update);
void registerReset(std::function<void(int width, int height)> reset);
};
Loading
Loading