git-svn-id: svn://db.shs.com.ru/libs@358 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
ConnectionEdit w;
|
ConnectionEdit w;
|
||||||
if (a.arguments().size() > 1) {
|
if (a.arguments().size() > 1) {
|
||||||
QPIConfig cfg(a.arguments()[1]);
|
QPIConfig cfg(a.arguments()[1]);
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
PIDumper w;
|
PIDumper w;
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
QPIIntrospector w;
|
QPIIntrospector w;
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
a.setWindowIcon(QIcon(":/icons/blockview.png"));
|
a.setWindowIcon(QIcon(":/icons/blockview.png"));
|
||||||
BlockEditor w;
|
BlockEditor w;
|
||||||
if (a.arguments().size() > 1)
|
if (a.arguments().size() > 1)
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
CDPultWindow w;
|
CDPultWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
if (a.arguments().size() > 1)
|
if (a.arguments().size() > 1)
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void createGLTexture(GLuint & tex, const QImage & image, const GLenum & format,
|
|||||||
glGenTextures(1, &tex);
|
glGenTextures(1, &tex);
|
||||||
glBindTexture(target, tex);
|
glBindTexture(target, tex);
|
||||||
}
|
}
|
||||||
QImage im = image;///__GLWidget__::convertToGLFormat(image);
|
QImage im = image.mirrored(false, true);///__GLWidget__::convertToGLFormat(image);
|
||||||
//const QImage & cim(im);
|
//const QImage & cim(im);
|
||||||
//glClearError();
|
//glClearError();
|
||||||
//glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
//glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
|||||||
@@ -499,7 +499,10 @@ void QGLView::collectGraphicItems(QList<QGraphicsItem * > & list, QGraphicsItem
|
|||||||
|
|
||||||
|
|
||||||
void QGLView::collectObjectLights(GLObjectBase * o) {
|
void QGLView::collectObjectLights(GLObjectBase * o) {
|
||||||
if (o->type_ == GLObjectBase::glLight) lights_ << globject_cast<Light * >(o);
|
if (o->type_ == GLObjectBase::glLight) {
|
||||||
|
lights_ << globject_cast<Light * >(o);
|
||||||
|
o->view_ = this;
|
||||||
|
}
|
||||||
foreach (GLObjectBase * i, o->children())
|
foreach (GLObjectBase * i, o->children())
|
||||||
collectObjectLights(i);
|
collectObjectLights(i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
|
|
||||||
int main(int argc, char ** argv) {
|
int main(int argc, char ** argv) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||||
|
#endif
|
||||||
QGLViewWindow w;
|
QGLViewWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
QStringList al(a.arguments());
|
QStringList al(a.arguments());
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLViewWindow() {
|
QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLViewWindow() {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
session.setFile("session_qglview_test.conf");
|
||||||
|
session.addEntry(this);
|
||||||
icon_geo = QIcon(":/icons/type-geo.png");
|
icon_geo = QIcon(":/icons/type-geo.png");
|
||||||
icon_camera = QIcon(":/icons/type-camera.png");
|
icon_camera = QIcon(":/icons/type-camera.png");
|
||||||
icon_light = QIcon(":/icons/type-light.png");
|
icon_light = QIcon(":/icons/type-light.png");
|
||||||
@@ -113,10 +115,12 @@ QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLView
|
|||||||
//view->addObject(&partsys);
|
//view->addObject(&partsys);
|
||||||
partsys.material().color_diffuse = Qt::red;
|
partsys.material().color_diffuse = Qt::red;
|
||||||
treeProps->assignObject(&partsys);
|
treeProps->assignObject(&partsys);
|
||||||
|
session.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QGLViewWindow::~QGLViewWindow() {
|
QGLViewWindow::~QGLViewWindow() {
|
||||||
|
session.save();
|
||||||
//delete ps;
|
//delete ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +136,8 @@ void QGLViewWindow::changeEvent(QEvent * e) {
|
|||||||
|
|
||||||
void QGLViewWindow::timerEvent(QTimerEvent * ) {
|
void QGLViewWindow::timerEvent(QTimerEvent * ) {
|
||||||
//static double t = 0.;
|
//static double t = 0.;
|
||||||
cam_light->intensity = checkCameraLight->isChecked() ? 0.5 : 0.;
|
//cam_light->intensity = checkCameraLight->isChecked() ? 0.5 : 0.;
|
||||||
|
cam_light->setVisible(checkCameraLight->isChecked());
|
||||||
//((RendererSimple*)(view->renderer()))->mpos = view->mapFromGlobal(QCursor::pos());
|
//((RendererSimple*)(view->renderer()))->mpos = view->mapFromGlobal(QCursor::pos());
|
||||||
statusBar()->showMessage(QString("FPS: %1").arg(QString::number(view->currentFPS(), 'f', 2)));
|
statusBar()->showMessage(QString("FPS: %1").arg(QString::number(view->currentFPS(), 'f', 2)));
|
||||||
}
|
}
|
||||||
@@ -215,7 +220,7 @@ void QGLViewWindow::selectionChanged(GLObjectBase * cur, GLObjectBase * prev) {
|
|||||||
objectEditor->setObject(sel_obj);
|
objectEditor->setObject(sel_obj);
|
||||||
if (sel_obj == 0) return;
|
if (sel_obj == 0) return;
|
||||||
matEditor->setMaterial(sel_obj->material());
|
matEditor->setMaterial(sel_obj->material());
|
||||||
qDebug() << sel_obj->boundingBox();
|
//qDebug() << sel_obj->boundingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -315,6 +320,7 @@ void QGLViewWindow::on_view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m) {
|
|||||||
|
|
||||||
void QGLViewWindow::on_treeObjects_itemClicked(QTreeWidgetItem * ti, int col) {
|
void QGLViewWindow::on_treeObjects_itemClicked(QTreeWidgetItem * ti, int col) {
|
||||||
((GLObjectBase*)(ti->data(0, Qt::UserRole).toULongLong()))->select();
|
((GLObjectBase*)(ti->data(0, Qt::UserRole).toULongLong()))->select();
|
||||||
|
//qDebug() << ((GLObjectBase*)(ti->data(0, Qt::UserRole).toULongLong()))->type();
|
||||||
if (sel_obj->type() == GLObjectBase::glCamera)
|
if (sel_obj->type() == GLObjectBase::glCamera)
|
||||||
view->setCamera(*(Camera*)sel_obj);
|
view->setCamera(*(Camera*)sel_obj);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "loader_ase.h"
|
#include "loader_ase.h"
|
||||||
#include "renderer_simple.h"
|
#include "renderer_simple.h"
|
||||||
#include "renderer_deferred_shading.h"
|
#include "renderer_deferred_shading.h"
|
||||||
|
#include "session_manager.h"
|
||||||
//#include "renderer_rt.h"
|
//#include "renderer_rt.h"
|
||||||
#include "glparticles_system.h"
|
#include "glparticles_system.h"
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ private:
|
|||||||
Light * cam_light;
|
Light * cam_light;
|
||||||
GLPrimitiveCube * box;
|
GLPrimitiveCube * box;
|
||||||
Material m;
|
Material m;
|
||||||
|
SessionManager session;
|
||||||
bool isChanged;
|
bool isChanged;
|
||||||
|
|
||||||
GLParticlesSystem partsys;
|
GLParticlesSystem partsys;
|
||||||
|
|||||||
Reference in New Issue
Block a user