1 #include "vogleditor_statetreebufferitem.h"
2 #include "vogl_buffer_state.h"
4 vogleditor_stateTreeBufferItem::vogleditor_stateTreeBufferItem(QString name, QString value, vogleditor_stateTreeItem* parent, const vogl_buffer_state* pState)
5 : vogleditor_stateTreeItem(name, value, parent),
9 int iVals[4] = {0,0,0,0};
10 #define GET_INT(name, num) if (pState->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecIntItem* pItem = new vogleditor_stateTreeStateVecIntItem(#name, name, 0, pState->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
11 #define GET_ENUM(name, num) if (pState->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecEnumItem* pItem = new vogleditor_stateTreeStateVecEnumItem(#name, name, 0, pState->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
12 #define GET_BOOL(name, num) if (pState->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecBoolItem* pItem = new vogleditor_stateTreeStateVecBoolItem(#name, name, 0, pState->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
13 #define GET_PTR(name, num) if (pState->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecPtrItem* pItem = new vogleditor_stateTreeStateVecPtrItem(#name, name, 0, pState->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
14 GET_ENUM(GL_BUFFER_ACCESS, 1);
15 GET_BOOL(GL_BUFFER_MAPPED, 1);
16 GET_INT(GL_BUFFER_SIZE, 1);
17 GET_ENUM(GL_BUFFER_USAGE, 1);
18 GET_PTR(GL_BUFFER_MAP_POINTER, 1);
26 void vogleditor_stateTreeBufferItem::set_diff_base_state(const vogl_buffer_state* pBaseState)
28 m_pDiffBaseState = pBaseState;
30 for (vogleditor_stateTreeStateVecDiffableItem* const* iter = m_diffableItems.begin(); iter != m_diffableItems.end(); iter++)
32 (*iter)->set_diff_base_state(&(pBaseState->get_params()));