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"/>
|
||||
</widget>
|
||||
<addaction name="actionTextures"/>
|
||||
<addaction name="actionNormal_Maps"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuInterpolation"/>
|
||||
</widget>
|
||||
@ -293,6 +294,17 @@
|
||||
<string>Linear MipMap Linear</string>
|
||||
</property>
|
||||
</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>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
|
||||
@ -841,6 +841,11 @@ void Viewer::setMinLinear(bool on) {
|
||||
this->update();
|
||||
}
|
||||
|
||||
void Viewer::toggleNormalMaps(bool state) {
|
||||
m_program->bind();
|
||||
m_program->setUniformValue(m_useNormalMap, state);
|
||||
}
|
||||
|
||||
void Viewer::deleteSelected() {
|
||||
// Remove Shape from its parent
|
||||
if(selectedObj.shape == nullptr) return;
|
||||
|
||||
@ -63,6 +63,7 @@ public slots:
|
||||
void setMagLinear(bool);
|
||||
void setMinLinear(bool);
|
||||
void deleteSelected();
|
||||
void toggleNormalMaps(bool);
|
||||
|
||||
signals:
|
||||
int shapeSelected(int);
|
||||
|
||||
@ -46,6 +46,8 @@ void MainWindow::addViewer(Viewer* viewer)
|
||||
connect(ui->actionMagLinear, SIGNAL(toggled(bool)), viewer, SLOT(setMagLinear(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(viewer, SIGNAL(cubeSelected(bool)), ui->action_delete, SLOT(setEnabled(bool)));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user