mirror of
https://github.com/ConjureETS/LOG750-LAB2.git
synced 2026-03-24 03:21:19 +00:00
Normal Map Toggle
This commit is contained in:
parent
f9f86d3700
commit
e3b690b42d
@ -181,6 +181,7 @@
|
|||||||
<addaction name="actionGouraud"/>
|
<addaction name="actionGouraud"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="actionTextures"/>
|
<addaction name="actionTextures"/>
|
||||||
|
<addaction name="actionNormal_Maps"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="menuInterpolation"/>
|
<addaction name="menuInterpolation"/>
|
||||||
</widget>
|
</widget>
|
||||||
@ -293,6 +294,17 @@
|
|||||||
<string>Linear MipMap Linear</string>
|
<string>Linear MipMap Linear</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionNormal_Maps">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Normal Maps</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
@ -841,6 +841,11 @@ void Viewer::setMinLinear(bool on) {
|
|||||||
this->update();
|
this->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Viewer::toggleNormalMaps(bool state) {
|
||||||
|
m_program->bind();
|
||||||
|
m_program->setUniformValue(m_useNormalMap, state);
|
||||||
|
}
|
||||||
|
|
||||||
void Viewer::deleteSelected() {
|
void Viewer::deleteSelected() {
|
||||||
// Remove Shape from its parent
|
// Remove Shape from its parent
|
||||||
if(selectedObj.shape == nullptr) return;
|
if(selectedObj.shape == nullptr) return;
|
||||||
|
|||||||
@ -63,6 +63,7 @@ public slots:
|
|||||||
void setMagLinear(bool);
|
void setMagLinear(bool);
|
||||||
void setMinLinear(bool);
|
void setMinLinear(bool);
|
||||||
void deleteSelected();
|
void deleteSelected();
|
||||||
|
void toggleNormalMaps(bool);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
int shapeSelected(int);
|
int shapeSelected(int);
|
||||||
|
|||||||
@ -46,6 +46,8 @@ void MainWindow::addViewer(Viewer* viewer)
|
|||||||
connect(ui->actionMagLinear, SIGNAL(toggled(bool)), viewer, SLOT(setMagLinear(bool)));
|
connect(ui->actionMagLinear, SIGNAL(toggled(bool)), viewer, SLOT(setMagLinear(bool)));
|
||||||
connect(ui->actionMinLin, SIGNAL(toggled(bool)), viewer, SLOT(setMinLinear(bool)));
|
connect(ui->actionMinLin, SIGNAL(toggled(bool)), viewer, SLOT(setMinLinear(bool)));
|
||||||
|
|
||||||
|
connect(ui->actionNormal_Maps, SIGNAL(toggled(bool)), viewer, SLOT(toggleNormalMaps(bool)));
|
||||||
|
|
||||||
connect(ui->action_delete, SIGNAL(clicked(bool)), viewer, SLOT(deleteSelected()));
|
connect(ui->action_delete, SIGNAL(clicked(bool)), viewer, SLOT(deleteSelected()));
|
||||||
connect(viewer, SIGNAL(cubeSelected(bool)), ui->action_delete, SLOT(setEnabled(bool)));
|
connect(viewer, SIGNAL(cubeSelected(bool)), ui->action_delete, SLOT(setEnabled(bool)));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user