1 #include "vogleditor_statetreerenderbufferitem.h"
3 #include "vogl_renderbuffer_state.h"
5 vogleditor_stateTreeRenderbufferIntItem::vogleditor_stateTreeRenderbufferIntItem(QString name, GLenum enumName, vogleditor_stateTreeItem* parent, const vogl_renderbuffer_state& state)
6 : vogleditor_stateTreeRenderbufferDiffableItem(name, "", parent),
11 if (m_pState->get_desc().get_int(m_enum, &val))
17 bool vogleditor_stateTreeRenderbufferIntItem::hasChanged() const
19 if (m_pDiffBaseState == NULL)
25 if (m_pState->get_desc().get_int(m_enum, &curVal) == false)
30 if (m_pDiffBaseState->get_desc().get_int(m_enum, &baseVal) == false)
35 return (curVal != baseVal);
38 QString vogleditor_stateTreeRenderbufferIntItem::getDiffedValue() const
40 if (m_pDiffBaseState == NULL)
44 if (m_pDiffBaseState->get_desc().get_int(m_enum, &baseVal) == false)
46 return "non-existent";
49 return getValueFromInts(&baseVal, 1);
52 //=============================================================================
54 vogleditor_stateTreeRenderbufferEnumItem::vogleditor_stateTreeRenderbufferEnumItem(QString name, GLenum enumName, vogleditor_stateTreeItem* parent, const vogl_renderbuffer_state& state)
55 : vogleditor_stateTreeRenderbufferDiffableItem(name, "", parent),
60 if (m_pState->get_desc().get_int(m_enum, &val))
62 setValue(enum_to_string(val));
66 bool vogleditor_stateTreeRenderbufferEnumItem::hasChanged() const
68 if (m_pDiffBaseState == NULL)
74 if (m_pState->get_desc().get_int(m_enum, &curVal) == false)
79 if (m_pDiffBaseState->get_desc().get_int(m_enum, &baseVal) == false)
84 return (curVal != baseVal);
87 QString vogleditor_stateTreeRenderbufferEnumItem::getDiffedValue() const
89 if (m_pDiffBaseState == NULL)
93 if (m_pDiffBaseState->get_desc().get_int(m_enum, &baseVal) == false)
95 return "non-existent";
98 return getValueFromEnums(&baseVal, 1);
101 //=============================================================================
103 vogleditor_stateTreeRenderbufferItem::vogleditor_stateTreeRenderbufferItem(QString name, GLuint64 handle, vogleditor_stateTreeItem* parent, const vogl_renderbuffer_state& state)
104 : vogleditor_stateTreeItem(name, "", parent),
107 m_pDiffBaseState(NULL)
109 const vogl_renderbuffer_desc& rDesc = m_pState->get_desc();
111 #define GET_INT(name) if (rDesc.get_int(name, &val, 1)) { vogleditor_stateTreeRenderbufferIntItem* pItem = new vogleditor_stateTreeRenderbufferIntItem(#name, name, this, state); this->appendChild(pItem); m_diffableItems.push_back(pItem); }
112 #define GET_ENUM(name) if (rDesc.get_int(name, &val, 1)) { vogleditor_stateTreeRenderbufferEnumItem* pItem = new vogleditor_stateTreeRenderbufferEnumItem(#name, name, this, state); this->appendChild(pItem); m_diffableItems.push_back(pItem); }
113 GET_INT(GL_RENDERBUFFER_WIDTH);
114 GET_INT(GL_RENDERBUFFER_HEIGHT);
115 GET_INT(GL_RENDERBUFFER_SAMPLES);
116 GET_ENUM(GL_RENDERBUFFER_INTERNAL_FORMAT);
117 GET_INT(GL_RENDERBUFFER_RED_SIZE);
118 GET_INT(GL_RENDERBUFFER_GREEN_SIZE);
119 GET_INT(GL_RENDERBUFFER_BLUE_SIZE);
120 GET_INT(GL_RENDERBUFFER_ALPHA_SIZE);
121 GET_INT(GL_RENDERBUFFER_DEPTH_SIZE);
122 GET_INT(GL_RENDERBUFFER_STENCIL_SIZE);
126 // { vogleditor_stateTreeContextInfoUIntItem* pItem = new vogleditor_stateTreeContextInfoUIntItem("GL_MAX_PROGRAM_ENV_PARAMETERS_ARB GL_VERTEX_PROGRAM_ARB", &vogl_context_info::get_max_arb_vertex_program_env_params, this, info); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
127 // { vogleditor_stateTreeContextInfoUIntItem* pItem = new vogleditor_stateTreeContextInfoUIntItem("GL_MAX_PROGRAM_ENV_PARAMETERS_ARB GL_FRAGMENT_PROGRAM_ARB", &vogl_context_info::get_max_arb_fragment_program_env_params, this, info); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
128 // { vogleditor_stateTreeContextInfoUIntItem* pItem = new vogleditor_stateTreeContextInfoUIntItem("GL_MAX_PROGRAM_MATRICES_ARB", &vogl_context_info::get_max_arb_program_matrices, this, info); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
129 // { vogleditor_stateTreeContextInfoUIntItem* pItem = new vogleditor_stateTreeContextInfoUIntItem("GL_MAX_COMBINED_TEXTURE_COORDS", &vogl_context_info::get_max_combined_texture_coords, this, info); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
130 // { vogleditor_stateTreeContextInfoUIntItem* pItem = new vogleditor_stateTreeContextInfoUIntItem("GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", &vogl_context_info::get_max_transform_feedback_separate_attribs, this, info); m_diffableItems.push_back(pItem); this->appendChild(pItem); }