mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 19:03:07 +02:00
Adding the render library that will provide the base rendering engine and scene description
This commit is contained in:
parent
651c9bdf7a
commit
66894a8fda
5 changed files with 29 additions and 14 deletions
|
@ -115,7 +115,7 @@ target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS})
|
||||||
target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES})
|
target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES})
|
||||||
|
|
||||||
# link required hifi libraries
|
# link required hifi libraries
|
||||||
link_hifi_libraries(shared octree environment gpu model fbx metavoxels networking entities avatars
|
link_hifi_libraries(shared octree environment gpu model render fbx metavoxels networking entities avatars
|
||||||
audio audio-client animation script-engine physics
|
audio audio-client animation script-engine physics
|
||||||
render-utils entities-renderer)
|
render-utils entities-renderer)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
set(TARGET_NAME render-utils)
|
set(TARGET_NAME render-utils)
|
||||||
|
|
||||||
AUTOSCRIBE_SHADER_LIB(gpu model)
|
AUTOSCRIBE_SHADER_LIB(gpu model render)
|
||||||
|
|
||||||
# pull in the resources.qrc file
|
# pull in the resources.qrc file
|
||||||
qt5_add_resources(QT_RESOURCES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts/fonts.qrc")
|
qt5_add_resources(QT_RESOURCES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts/fonts.qrc")
|
||||||
|
@ -12,4 +12,4 @@ add_dependency_external_projects(glm)
|
||||||
find_package(GLM REQUIRED)
|
find_package(GLM REQUIRED)
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||||
|
|
||||||
link_hifi_libraries(animation fbx shared gpu)
|
link_hifi_libraries(animation fbx shared gpu model render)
|
12
libraries/render/CMakeLists.txt
Normal file
12
libraries/render/CMakeLists.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
set(TARGET_NAME render)
|
||||||
|
|
||||||
|
AUTOSCRIBE_SHADER_LIB(gpu model)
|
||||||
|
|
||||||
|
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||||
|
setup_hifi_library()
|
||||||
|
|
||||||
|
add_dependency_external_projects(glm)
|
||||||
|
find_package(GLM REQUIRED)
|
||||||
|
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
link_hifi_libraries(shared gpu model)
|
11
libraries/render-utils/src/render/Scene.cpp → libraries/render/src/render/Scene.cpp
Executable file → Normal file
11
libraries/render-utils/src/render/Scene.cpp → libraries/render/src/render/Scene.cpp
Executable file → Normal file
|
@ -13,13 +13,14 @@
|
||||||
using namespace render;
|
using namespace render;
|
||||||
|
|
||||||
|
|
||||||
Item::ID Scene::addItem(Item::PayloadPtr& payload) {
|
Item::ID Scene::addItem(ItemDataPointer& itemData) {
|
||||||
|
ID id = _items.size();
|
||||||
return 0;
|
_items.push_back(Item(itemData));
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeItem(ID id) {
|
void Scene::removeItem(ID id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void moveItem(ID id) {
|
void Scene::moveItem(ID id) {
|
||||||
}
|
}
|
14
libraries/render-utils/src/render/Scene.h → libraries/render/src/render/Scene.h
Executable file → Normal file
14
libraries/render-utils/src/render/Scene.h → libraries/render/src/render/Scene.h
Executable file → Normal file
|
@ -72,10 +72,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::shared_ptr<PayloadInterface> PayloadPtr;
|
typedef std::shared_ptr<PayloadInterface> PayloadPointer;
|
||||||
|
|
||||||
|
Item(PayloadPointer& payload):
|
||||||
Item(PayloadPtr& payload):
|
|
||||||
_payload(payload) {}
|
_payload(payload) {}
|
||||||
|
|
||||||
~Item() {}
|
~Item() {}
|
||||||
|
@ -105,12 +104,15 @@ public:
|
||||||
void render(Context& context) { _payload->render(context); }
|
void render(Context& context) { _payload->render(context); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PayloadPtr _payload;
|
PayloadPointer _payload;
|
||||||
State _state;
|
State _state;
|
||||||
|
|
||||||
friend class Scene;
|
friend class Scene;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef Item::PayloadInterface ItemData;
|
||||||
|
typedef Item::PayloadPointer ItemDataPointer;
|
||||||
|
|
||||||
class Scene {
|
class Scene {
|
||||||
public:
|
public:
|
||||||
typedef Item::Vector Items;
|
typedef Item::Vector Items;
|
||||||
|
@ -142,10 +144,10 @@ public:
|
||||||
~Scene() {}
|
~Scene() {}
|
||||||
|
|
||||||
|
|
||||||
ID addItem(Item::PayloadPtr& payload);
|
ID addItem(ItemDataPointer& itemData);
|
||||||
void removeItem(ID id);
|
void removeItem(ID id);
|
||||||
void moveItem(ID id);
|
void moveItem(ID id);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Items _items;
|
Items _items;
|
Loading…
Reference in a new issue