mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
iOS fixes.
This commit is contained in:
parent
db1bccfee0
commit
33f33af0aa
4 changed files with 21 additions and 3 deletions
|
@ -365,6 +365,7 @@ void lcContext::SetDefaultState()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef LC_OPENGLES
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
@ -374,6 +375,7 @@ void lcContext::SetDefaultState()
|
|||
glNormalPointer(GL_BYTE, 0, nullptr);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, nullptr);
|
||||
glColorPointer(4, GL_FLOAT, 0, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
mNormalEnabled = false;
|
||||
|
@ -797,6 +799,7 @@ void lcContext::ClearVertexBuffer()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef LC_OPENGLES
|
||||
if (mNormalEnabled)
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
|
||||
|
@ -810,6 +813,7 @@ void lcContext::ClearVertexBuffer()
|
|||
glNormalPointer(GL_BYTE, 0, nullptr);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, nullptr);
|
||||
glColorPointer(4, GL_FLOAT, 0, nullptr);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -974,6 +978,7 @@ void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSi
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef LC_OPENGLES
|
||||
if (mVertexBufferOffset != VertexBufferPointer)
|
||||
{
|
||||
glVertexPointer(PositionSize, GL_FLOAT, VertexSize, VertexBufferPointer);
|
||||
|
@ -1033,6 +1038,7 @@ void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSi
|
|||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
mColorEnabled = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <QtGui>
|
||||
#include <QPrinter>
|
||||
|
||||
#if !defined(EGL_VERSION_1_0) && !defined(GL_ES_VERSION_2_0) && !defined(GL_ES_VERSION_3_0)
|
||||
#if !defined(EGL_VERSION_1_0) && !defined(GL_ES_VERSION_2_0) && !defined(GL_ES_VERSION_3_0) && !defined(QT_OPENGL_ES)
|
||||
#undef GL_LINES_ADJACENCY_EXT
|
||||
#undef GL_LINE_STRIP_ADJACENCY_EXT
|
||||
#undef GL_TRIANGLES_ADJACENCY_EXT
|
||||
|
|
|
@ -12,7 +12,9 @@ lcRenderDialog::lcRenderDialog(QWidget* Parent)
|
|||
: QDialog(Parent),
|
||||
ui(new Ui::lcRenderDialog)
|
||||
{
|
||||
#ifndef QT_NO_PROCESS
|
||||
mProcess = nullptr;
|
||||
#endif
|
||||
mSharedMemory.setNativeKey("leocad-povray");
|
||||
|
||||
ui->setupUi(this);
|
||||
|
@ -44,9 +46,11 @@ QString lcRenderDialog::GetPOVFileName() const
|
|||
|
||||
void lcRenderDialog::CloseProcess()
|
||||
{
|
||||
#ifndef QT_NO_PROCESS
|
||||
delete mProcess;
|
||||
mProcess = nullptr;
|
||||
|
||||
#endif
|
||||
|
||||
QFile::remove(GetPOVFileName());
|
||||
|
||||
ui->RenderButton->setText(tr("Render"));
|
||||
|
@ -54,6 +58,7 @@ void lcRenderDialog::CloseProcess()
|
|||
|
||||
bool lcRenderDialog::PromptCancel()
|
||||
{
|
||||
#ifndef QT_NO_PROCESS
|
||||
if (mProcess)
|
||||
{
|
||||
if (QMessageBox::question(this, tr("Cancel Render"), tr("Are you sure you want to cancel the current render?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
|
||||
|
@ -67,7 +72,8 @@ bool lcRenderDialog::PromptCancel()
|
|||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -79,6 +85,7 @@ void lcRenderDialog::reject()
|
|||
|
||||
void lcRenderDialog::on_RenderButton_clicked()
|
||||
{
|
||||
#ifndef QT_NO_PROCESS
|
||||
if (!PromptCancel())
|
||||
return;
|
||||
|
||||
|
@ -133,10 +140,12 @@ void lcRenderDialog::on_RenderButton_clicked()
|
|||
QMessageBox::warning(this, tr("Error"), tr("Error starting POV-Ray."));
|
||||
CloseProcess();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void lcRenderDialog::Update()
|
||||
{
|
||||
#ifndef QT_NO_PROCESS
|
||||
if (mProcess)
|
||||
{
|
||||
if (mProcess->state() == QProcess::NotRunning)
|
||||
|
@ -152,6 +161,7 @@ void lcRenderDialog::Update()
|
|||
CloseProcess();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (!mSharedMemory.isAttached() && !mSharedMemory.attach())
|
||||
|
|
|
@ -24,7 +24,9 @@ protected:
|
|||
void CloseProcess();
|
||||
bool PromptCancel();
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
QProcess* mProcess;
|
||||
#endif
|
||||
QTimer mUpdateTimer;
|
||||
QSharedMemory mSharedMemory;
|
||||
|
||||
|
|
Loading…
Reference in a new issue