mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
Derive from QOpenGLWidget instead of QGLWidget.
Derive from QOpenGLWidget instead of QGLWidget. More commits to follow.
This commit is contained in:
parent
9502ae57ab
commit
3cf6141e27
@ -6,7 +6,7 @@ CONFIG -= app_bundle
|
|||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
VERSION = 0.1.4.7
|
VERSION = 0.1.4.7
|
||||||
|
|
||||||
DESTDIR = ../../../Bin
|
DESTDIR = $$(HOME)/Dev/fractorium/Bin
|
||||||
|
|
||||||
LIBS += -L/usr/lib -ltbb
|
LIBS += -L/usr/lib -ltbb
|
||||||
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
||||||
@ -16,7 +16,6 @@ INCLUDEPATH += /usr/include/tbb
|
|||||||
INCLUDEPATH += /usr/include/libxml2
|
INCLUDEPATH += /usr/include/libxml2
|
||||||
INCLUDEPATH += ../../../Source/Ember
|
INCLUDEPATH += ../../../Source/Ember
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_RELEASE += -O2
|
|
||||||
QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
|
QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -march=k8
|
QMAKE_CXXFLAGS += -march=k8
|
||||||
|
@ -6,15 +6,15 @@ CONFIG -= app_bundle
|
|||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
VERSION = 0.1.4.7
|
VERSION = 0.1.4.7
|
||||||
|
|
||||||
DESTDIR = ../../../Bin
|
DESTDIR = $$(HOME)/Dev/fractorium/Bin
|
||||||
|
|
||||||
LIBS += -L/usr/lib -lOpenCL
|
LIBS += -L/usr/lib -lOpenCL
|
||||||
LIBS += -L/usr/lib -lGL
|
LIBS += -L/usr/lib -lGL
|
||||||
LIBS += -L/usr/lib -ljpeg
|
LIBS += -L/usr/lib -ljpeg
|
||||||
LIBS += -L/usr/lib -lpng
|
LIBS += -L/usr/lib -lpng
|
||||||
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
||||||
LIBS += -L../../../Bin -lEmber
|
LIBS += -L$$DESTDIR -lEmber
|
||||||
LIBS += -L../../../Bin -lEmberCL
|
LIBS += -L$$DESTDIR -lEmberCL
|
||||||
|
|
||||||
INCLUDEPATH += /usr/include/CL
|
INCLUDEPATH += /usr/include/CL
|
||||||
INCLUDEPATH += /usr/include/GL
|
INCLUDEPATH += /usr/include/GL
|
||||||
|
@ -6,7 +6,7 @@ CONFIG -= app_bundle
|
|||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
VERSION = 0.1.4.7
|
VERSION = 0.1.4.7
|
||||||
|
|
||||||
DESTDIR = ../../../Bin
|
DESTDIR = $$(HOME)/Dev/fractorium/Bin
|
||||||
|
|
||||||
LIBS += -L/usr/lib -lOpenCL
|
LIBS += -L/usr/lib -lOpenCL
|
||||||
LIBS += -L/usr/lib -lGL
|
LIBS += -L/usr/lib -lGL
|
||||||
@ -18,7 +18,6 @@ INCLUDEPATH += /usr/include/tbb
|
|||||||
INCLUDEPATH += /usr/include/libxml2
|
INCLUDEPATH += /usr/include/libxml2
|
||||||
INCLUDEPATH += ../../../Source/Ember
|
INCLUDEPATH += ../../../Source/Ember
|
||||||
|
|
||||||
QMAKE_CXXFLAGS_RELEASE += -O2
|
|
||||||
QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
|
QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -march=k8
|
QMAKE_CXXFLAGS += -march=k8
|
||||||
|
@ -6,15 +6,15 @@ CONFIG -= app_bundle
|
|||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
VERSION = 0.1.4.7
|
VERSION = 0.1.4.7
|
||||||
|
|
||||||
DESTDIR = ../../../Bin
|
DESTDIR = $$(HOME)/Dev/fractorium/Bin
|
||||||
|
|
||||||
LIBS += -L/usr/lib -lOpenCL
|
LIBS += -L/usr/lib -lOpenCL
|
||||||
LIBS += -L/usr/lib -lGL
|
LIBS += -L/usr/lib -lGL
|
||||||
LIBS += -L/usr/lib -ljpeg
|
LIBS += -L/usr/lib -ljpeg
|
||||||
LIBS += -L/usr/lib -lpng
|
LIBS += -L/usr/lib -lpng
|
||||||
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
||||||
LIBS += -L../../../Bin -lEmber
|
LIBS += -L$$DESTDIR -lEmber
|
||||||
LIBS += -L../../../Bin -lEmberCL
|
LIBS += -L$$DESTDIR -lEmberCL
|
||||||
|
|
||||||
INCLUDEPATH += /usr/include/CL
|
INCLUDEPATH += /usr/include/CL
|
||||||
INCLUDEPATH += /usr/include/GL
|
INCLUDEPATH += /usr/include/GL
|
||||||
|
@ -6,15 +6,15 @@ CONFIG -= app_bundle
|
|||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
VERSION = 0.1.4.7
|
VERSION = 0.1.4.7
|
||||||
|
|
||||||
DESTDIR = ../../../Bin
|
DESTDIR = $$(HOME)/Dev/fractorium/Bin
|
||||||
|
|
||||||
LIBS += -L/usr/lib -lOpenCL
|
LIBS += -L/usr/lib -lOpenCL
|
||||||
LIBS += -L/usr/lib -lGL
|
LIBS += -L/usr/lib -lGL
|
||||||
LIBS += -L/usr/lib -ljpeg
|
LIBS += -L/usr/lib -ljpeg
|
||||||
LIBS += -L/usr/lib -lpng
|
LIBS += -L/usr/lib -lpng
|
||||||
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
||||||
LIBS += -L../../../Bin -lEmber
|
LIBS += -L$$DESTDIR -lEmber
|
||||||
LIBS += -L../../../Bin -lEmberCL
|
LIBS += -L$$DESTDIR -lEmberCL
|
||||||
|
|
||||||
INCLUDEPATH += /usr/include/CL
|
INCLUDEPATH += /usr/include/CL
|
||||||
INCLUDEPATH += /usr/include/GL
|
INCLUDEPATH += /usr/include/GL
|
||||||
|
@ -13,7 +13,7 @@ TEMPLATE = app
|
|||||||
CONFIG += precompile_header
|
CONFIG += precompile_header
|
||||||
VERSION = 0.1.4.7
|
VERSION = 0.1.4.7
|
||||||
|
|
||||||
DESTDIR = ../../../Bin
|
DESTDIR = $$(HOME)/Dev/fractorium/Bin
|
||||||
|
|
||||||
LIBS += -L/usr/lib -lOpenCL
|
LIBS += -L/usr/lib -lOpenCL
|
||||||
LIBS += -L/usr/lib -lGL
|
LIBS += -L/usr/lib -lGL
|
||||||
@ -21,8 +21,8 @@ LIBS += -L/usr/lib -ljpeg
|
|||||||
LIBS += -L/usr/lib -lpng
|
LIBS += -L/usr/lib -lpng
|
||||||
LIBS += -L/usr/lib -ltbb
|
LIBS += -L/usr/lib -ltbb
|
||||||
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
LIBS += -L/usr/lib/x86_64-linux-gnu -lxml2
|
||||||
LIBS += -L../../../Bin -lEmber
|
LIBS += -L$$DESTDIR -lEmber
|
||||||
LIBS += -L../../../Bin -lEmberCL
|
LIBS += -L$$DESTDIR -lEmberCL
|
||||||
|
|
||||||
INCLUDEPATH += /usr/include/CL
|
INCLUDEPATH += /usr/include/CL
|
||||||
INCLUDEPATH += /usr/include/GL
|
INCLUDEPATH += /usr/include/GL
|
||||||
|
@ -193,8 +193,8 @@ private:
|
|||||||
CriticalSection()
|
CriticalSection()
|
||||||
{
|
{
|
||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
|
|
||||||
pthread_mutexattr_init(&attr);
|
pthread_mutexattr_init(&attr);
|
||||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
|
||||||
pthread_mutex_init(&m_CriticalSection, &attr);
|
pthread_mutex_init(&m_CriticalSection, &attr);
|
||||||
pthread_mutexattr_destroy(&attr);
|
pthread_mutexattr_destroy(&attr);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>488</width>
|
<width>488</width>
|
||||||
<height>617</height>
|
<height>565</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -19,13 +19,13 @@
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>488</width>
|
<width>488</width>
|
||||||
<height>617</height>
|
<height>565</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>587</width>
|
<width>587</width>
|
||||||
<height>617</height>
|
<height>565</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -77,6 +77,9 @@
|
|||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -105,6 +108,9 @@
|
|||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -133,6 +139,9 @@
|
|||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -154,6 +163,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPushButton" name="okButton">
|
<widget class="QPushButton" name="okButton">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
|
@ -119,6 +119,9 @@ Fractorium::Fractorium(QWidget* p)
|
|||||||
m_ProgressBar->setMaximumWidth(progressBarWidth);
|
m_ProgressBar->setMaximumWidth(progressBarWidth);
|
||||||
ui.statusBar->addPermanentWidget(m_ProgressBar);
|
ui.statusBar->addPermanentWidget(m_ProgressBar);
|
||||||
|
|
||||||
|
//Setup pointer in the GL window to point back to here.
|
||||||
|
ui.GLDisplay->SetMainWindow(this);
|
||||||
|
|
||||||
showMaximized();
|
showMaximized();
|
||||||
|
|
||||||
connect(ui.DockWidget, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
|
connect(ui.DockWidget, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
|
||||||
@ -146,15 +149,11 @@ Fractorium::Fractorium(QWidget* p)
|
|||||||
//setStyleSheet("QGroupBox { border: 2px solid gray; border-radius: 3px; } ");
|
//setStyleSheet("QGroupBox { border: 2px solid gray; border-radius: 3px; } ");
|
||||||
|
|
||||||
m_PreviousPaletteRow = -1;//Force click handler the first time through.
|
m_PreviousPaletteRow = -1;//Force click handler the first time through.
|
||||||
|
|
||||||
//Setup pointer in the GL window to point back to here.
|
|
||||||
ui.GLDisplay->SetMainWindow(this);
|
|
||||||
//ui.GLDisplay->setParent(this);
|
|
||||||
SetCoordinateStatus(0, 0, 0, 0);
|
SetCoordinateStatus(0, 0, 0, 0);
|
||||||
|
|
||||||
SetTabOrders();
|
SetTabOrders();
|
||||||
ui.GLParentScrollArea->installEventFilter(this);
|
ui.GLParentScrollArea->installEventFilter(this);
|
||||||
|
|
||||||
//At this point, everything has been setup except the renderer. Shortly after
|
//At this point, everything has been setup except the renderer. Shortly after
|
||||||
//this constructor exits, GLWidget::initializeGL() will create the initial flock and start the rendering timer
|
//this constructor exits, GLWidget::initializeGL() will create the initial flock and start the rendering timer
|
||||||
//which executes whenever the program is idle. Upon starting the timer, the renderer
|
//which executes whenever the program is idle. Upon starting the timer, the renderer
|
||||||
@ -263,7 +262,7 @@ bool Fractorium::eventFilter(QObject* o, QEvent* e)
|
|||||||
{
|
{
|
||||||
m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width());
|
m_WidthSpin->DoubleClickNonZero(ui.GLParentScrollArea->width());
|
||||||
m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height());
|
m_HeightSpin->DoubleClickNonZero(ui.GLParentScrollArea->height());
|
||||||
//qDebug() << "scroll area resized";
|
//qDebug() << "scroll area resized";
|
||||||
}
|
}
|
||||||
|
|
||||||
return QMainWindow::eventFilter(o, e);
|
return QMainWindow::eventFilter(o, e);
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QGLWidget>
|
#include <QOpenGLWidget>
|
||||||
#include <qopenglfunctions_2_0.h>
|
#include <qopenglfunctions_2_0.h>
|
||||||
#include <QtWidgets/QMainWindow>
|
#include <QtWidgets/QMainWindow>
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
|
@ -434,10 +434,10 @@ bool FractoriumEmberController<T>::Render()
|
|||||||
{
|
{
|
||||||
if (m_FinalImage.size() == m_Renderer->FinalBufferSize())//Make absolutely sure the correct amount of data is passed.
|
if (m_FinalImage.size() == m_Renderer->FinalBufferSize())//Make absolutely sure the correct amount of data is passed.
|
||||||
gl->repaint();
|
gl->repaint();
|
||||||
//gl->update();
|
//gl->update();
|
||||||
|
|
||||||
//m_Fractorium->update();
|
//m_Fractorium->update();
|
||||||
//m_Fractorium->ui.GLParentScrollArea->update();
|
//m_Fractorium->ui.GLParentScrollArea->update();
|
||||||
//Uncomment for debugging kernel build and execution errors.
|
//Uncomment for debugging kernel build and execution errors.
|
||||||
//m_Fractorium->ui.InfoRenderingTextEdit->setText(QString::fromStdString(m_Fractorium->m_Wrapper.DumpInfo()));
|
//m_Fractorium->ui.InfoRenderingTextEdit->setText(QString::fromStdString(m_Fractorium->m_Wrapper.DumpInfo()));
|
||||||
//if (rendererCL)
|
//if (rendererCL)
|
||||||
|
@ -30,15 +30,15 @@ void Fractorium::InitXformsUI()
|
|||||||
connect(ui.XformWeightNameTable, SIGNAL(cellChanged(int, int)), this, SLOT(OnXformNameChanged(int, int)), Qt::QueuedConnection);
|
connect(ui.XformWeightNameTable, SIGNAL(cellChanged(int, int)), this, SLOT(OnXformNameChanged(int, int)), Qt::QueuedConnection);
|
||||||
|
|
||||||
ui.CurrentXformCombo->setProperty("soloxform", -1);
|
ui.CurrentXformCombo->setProperty("soloxform", -1);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
//For some reason linux makes these 24x24, even though the designer explicitly says 16x16.
|
//For some reason linux makes these 24x24, even though the designer explicitly says 16x16.
|
||||||
ui.AddXformButton->setIconSize(QSize(16, 16));
|
ui.AddXformButton->setIconSize(QSize(16, 16));
|
||||||
ui.DuplicateXformButton->setIconSize(QSize(16, 16));
|
ui.DuplicateXformButton->setIconSize(QSize(16, 16));
|
||||||
ui.ClearXformButton->setIconSize(QSize(16, 16));
|
ui.ClearXformButton->setIconSize(QSize(16, 16));
|
||||||
ui.DeleteXformButton->setIconSize(QSize(16, 16));
|
ui.DeleteXformButton->setIconSize(QSize(16, 16));
|
||||||
ui.AddFinalXformButton->setIconSize(QSize(16, 16));
|
ui.AddFinalXformButton->setIconSize(QSize(16, 16));
|
||||||
ui.CurrentXformCombo->setIconSize(QSize(16, 16));
|
ui.CurrentXformCombo->setIconSize(QSize(16, 16));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="p">The parent widget</param>
|
/// <param name="p">The parent widget</param>
|
||||||
GLWidget::GLWidget(QWidget* p)
|
GLWidget::GLWidget(QWidget* p)
|
||||||
: QGLWidget(QGLFormat(QGL::SampleBuffers), p)
|
: QOpenGLWidget(p)
|
||||||
{
|
{
|
||||||
QGLFormat qglFormat;
|
QSurfaceFormat qsf;
|
||||||
|
|
||||||
m_Init = false;
|
m_Init = false;
|
||||||
m_Drawing = false;
|
m_Drawing = false;
|
||||||
@ -20,14 +20,12 @@ GLWidget::GLWidget(QWidget* p)
|
|||||||
m_TexHeight = 0;
|
m_TexHeight = 0;
|
||||||
m_OutputTexID = 0;
|
m_OutputTexID = 0;
|
||||||
m_Fractorium = NULL;
|
m_Fractorium = NULL;
|
||||||
qglFormat.setSwapInterval(1);//Vsync.
|
|
||||||
qglFormat.setDoubleBuffer(true);
|
qsf.setSwapInterval(1);//Vsync.
|
||||||
qglFormat.setVersion(2, 0);
|
qsf.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
|
||||||
//qglFormat.setVersion(3, 2);
|
qsf.setVersion(2, 0);
|
||||||
qglFormat.setProfile(QGLFormat::CompatibilityProfile);
|
|
||||||
//qglFormat.setProfile(QGLFormat::CoreProfile);
|
setFormat(qsf);
|
||||||
|
|
||||||
setFormat(qglFormat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -120,8 +118,10 @@ void GLEmberController<T>::ClearWindow()
|
|||||||
m_GL->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
m_GL->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
m_GL->glClearColor(ember->m_Background.r, ember->m_Background.g, ember->m_Background.b, 1.0);
|
m_GL->glClearColor(ember->m_Background.r, ember->m_Background.g, ember->m_Background.b, 1.0);
|
||||||
|
|
||||||
|
//m_GL->update();
|
||||||
m_GL->makeCurrent();
|
m_GL->makeCurrent();
|
||||||
m_GL->swapBuffers();
|
//m_GL->context()->swapBuffers(;
|
||||||
|
//m_GL->context()->swapBuffers(m_GL->context()->surface());
|
||||||
|
|
||||||
m_GL->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
m_GL->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
m_GL->glClearColor(ember->m_Background.r, ember->m_Background.g, ember->m_Background.b, 1.0);
|
m_GL->glClearColor(ember->m_Background.r, ember->m_Background.g, ember->m_Background.b, 1.0);
|
||||||
@ -144,6 +144,7 @@ void GLEmberController<T>::SetSelectedXform(Xform<T>* xform)
|
|||||||
m_SelectedXform = xform;
|
m_SelectedXform = xform;
|
||||||
|
|
||||||
if (m_GL->m_Init)
|
if (m_GL->m_Init)
|
||||||
|
//m_GL->update();
|
||||||
m_GL->repaint();//Force immediate redraw with repaint() instead of update().
|
m_GL->repaint();//Force immediate redraw with repaint() instead of update().
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,14 +177,14 @@ void GLWidget::initializeGL()
|
|||||||
{
|
{
|
||||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
//int w = m_Fractorium->width() - m_Fractorium->ui.DockWidget->width();
|
int w = m_Fractorium->width() - m_Fractorium->ui.DockWidget->width();
|
||||||
//int h = m_Fractorium->ui.DockWidget->height();
|
int h = m_Fractorium->ui.DockWidget->height();
|
||||||
|
|
||||||
int w = m_Fractorium->ui.GLParentScrollArea->width();
|
//int w = m_Fractorium->ui.GLParentScrollArea->width();
|
||||||
int h = m_Fractorium->ui.GLParentScrollArea->height();
|
//int h = m_Fractorium->ui.GLParentScrollArea->height();
|
||||||
|
|
||||||
//show();
|
//show();
|
||||||
//m_Fractorium->ui.GLParentScrollArea->showMaximized();
|
//m_Fractorium->ui.GLParentScrollArea->showMaximized();
|
||||||
SetDimensions(w, h);
|
SetDimensions(w, h);
|
||||||
m_Fractorium->m_WidthSpin->setValue(w);
|
m_Fractorium->m_WidthSpin->setValue(w);
|
||||||
m_Fractorium->m_HeightSpin->setValue(h);
|
m_Fractorium->m_HeightSpin->setValue(h);
|
||||||
@ -198,7 +199,7 @@ void GLWidget::initializeGL()
|
|||||||
|
|
||||||
//Start with a flock of 10 random embers. Can't do this until now because the window wasn't maximized yet, so the sizes would have been off.
|
//Start with a flock of 10 random embers. Can't do this until now because the window wasn't maximized yet, so the sizes would have been off.
|
||||||
m_Fractorium->OnActionNewFlock(false);
|
m_Fractorium->OnActionNewFlock(false);
|
||||||
//m_Fractorium->repaint();
|
//m_Fractorium->repaint();
|
||||||
m_Fractorium->m_Controller->DelayedStartRenderTimer();
|
m_Fractorium->m_Controller->DelayedStartRenderTimer();
|
||||||
m_Init = true;
|
m_Init = true;
|
||||||
}
|
}
|
||||||
@ -401,7 +402,7 @@ bool GLEmberControllerBase::KeyPress_(QKeyEvent* e)
|
|||||||
void GLWidget::keyPressEvent(QKeyEvent* e)
|
void GLWidget::keyPressEvent(QKeyEvent* e)
|
||||||
{
|
{
|
||||||
if (!GLController() || !GLController()->KeyPress_(e))
|
if (!GLController() || !GLController()->KeyPress_(e))
|
||||||
QGLWidget::keyPressEvent(e);
|
QOpenGLWidget::keyPressEvent(e);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@ -441,7 +442,7 @@ bool GLEmberControllerBase::KeyRelease_(QKeyEvent* e)
|
|||||||
void GLWidget::keyReleaseEvent(QKeyEvent* e)
|
void GLWidget::keyReleaseEvent(QKeyEvent* e)
|
||||||
{
|
{
|
||||||
if (!GLController() || !GLController()->KeyRelease_(e))
|
if (!GLController() || !GLController()->KeyRelease_(e))
|
||||||
QGLWidget::keyReleaseEvent(e);
|
QOpenGLWidget::keyReleaseEvent(e);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@ -545,7 +546,7 @@ void GLWidget::mousePressEvent(QMouseEvent* e)
|
|||||||
if (GLEmberControllerBase* controller = GLController())
|
if (GLEmberControllerBase* controller = GLController())
|
||||||
controller->MousePress(e);
|
controller->MousePress(e);
|
||||||
|
|
||||||
QGLWidget::mousePressEvent(e);
|
QOpenGLWidget::mousePressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -583,7 +584,7 @@ void GLWidget::mouseReleaseEvent(QMouseEvent* e)
|
|||||||
if (GLEmberControllerBase* controller = GLController())
|
if (GLEmberControllerBase* controller = GLController())
|
||||||
controller->MouseRelease(e);
|
controller->MouseRelease(e);
|
||||||
|
|
||||||
QGLWidget::mouseReleaseEvent(e);
|
QOpenGLWidget::mouseReleaseEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -692,7 +693,7 @@ void GLWidget::mouseMoveEvent(QMouseEvent* e)
|
|||||||
if (GLEmberControllerBase* controller = GLController())
|
if (GLEmberControllerBase* controller = GLController())
|
||||||
controller->MouseMove(e);
|
controller->MouseMove(e);
|
||||||
|
|
||||||
QGLWidget::mouseMoveEvent(e);
|
QOpenGLWidget::mouseMoveEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -720,7 +721,7 @@ void GLWidget::wheelEvent(QWheelEvent* e)
|
|||||||
if (GLEmberControllerBase* controller = GLController())
|
if (GLEmberControllerBase* controller = GLController())
|
||||||
controller->Wheel(e);
|
controller->Wheel(e);
|
||||||
|
|
||||||
//Do not call QGLWidget::wheelEvent(e) because this should only affect the scale and not the position of the scroll bars.
|
//Do not call QOpenGLWidget::wheelEvent(e) because this should only affect the scale and not the position of the scroll bars.
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -730,12 +731,14 @@ void GLWidget::wheelEvent(QWheelEvent* e)
|
|||||||
/// the OpenGL texture it's being drawn on.
|
/// the OpenGL texture it's being drawn on.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e">The event</param>
|
/// <param name="e">The event</param>
|
||||||
void GLWidget::resizeEvent(QResizeEvent* e)
|
//void GLWidget::resizeEvent(QResizeEvent* e)
|
||||||
{
|
//{
|
||||||
if (m_Fractorium)
|
// if (m_Fractorium)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
|
// QOpenGLWidget::resizeEvent(e);
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the dimensions of the drawing area.
|
/// Set the dimensions of the drawing area.
|
||||||
@ -746,7 +749,7 @@ void GLWidget::resizeEvent(QResizeEvent* e)
|
|||||||
void GLWidget::SetDimensions(int w, int h)
|
void GLWidget::SetDimensions(int w, int h)
|
||||||
{
|
{
|
||||||
setFixedSize(w, h);
|
setFixedSize(w, h);
|
||||||
//resize(w, h);
|
//resize(w, h);
|
||||||
//m_Fractorium->ui.GLParentScrollAreaContents->setFixedSize(w, h);
|
//m_Fractorium->ui.GLParentScrollAreaContents->setFixedSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,7 +806,7 @@ bool GLWidget::Deallocate()
|
|||||||
|
|
||||||
if (m_OutputTexID != 0)
|
if (m_OutputTexID != 0)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, m_OutputTexID);
|
glBindTexture(GL_TEXTURE_2D, m_OutputTexID);
|
||||||
glDeleteTextures(1, &m_OutputTexID);
|
glDeleteTextures(1, &m_OutputTexID);
|
||||||
m_OutputTexID = 0;
|
m_OutputTexID = 0;
|
||||||
deleted = true;
|
deleted = true;
|
||||||
|
@ -28,7 +28,7 @@ static const float GridStep = 1.0f / 8.0f;
|
|||||||
/// the main window and several of its members.
|
/// the main window and several of its members.
|
||||||
/// This class uses a controller-based design similar to the main window.
|
/// This class uses a controller-based design similar to the main window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class GLWidget : public QGLWidget, protected QOpenGLFunctions_2_0//QOpenGLFunctions_3_2_Compatibility//QOpenGLFunctions_3_2_Core//, protected QOpenGLFunctions
|
class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions_2_0//QOpenGLFunctions_3_2_Compatibility//QOpenGLFunctions_3_2_Core//, protected QOpenGLFunctions
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ protected:
|
|||||||
virtual void mouseReleaseEvent(QMouseEvent* e) override;
|
virtual void mouseReleaseEvent(QMouseEvent* e) override;
|
||||||
virtual void mouseMoveEvent(QMouseEvent* e) override;
|
virtual void mouseMoveEvent(QMouseEvent* e) override;
|
||||||
virtual void wheelEvent(QWheelEvent* e) override;
|
virtual void wheelEvent(QWheelEvent* e) override;
|
||||||
virtual void resizeEvent(QResizeEvent* e) override;
|
//virtual void resizeEvent(QResizeEvent* e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetDimensions(int w, int h);
|
void SetDimensions(int w, int h);
|
||||||
|
Loading…
Reference in New Issue
Block a user