/* Stanley Designer Copyright (C) 2012 Ivan Pelipenko peri4ko@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include #include #include #include "mainwindow.h" //#include //#include //#include "unistd.h" /*void display () { qDebug() << (const char*)glGetString(GLUT_VERSION); qDebug() << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION); usleep(200000); }*/ template struct garray { garray(T * _i) {for (int i = 0; i < N; ++i) _c[i] = &(_i[i]);} T * _c[N]; garray & operator =(const garray & o) {for (int i = 0; i < N; ++i) *_c[i] = *(o._c[i]); return *this;}; template garray & operator =(const garray & o) {for (int i = 0; i < qMin(N, ON); ++i) *_c[i] = *(o._c[i]); return *this;}; }; template class gvec3 { public: gvec3(T def = T()) {x = y = z = def;} union { T xyz[3]; struct {T x, y, z;}; }; private: T _c[3]; }; template QDebug operator<<(QDebug d, const gvec3 & c) { d.nospace() << "(" << c.x << ", " << c.y << ", " << c.z << ")"; return d.space(); } typedef gvec3 vec3; typedef gvec3 ivec3; int main(int argc, char ** argv) { /*float f[3] = {0., 1., 2.}; float f2[3] = {-1., -1., -1.}; garray gar(f2); qDebug() << f2[0] << f2[1] << f2[2]; gar = garray((float[3]){f[2], f[1], f[0]}); qDebug() << f2[0] << f2[1] << f2[2];*/ /*vec3 v0, v1(20); v0.y = 10; qDebug() << v0 << v1;*/ /*glutInit ( &argc, argv ); glutInitDisplayMode ( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ); glutInitWindowSize ( 500, 500 ); // prepare context for 3.3 glutInitContextVersion ( 3, 3 ); glutInitContextFlags ( GLUT_FORWARD_COMPATIBLE | GLUT_DEBUG ); glutInitContextProfile ( GLUT_CORE_PROFILE ); glutCreateWindow ( "Geometry shader example - particles" ); glutDisplayFunc ( display ); glewInit (); if ( !GLEW_VERSION_3_3 ) { printf ( "OpenGL 3.3 not supported.\n" ); return 1; } glutMainLoop(); */ //return 0; QApplication a(argc, argv); /*QGLFormat f; f.setVersion(3, 3); f.setSampleBuffers(true); f.setProfile(QGLFormat::CoreProfile); QGLFormat::setDefaultFormat(f);*/ //QApplication::setStyle(new QCleanlooksStyle()); //QDir::setCurrent(a.applicationDirPath()); //a.setWindowIcon(QIcon(":/icons/peri4_paint.png")); MainWindow w; w.show(); return a.exec(); }