Skip to content

Commit 4a1d94a

Browse files
author
Dominik Ospelt
committed
various bugfixes in GUI
1 parent c7db9b5 commit 4a1d94a

9 files changed

+241
-90
lines changed

GuiApplication.vcxproj.filters

+2-16
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@
6767
<Filter>GeneratedFiles</Filter>
6868
</ClCompile>
6969
<ClCompile Include="src\KoRE_GUI\TextureEditor.cpp" />
70-
<ClCompile Include="src\KoRE_GUI\FlowItem.cpp">
71-
<Filter>Source Dateien</Filter>
72-
</ClCompile>
70+
<ClCompile Include="src\KoRE_GUI\FlowItem.cpp" />
7371
</ItemGroup>
7472
<ItemGroup>
7573
<ClInclude Include="src\KoRE_GUI\ComponentItem.h" />
@@ -90,9 +88,7 @@
9088
<ClInclude Include="src\KoRE_GUI\GeneratedFiles\ui_TextureEditor.h">
9189
<Filter>GeneratedFiles</Filter>
9290
</ClInclude>
93-
<ClInclude Include="src\KoRE_GUI\FlowItem.h">
94-
<Filter>Header Dateien</Filter>
95-
</ClInclude>
91+
<ClInclude Include="src\KoRE_GUI\FlowItem.h" />
9692
</ItemGroup>
9793
<ItemGroup>
9894
<CustomBuild Include="src\KoRE_GUI\FrameBufferEditor.h" />
@@ -115,15 +111,5 @@
115111
<Filter Include="GeneratedFiles">
116112
<UniqueIdentifier>{c25fc98e-e0ef-430f-81aa-b7932db20124}</UniqueIdentifier>
117113
</Filter>
118-
<Filter Include="Header Dateien">
119-
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
120-
<Extensions>h</Extensions>
121-
<ParseFiles>true</ParseFiles>
122-
</Filter>
123-
<Filter Include="Source Dateien">
124-
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
125-
<Extensions>cpp;cxx;c;def</Extensions>
126-
<ParseFiles>true</ParseFiles>
127-
</Filter>
128114
</ItemGroup>
129115
</Project>

assets/meshes/FullscreenTriangle.dae

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
3+
<asset>
4+
<contributor>
5+
<author>Blender User</author>
6+
<authoring_tool>Blender 2.66.1 r55078</authoring_tool>
7+
</contributor>
8+
<created>2013-05-19T18:19:26</created>
9+
<modified>2013-05-19T18:19:26</modified>
10+
<unit name="meter" meter="1"/>
11+
<up_axis>Z_UP</up_axis>
12+
</asset>
13+
<library_images/>
14+
<library_geometries>
15+
<geometry id="Triangle-mesh" name="Triangle">
16+
<mesh>
17+
<source id="Triangle-mesh-positions">
18+
<float_array id="Triangle-mesh-positions-array" count="9">3 -1 0 -1 -1 0 -1 3 0</float_array>
19+
<technique_common>
20+
<accessor source="#Triangle-mesh-positions-array" count="3" stride="3">
21+
<param name="X" type="float"/>
22+
<param name="Y" type="float"/>
23+
<param name="Z" type="float"/>
24+
</accessor>
25+
</technique_common>
26+
</source>
27+
<source id="Triangle-mesh-normals">
28+
<float_array id="Triangle-mesh-normals-array" count="3">0 0 -1</float_array>
29+
<technique_common>
30+
<accessor source="#Triangle-mesh-normals-array" count="1" stride="3">
31+
<param name="X" type="float"/>
32+
<param name="Y" type="float"/>
33+
<param name="Z" type="float"/>
34+
</accessor>
35+
</technique_common>
36+
</source>
37+
<source id="Triangle-mesh-map-0">
38+
<float_array id="Triangle-mesh-map-0-array" count="6">0 2 2 0 0 0</float_array>
39+
<technique_common>
40+
<accessor source="#Triangle-mesh-map-0-array" count="3" stride="2">
41+
<param name="S" type="float"/>
42+
<param name="T" type="float"/>
43+
</accessor>
44+
</technique_common>
45+
</source>
46+
<vertices id="Triangle-mesh-vertices">
47+
<input semantic="POSITION" source="#Triangle-mesh-positions"/>
48+
</vertices>
49+
<polylist count="1">
50+
<input semantic="VERTEX" source="#Triangle-mesh-vertices" offset="0"/>
51+
<input semantic="NORMAL" source="#Triangle-mesh-normals" offset="1"/>
52+
<input semantic="TEXCOORD" source="#Triangle-mesh-map-0" offset="2" set="0"/>
53+
<vcount>3 </vcount>
54+
<p>2 0 0 0 0 1 1 0 2</p>
55+
</polylist>
56+
</mesh>
57+
<extra><technique profile="MAYA"><double_sided>1</double_sided></technique></extra>
58+
</geometry>
59+
</library_geometries>
60+
<library_controllers/>
61+
<library_visual_scenes>
62+
<visual_scene id="Scene" name="Scene">
63+
<node id="Triangle" name="Triangle" type="NODE">
64+
<matrix sid="transform">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
65+
<instance_geometry url="#Triangle-mesh"/>
66+
</node>
67+
</visual_scene>
68+
</library_visual_scenes>
69+
<scene>
70+
<instance_visual_scene url="#Scene"/>
71+
</scene>
72+
</COLLADA>

src/KoRE/FrameBuffer.h

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ namespace kore {
8888
std::string _name;
8989
std::vector<ShaderData> _textureOutputs;
9090
std::vector<const Texture*> _textures;
91+
std::map<uint, Texture*> _attachments;
9192
std::vector<STextureInfo*> _textureInfos;
9293
GLuint _handle;
9394
std::vector<GLenum> _activeBuffers;

src/KoRE_GUI/FlowItem.cpp

+16-8
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ koregui::FlowItem::FlowItem(EFlowType flowType, QGraphicsItem* parent)
3232
_programpass(NULL),
3333
_nodepass(NULL),
3434
_op(NULL),
35-
_itemheight(30),
36-
_itemwidth(50),
35+
_itemheight(35),
36+
_itemwidth(150),
3737
QGraphicsItem(parent){
3838

3939
}
4040

4141
koregui::FlowItem::~FlowItem(void) {
42-
42+
kore::Log::getInstance()->write("Deleted Flow Item\n");
4343
}
4444

4545
void koregui::FlowItem::refresh(void) {
4646

4747
}
4848

4949
QRectF koregui::FlowItem::boundingRect() const {
50-
return QRectF(0,0,100,100);
50+
return QRectF(0,0,150,35);
5151
}
5252

5353
void koregui::FlowItem::paint(QPainter* painter,
@@ -76,11 +76,19 @@ void koregui::FlowItem::paint(QPainter* painter,
7676
break;
7777
case FLOW_PROGRAMPASS:
7878
b.setColor(QColor(252,210,89));
79-
//t.setText(_programpass->getShaderProgram()->getName().c_str());
79+
if(_programpass->getShaderProgram()) {
80+
t.setText(_programpass->getShaderProgram()->getName().c_str());
81+
} else {
82+
t.setText("<empty>");
83+
}
8084
break;
8185
case FLOW_NODEPASS:
8286
b.setColor(QColor(35,203,173));
83-
//t.setText(_nodepass->getSceneNode()->getName().c_str());
87+
if(_nodepass->getSceneNode()) {
88+
t.setText(_nodepass->getSceneNode()->getName().c_str());
89+
} else {
90+
t.setText("<empty>");
91+
}
8492
break;
8593
case FLOW_OPERATION:
8694
b.setColor(QColor(250,123,28));
@@ -91,12 +99,12 @@ void koregui::FlowItem::paint(QPainter* painter,
9199
t.setText("UNKNOWN");
92100
}
93101
painter->setBrush(b);
94-
painter->drawRect(0,0,100,100);
102+
painter->drawRect(0,0,150,35);
95103

96104
// text
97105
p.setColor(QColor(33,33,33));
98106
p.setStyle(Qt::PenStyle::SolidLine);
99107
p.setWidth(2);
100108
painter->setPen(p);
101-
painter->drawStaticText(0, 0, t);
109+
painter->drawStaticText(10, 10, t);
102110
}

src/KoRE_GUI/FrameBufferEditor.cpp

+22-11
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,10 @@ void koregui::FrameBufferEditor::addNewFramebuffer(void) {
5959

6060
void koregui::FrameBufferEditor::addNewAttachment(void) {
6161
if(!_currentbuffer) return;
62-
ui.tableWidget->setRowCount(ui.tableWidget->rowCount() + 1);
62+
/*ui.tableWidget->setRowCount(ui.tableWidget->rowCount() + 1);
6363
// Attachments
6464
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));
7366
combo->addItem("GL_DEPTH_ATTACHMENT", QVariant(GL_DEPTH_ATTACHMENT));
7467
combo->addItem("GL_STENCIL_ATTACHMENT", QVariant(GL_STENCIL_ATTACHMENT));
7568
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 0, combo);
@@ -78,15 +71,19 @@ void koregui::FrameBufferEditor::addNewAttachment(void) {
7871
combo = new QComboBox();
7972
combo->addItem("GL_FLOAT", QVariant(GL_FLOAT));
8073
combo->addItem("GL_UNSIGNED_BYTE", QVariant(GL_UNSIGNED_BYTE));
74+
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 1, combo);
8175
8276
// Format
8377
combo = new QComboBox();
8478
combo->addItem("GL_RGBA", QVariant(GL_RGBA));
79+
ui.tableWidget->setCellWidget(ui.tableWidget->rowCount() -1, 2, combo);
8580
8681
// Internal format
8782
combo = new QComboBox();
8883
combo->addItem("GL_RGBA8", QVariant(GL_RGBA8));
8984
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);*/
9087

9188
/*STextureProperties()
9289
: width(0),
@@ -107,20 +104,34 @@ void koregui::FrameBufferEditor::addNewAttachment(void) {
107104
108105
/// The Internal format (e.g. GL_RGBA8, GL_FLOAT32,...).
109106
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+
}
110119
}
111120

112121
void koregui::FrameBufferEditor::applySettings(void) {
113122
if(!_currentbuffer) return;
114-
for(int i = 0; i < ui.tableWidget->rowCount(); i++) {
123+
/*for(int i = 0; i < ui.tableWidget->rowCount(); i++) {
115124
kore::STextureProperties props;
116125
props.pixelType = ui.tableWidget->item(i,0)->data(Qt::UserRole).toUInt();
117126
props.format = ui.tableWidget->item(i,1)->data(Qt::UserRole).toUInt();
118-
}
127+
}*/
128+
refresh();
119129
}
120130

121131
void koregui::FrameBufferEditor::refresh(void) {
122132
if(_currentbuffer) ui.nameEdit->setText(_currentbuffer->getName().c_str());
123133
ui.tableWidget->clearContents();
134+
//_currentbuffer->
124135
}
125136

126137
void koregui::FrameBufferEditor::framebufferChanged(int index) {

0 commit comments

Comments
 (0)