@@ -59,17 +59,10 @@ void koregui::FrameBufferEditor::addNewFramebuffer(void) {
59
59
60
60
void koregui::FrameBufferEditor::addNewAttachment (void ) {
61
61
if (!_currentbuffer) return ;
62
- ui.tableWidget ->setRowCount (ui.tableWidget ->rowCount () + 1 );
62
+ /* ui.tableWidget->setRowCount(ui.tableWidget->rowCount() + 1);
63
63
// Attachments
64
64
QComboBox* combo = new QComboBox();
65
- combo->addItem (" GL_COLOR_ATTACHMENT0" , QVariant (GL_COLOR_ATTACHMENT0));
66
- combo->addItem (" GL_COLOR_ATTACHMENT1" , QVariant (GL_COLOR_ATTACHMENT1));
67
- combo->addItem (" GL_COLOR_ATTACHMENT2" , QVariant (GL_COLOR_ATTACHMENT2));
68
- combo->addItem (" GL_COLOR_ATTACHMENT3" , QVariant (GL_COLOR_ATTACHMENT3));
69
- combo->addItem (" GL_COLOR_ATTACHMENT4" , QVariant (GL_COLOR_ATTACHMENT4));
70
- combo->addItem (" GL_COLOR_ATTACHMENT5" , QVariant (GL_COLOR_ATTACHMENT5));
71
- combo->addItem (" GL_COLOR_ATTACHMENT6" , QVariant (GL_COLOR_ATTACHMENT6));
72
- combo->addItem (" GL_COLOR_ATTACHMENT7" , QVariant (GL_COLOR_ATTACHMENT7));
65
+ combo->addItem("GL_COLOR_ATTACHMENT", QVariant(GL_COLOR_ATTACHMENT0));
73
66
combo->addItem("GL_DEPTH_ATTACHMENT", QVariant(GL_DEPTH_ATTACHMENT));
74
67
combo->addItem("GL_STENCIL_ATTACHMENT", QVariant(GL_STENCIL_ATTACHMENT));
75
68
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 0, combo);
@@ -78,15 +71,19 @@ void koregui::FrameBufferEditor::addNewAttachment(void) {
78
71
combo = new QComboBox();
79
72
combo->addItem("GL_FLOAT", QVariant(GL_FLOAT));
80
73
combo->addItem("GL_UNSIGNED_BYTE", QVariant(GL_UNSIGNED_BYTE));
74
+ ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 1, combo);
81
75
82
76
// Format
83
77
combo = new QComboBox();
84
78
combo->addItem("GL_RGBA", QVariant(GL_RGBA));
79
+ ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 2, combo);
85
80
86
81
// Internal format
87
82
combo = new QComboBox();
88
83
combo->addItem("GL_RGBA8", QVariant(GL_RGBA8));
89
84
combo->addItem("GL_FLOAT", QVariant(GL_FLOAT));
85
+ combo->addItem("GL_DEPTH24_STENCIL8", QVariant(GL_DEPTH24_STENCIL8));
86
+ ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 3, combo);*/
90
87
91
88
/* STextureProperties()
92
89
: width(0),
@@ -107,20 +104,34 @@ void koregui::FrameBufferEditor::addNewAttachment(void) {
107
104
108
105
/// The Internal format (e.g. GL_RGBA8, GL_FLOAT32,...).
109
106
GLuint internalFormat;*/
107
+
108
+ kore::STextureProperties props;
109
+ props.border = 0 ;
110
+ props.targetType = GL_TEXTURE_2D;
111
+ props.width = 512 ;
112
+ props.height = 512 ;
113
+ props.format = GL_RGBA;
114
+ props.internalFormat = GL_RGBA8;
115
+ props.pixelType = GL_UNSIGNED_BYTE;
116
+ if (_currentbuffer) {
117
+ _currentbuffer->addTextureAttachment (props, " newAttachTex" , GL_COLOR_ATTACHMENT0);
118
+ }
110
119
}
111
120
112
121
void koregui::FrameBufferEditor::applySettings (void ) {
113
122
if (!_currentbuffer) return ;
114
- for (int i = 0 ; i < ui.tableWidget ->rowCount (); i++) {
123
+ /* for(int i = 0; i < ui.tableWidget->rowCount(); i++) {
115
124
kore::STextureProperties props;
116
125
props.pixelType = ui.tableWidget->item(i,0)->data(Qt::UserRole).toUInt();
117
126
props.format = ui.tableWidget->item(i,1)->data(Qt::UserRole).toUInt();
118
- }
127
+ }*/
128
+ refresh ();
119
129
}
120
130
121
131
void koregui::FrameBufferEditor::refresh (void ) {
122
132
if (_currentbuffer) ui.nameEdit ->setText (_currentbuffer->getName ().c_str ());
123
133
ui.tableWidget ->clearContents ();
134
+ // _currentbuffer->
124
135
}
125
136
126
137
void koregui::FrameBufferEditor::framebufferChanged (int index) {
0 commit comments