Adding the render library that will provide the base rendering engine and scene description

This commit is contained in:
Sam Gateau 2015-03-03 14:55:26 -08:00
parent 651c9bdf7a
commit 66894a8fda
5 changed files with 29 additions and 14 deletions

View file

@ -115,7 +115,7 @@ target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME} ${BULLET_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
render-utils entities-renderer)

View file

@ -1,6 +1,6 @@
set(TARGET_NAME render-utils)
AUTOSCRIBE_SHADER_LIB(gpu model)
AUTOSCRIBE_SHADER_LIB(gpu model render)
# pull in the resources.qrc file
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)
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)

View 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)

View file

@ -13,13 +13,14 @@
using namespace render;
Item::ID Scene::addItem(Item::PayloadPtr& payload) {
return 0;
Item::ID Scene::addItem(ItemDataPointer& itemData) {
ID id = _items.size();
_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) {
}

View file

@ -72,10 +72,9 @@ public:
protected:
};
typedef std::shared_ptr<PayloadInterface> PayloadPtr;
typedef std::shared_ptr<PayloadInterface> PayloadPointer;
Item(PayloadPtr& payload):
Item(PayloadPointer& payload):
_payload(payload) {}
~Item() {}
@ -105,12 +104,15 @@ public:
void render(Context& context) { _payload->render(context); }
protected:
PayloadPtr _payload;
PayloadPointer _payload;
State _state;
friend class Scene;
};
typedef Item::PayloadInterface ItemData;
typedef Item::PayloadPointer ItemDataPointer;
class Scene {
public:
typedef Item::Vector Items;
@ -142,10 +144,10 @@ public:
~Scene() {}
ID addItem(Item::PayloadPtr& payload);
ID addItem(ItemDataPointer& itemData);
void removeItem(ID id);
void moveItem(ID id);
protected:
Items _items;