Revision: 26
Author: vijay.michaeljoseph
Date: Sun Sep 5 01:15:27 2010
Log: * Mainly cleanup of scattered code.
* Moved from QtDesigner based dialog construction to Layouts (on the fly
construction)
This allows flexible and more control over the widgets we place on a dialog
(from a programmer's perspective).
Not entirely discarded old code, just left them in a folder so that it can
be selectively brought back when required.
This change reverts the Material editor dialog, but it will be brought to
life again soon.
Currently my priority is to get the shader parameters to show up with
editable properties.
As for the functionality I broke related to the main view widget, I have
put it back on the main window, and a browse button that connects to an
empty slot with a log message. Test code can be put in there.
http://code.google.com/p/shaderz/source/detail?r=26
Added:
/trunk/ReadMe.txt
/trunk/include/qt
/trunk/include/qt/osgadapterwidget.h
/trunk/include/qt/qtmainwindow.h
/trunk/include/qt/qtshaderzviewwidget.h
/trunk/old
/trunk/old/inc
/trunk/old/inc/shaderzmain.h
/trunk/old/inc/shdefs.h
/trunk/old/inc/shhud.h
/trunk/old/inc/shmaterialcontainer.h
/trunk/old/inc/shmaterialeditordialog.h
/trunk/old/inc/shmaterialinstance.h
/trunk/old/inc/shparameterwidgetui.h
/trunk/old/inc/shshaderinfo.h
/trunk/old/inc/shshaderparametercontainer.h
/trunk/old/inc/shshaderprogram.h
/trunk/old/src
/trunk/old/src/main.cpp
/trunk/old/src/shaderzmain.cpp
/trunk/old/src/shhud.cpp
/trunk/old/src/shlogger.cpp
/trunk/old/src/shmaterialcontainer.cpp
/trunk/old/src/shmaterialeditordialog.cpp
/trunk/old/src/shmaterialinstance.cpp
/trunk/old/src/shparameterwidgetui.cpp
/trunk/old/src/shshaderinfo.cpp
/trunk/old/src/shshaderparametercontainer.cpp
/trunk/old/src/shshaderprogram.cpp
/trunk/shaderz.xcodeproj/vijayjoseph.mode1v3
/trunk/shaderz.xcodeproj/vijayjoseph.pbxuser
/trunk/src/qt
/trunk/src/qt/osgadapterwidget.cpp
/trunk/src/qt/qtmainwindow.cpp
/trunk/src/qt/qtshaderzviewwidget.cpp
/trunk/src/shmain.cpp
Deleted:
/trunk/Info.plist
/trunk/MakefileOSG
/trunk/include/qtwidgets
/trunk/include/shaderzmain.h
/trunk/include/shhud.h
/trunk/include/shmaterialcontainer.h
/trunk/include/shmaterialeditordialog.h
/trunk/include/shmaterialinstance.h
/trunk/include/shparameterwidgetui.h
/trunk/include/shshaderinfo.h
/trunk/include/shshaderparametercontainer.h
/trunk/include/shshaderprogram.h
/trunk/main.cpp
/trunk/
shaderz.pro
/trunk/shaderz.xcodeproj/qt_makeqmake.mak
/trunk/shaderz.xcodeproj/qt_preprocess.mak
/trunk/src/main.cpp
/trunk/src/qtwidgets
/trunk/src/shaderzmain.cpp
/trunk/src/shhud.cpp
/trunk/src/shmaterialcontainer.cpp
/trunk/src/shmaterialeditordialog.cpp
/trunk/src/shmaterialinstance.cpp
/trunk/src/shparameterwidgetui.cpp
/trunk/src/shshaderinfo.cpp
/trunk/src/shshaderparametercontainer.cpp
/trunk/src/shshaderprogram.cpp
/trunk/ui
Modified:
/trunk/CMakeLists.txt
/trunk/Makefile
/trunk/include/shdefs.h
/trunk/shaderz.xcodeproj/project.pbxproj
=======================================
--- /dev/null
+++ /trunk/ReadMe.txt Sun Sep 5 01:15:27 2010
@@ -0,0 +1,1 @@
+Remember to have set OSG_FILE_PATH to the path of folder holding all
resources.
=======================================
--- /dev/null
+++ /trunk/include/qt/osgadapterwidget.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,110 @@
+#ifndef OSGADAPTERWIDGET_H
+#define OSGADAPTERWIDGET_H
+
+/* OpenSceneGraph example, osganimate.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
copy
+* of this software and associated documentation files (the "Software"),
to deal
+* in the Software without restriction, including without limitation the
rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN
+* THE SOFTWARE.
+*/
+
+#include "shdefs.h"
+#include <osgViewer/Viewer>
+#include <osgViewer/CompositeViewer>
+#include <osgViewer/ViewerEventHandlers>
+#include <osgGA/TrackballManipulator>
+#include <osgDB/ReadFile>
+
+#if USE_QT4
+ #include <QtCore/QString>
+ #include <QtCore/QTimer>
+ #include <QtGui/QKeyEvent>
+ #include <QtGui/QApplication>
+ #include <QtOpenGL/QGLWidget>
+ #include <QtGui/QMainWindow>
+ #include <QtGui/QMdiSubWindow>
+ #include <QtGui/QMdiArea>
+
+ using Qt::WindowFlags;
+
+#else
+ class QWidget;
+ #include <qtimer.h>
+ #include <qgl.h>
+ #include <qapplication.h>
+
+ #define WindowFlags WFlags
+
+#endif
+
+#include <iostream>
+
+namespace osg
+{
+
+ // class defs taken from OpenSceneGraph Qt viewer.
+ class AdapterWidget : public QGLWidget
+ {
+ public:
+
+ AdapterWidget( QWidget * parent = 0, const char * name = 0,
const QGLWidget * shareWidget = 0, WindowFlags f = 0 );
+
+ virtual ~AdapterWidget() {}
+
+ osgViewer::GraphicsWindow* getGraphicsWindow() { return
_gw.get(); }
+ const osgViewer::GraphicsWindow* getGraphicsWindow() const {
return _gw.get(); }
+
+ protected:
+
+ void init();
+
+ virtual void resizeGL( int width, int height );
+ virtual void keyPressEvent( QKeyEvent* event );
+ virtual void keyReleaseEvent( QKeyEvent* event );
+ virtual void mousePressEvent( QMouseEvent* event );
+ virtual void mouseReleaseEvent( QMouseEvent* event );
+ virtual void mouseMoveEvent( QMouseEvent* event );
+
+ osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> _gw;
+ };
+
+ class ViewerQT : public osgViewer::Viewer, public AdapterWidget
+ {
+ public:
+
+ ViewerQT(QWidget * parent = 0, const char * name = 0, const
QGLWidget * shareWidget = 0, WindowFlags f = 0):
+ AdapterWidget( parent, name, shareWidget, f )
+ {
+ getCamera()->setViewport(new
osg::Viewport(0,0,width(),height()));
+ getCamera()->setProjectionMatrixAsPerspective(30.0f,
static_cast<double>(width())/static_cast<double>(height()), 1.0f, 10000.0f);
+ getCamera()->setGraphicsContext(getGraphicsWindow());
+
+ setThreadingModel(osgViewer::Viewer::SingleThreaded);
+
+ connect(&_timer, SIGNAL(timeout()), this,
SLOT(updateGL()));
+ _timer.start(10);
+ }
+
+ virtual void paintGL()
+ {
+ frame();
+ }
+
+ protected:
+
+ QTimer _timer;
+ };
+}
+
+#endif // OSGADAPTERWIDGET_H
=======================================
--- /dev/null
+++ /trunk/include/qt/qtmainwindow.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,34 @@
+/*
+ * qtMainWindow.h
+ * shaderz
+ *
+ * Created by Vijay Michael Joseph on 9/5/10.
+ * EMail:
vijay.mic...@gmail.com
+ *
+ */
+
+#ifndef __SHADERZ_QT_MAINWINDOW_H__
+#define __SHADERZ_QT_MAINWINDOW_H__
+
+#include <QtGui/QDialog>
+
+namespace Shaderz
+{
+ class qtMainWindow : public QDialog
+ {
+ Q_OBJECT
+
+ public:
+ qtMainWindow();
+ virtual ~qtMainWindow();
+
+ public slots:
+ void OnClickedBrowse();
+
+ protected:
+
+ private:
+ typedef QDialog ParentClass;
+ };
+}
+#endif
=======================================
--- /dev/null
+++ /trunk/include/qt/qtshaderzviewwidget.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,28 @@
+#ifndef SHADERZ_QTVIEWWIDGET_H
+#define SHADERZ_QTVIEWWIDGET_H
+
+#include "osgadapterwidget.h"
+
+/**
+ * Shaderz qt widget for displaying any scenegraph data.
+ */
+class qtShaderzViewWidget : public osg::ViewerQT
+{
+ public:
+ qtShaderzViewWidget( QWidget * pParent = 0,
+ const char * pName = 0,
+ const QGLWidget * pShareWidget = 0,
+ WindowFlags f = 0,
+ std::string sSceneFilePath = "" // the path
of the scene data to be displayed in the view window
+ );
+
+ virtual void loadScene(std::string sModelFilePath);
+ virtual void resizeGL(int w, int h);
+
+ virtual QSize sizeHint () const { return QSize(100,100); }
+ protected:
+ // root node for the viewer
+ osg::ref_ptr<osg::Node> m_pRoot;
+};
+
+#endif // SHADERZ_QTVIEWWIDGET_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shaderzmain.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,26 @@
+#ifndef SHADERZMAIN_H
+#define SHADERZMAIN_H
+
+#include <QtGui/QMainWindow>
+
+namespace Ui
+{
+ class shaderzMain;
+}
+
+class shaderzMain : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ shaderzMain(QWidget *parent = 0);
+ ~shaderzMain();
+
+private:
+ Ui::shaderzMain *ui;
+
+private slots:
+ void on_materialEditorButton_clicked();
+};
+
+#endif // SHADERZMAIN_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shdefs.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,27 @@
+#ifndef SHWIDGET_H
+#define SHWIDGET_H
+
+#define USE_QT4 1
+
+#include <QtGui/QWidget>
+#include <QtGui/QScrollArea>
+#include <QtGui/QResizeEvent>
+#include <QtGui/QLabel>
+#include <QtCore/QString>
+#include <QtGui/QLineEdit>
+#include <QtGui/QTreeWidget>
+#include <QtGui/QTreeWIdgetItem>
+
+namespace Shaderz
+{
+ typedef QRect shRect;
+ typedef QWidget shWidget;
+ typedef QScrollArea shScrollAreaWidget;
+ typedef QResizeEvent shResizeEvent;
+ typedef QLabel shLabel;
+ typedef QString shString;
+ typedef QLineEdit shLineEdit;
+ typedef QTreeWidget shTreeWidget;
+ typedef QTreeWidgetItem shTreeWidgetItem;
+}
+#endif // SHWIDGET_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shhud.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,20 @@
+#ifndef SHHUD_H
+#define SHHUD_H
+
+#include "osg/Camera"
+#include "osg/Geometry"
+
+namespace Shaderz
+{
+ class shHud
+ {
+ public:
+ shHud();
+ void addChild( osg::Node* pNewNode );
+ osg::ref_ptr<osg::Camera> getCamera(void) { return
m_pHudCamera; }
+
+ private:
+ osg::ref_ptr<osg::Camera> m_pHudCamera;
+ };
+}
+#endif // SHHUD_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shmaterialcontainer.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,45 @@
+#ifndef SHMATERIALCONTAINER_H
+#define SHMATERIALCONTAINER_H
+
+#include <QtGui/QScrollArea>
+using Qt::WindowFlags;
+
+class shMaterialInstance;
+class QResizeEvent;
+
+class shMaterialContainer : public QScrollArea
+{
+ Q_OBJECT
+
+ public:
+ shMaterialContainer( QWidget * pParent = 0,
+ const char * pName = 0,
+ WindowFlags f = 0 );
+
+ virtual ~shMaterialContainer();
+ virtual void notifyNewSelection(shMaterialInstance* pNewSelection);
+ int getPreviewWindowSize(){ return m_iPreviewCellSize; }
+ shMaterialInstance* getMaterial(unsigned int index);
+
+ public slots:
+ void onPreviewWindowResize(int);
+
+ protected:
+ virtual void resizeEvent(QResizeEvent*);
+ virtual void createPreviewCells( const QSize& parentSize );
+ virtual void updateLayout( const QSize& windowSize );
+
+ protected:
+ unsigned int m_iNumPreviewInstances;
+ unsigned int m_iPreviewCellSize;
+ unsigned int m_iInterCellGap;
+ std::vector<shMaterialInstance*> m_PreviewCells;
+
+ // widget that will contain the material preview windows. Its size
will be determined by the preview windows size and
+ // number. This will allow the shMaterialContainer to create
scrollbars as necessary.
+ QWidget* m_pMaterialInstanceContainer;
+
+ typedef QScrollArea ParentClass;
+};
+
+#endif // SHMATERIALCONTAINER_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shmaterialeditordialog.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,23 @@
+#ifndef SHMATERIALEDITORDIALOG_H
+#define SHMATERIALEDITORDIALOG_H
+
+#include <QtGui/QDialog>
+
+namespace Ui {
+ class shMaterialEditorDialog;
+}
+
+class shMaterialEditorDialog : public QDialog {
+ Q_OBJECT
+public:
+ shMaterialEditorDialog(QWidget *parent = 0);
+ ~shMaterialEditorDialog();
+
+private:
+ Ui::shMaterialEditorDialog *m_ui;
+
+private slots:
+ void on_parameterTest_clicked();
+};
+
+#endif // SHMATERIALEDITORDIALOG_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shmaterialinstance.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,38 @@
+#ifndef SHMATERIALINSTANCE_H
+#define SHMATERIALINSTANCE_H
+
+#include "qtwidgets/shaderz_qtviewwidget.h"
+#include "shShaderProgram.h"
+
+class shMaterialContainer;
+
+/**
+ * This class will hold the code for displaying the material instance
preview in the material editor.
+ */
+class shMaterialInstance : public shaderzQtViewWidget
+{
+ public:
+ shMaterialInstance( QWidget * pParent = 0,
+ shMaterialContainer* pContainer=0,
+ const char * pName = 0,
+ const QGLWidget * pShareWidget = 0,
+ WindowFlags f = 0,
+ std::string sSceneFilePath = ""
+ );
+ virtual void drawSelectionBox(void);
+ virtual void setSelected(bool bIsSelected = true);
+ virtual void loadScene(std::string);
+ virtual void setShader(shShaderProgram* shader);
+
+ protected: // events
+ virtual void mousePressEvent ( QMouseEvent * e );
+ virtual void paintGL();
+
+ protected:
+ shMaterialContainer* m_pContainer;
+ bool m_bIsSelected;
+
+ typedef shaderzQtViewWidget ParentClass;
+};
+
+#endif // SHMATERIALINSTANCE_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shparameterwidgetui.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,30 @@
+#ifndef SHPARAMETERWIDGETUI_H
+#define SHPARAMETERWIDGETUI_H
+
+#include "shdefs.h"
+#include "shshaderinfo.h"
+#include "qtwidgets/shcontainerwidget.h"
+
+class shParameterWidgetUI : public Shaderz::shWidget
+{
+public:
+ shParameterWidgetUI(Shaderz::shWidget* pParent, const
Shaderz::shShaderInfo::shShaderParameter& paramInfo);
+ ~shParameterWidgetUI();
+ void initialize();
+
+public slots:
+ void resizeEvent( Shaderz::shResizeEvent* pEventInfo );
+
+protected:
+ const Shaderz::shShaderInfo::shShaderParameter& m_paramInfo;
+ int m_iBorder;
+ Shaderz::shLabel* m_pLabel; // label
for the parameter.
+ std::vector<shParameterWidgetUI*> m_members; // members
of the widget if it is a struct
+
+ void handleStructParameters(const
Shaderz::shShaderInfo::shShaderParameter& paramInfo);
+
+private:
+ typedef Shaderz::shWidget ParentClass;
+};
+
+#endif // SHPARAMETERWIDGETUI_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shshaderinfo.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,103 @@
+#ifndef SHSHADERINFO_H
+#define SHSHADERINFO_H
+
+#include "shdefs.h"
+#include <CG/cg.h>
+#include <CG/cggl.h>
+#include <vector>
+
+namespace Shaderz
+{
+ typedef enum
+ {
+ SH_PARAMETERCLASS_UNKNOWN = 0,
+ SH_PARAMETERCLASS_SCALAR,
+ SH_PARAMETERCLASS_VECTOR,
+ SH_PARAMETERCLASS_MATRIX,
+ SH_PARAMETERCLASS_STRUCT,
+ SH_PARAMETERCLASS_ARRAY,
+ SH_PARAMETERCLASS_SAMPLER,
+ SH_PARAMETERCLASS_OBJECT,
+
+ SH_PARAMETERCLASS_MAX
+ } shParameterClass;
+
+ typedef enum
+ {
+ SH_PARAMETERTYPE_UNKNOWN = 0,
+ SH_PARAMETERTYPE_HALF,
+ SH_PARAMETERTYPE_INT,
+ SH_PARAMETERTYPE_FLOAT,
+ SH_PARAMETERTYPE_BOOL,
+ SH_PARAMETERTYPE_SAMPLER1D,
+ SH_PARAMETERTYPE_SAMPLER2D,
+ SH_PARAMETERTYPE_SAMPLER3D,
+ SH_PARAMETERTYPE_SAMPLERRECT,
+ SH_PARAMETERTYPE_SAMPLERCUBE,
+
+ SH_PARAMETERTYPE_MAX
+ } shParameterType;
+
+ /**
+ * Base class for shader program information.
+ */
+ class shShaderInfo
+ {
+ public:
+ struct shShaderParameter
+ {
+ Shaderz::shString name; // name of the parameter
as it exists in the shader
+ shParameterClass paramClass; // the class this
parameter belongs to
+ shParameterType paramType; // the type this
parameter belongs to
+ int rows; // the number of
rows (default=1 for all, >1 for matrix/vectors)
+ int columns; // the number of
columns for this parameter
+ std::vector<shShaderParameter> memberList; // the members
(iff this is a struct)
+ };
+
+ public:
+ shShaderInfo();
+ shShaderInfo(const std::string sShaderFile);
+ virtual ~shShaderInfo(){}
+
+ void setFile(const std::string sShaderFile);
+ virtual bool parseShader(void);
+ virtual const std::vector<shShaderParameter>& getParameters()
const { return m_parameterList; }
+ virtual void dumpParameterInfo(std::vector<shShaderParameter>*
pInParameterList = 0, int indentLevel=0);
+
+ protected:
+ virtual void initShaderInfo();
+
+ protected:
+ std::string m_sShaderFile;
+ std::vector<shShaderParameter> m_parameterList;
+ };
+
+ /**
+ * ShaderInfo implementation for shaders writen in CG
+ */
+ class shShaderInfoCG : public shShaderInfo
+ {
+ public:
+ shShaderInfoCG();
+ shShaderInfoCG(std::string sShaderFile);
+ virtual ~shShaderInfoCG(){}
+ virtual bool parseShader(void);
+
+ protected:
+ virtual void initShaderInfo();
+ virtual void collectParameterInfo( CGparameter currentParam,
std::vector<shShaderParameter>& paramRoot );
+ virtual bool getParameterInfo( const CGparameter& currentParam,
shShaderParameter& paramInfo ) const;
+ virtual shParameterClass translateCGParamClass( const
CGparameterclass& cgParamClass ) const;
+ virtual shParameterType translateCGParamType( const CGtype&
cgParamType ) const;
+ virtual bool getParamSizeInfo( const CGparameter& cgParam, int&
columns, int& rows ) const;
+
+ protected:
+ CGprogram m_ShaderHandle;
+ CGcontext m_Context;
+ CGprofile m_VertexProfile;
+
+ private:
+ typedef shShaderInfo ParentClass;
+ };
+}
+#endif // SHSHADERINFO_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shshaderparametercontainer.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,21 @@
+#ifndef SHSHADERPARAMETERCONTAINER_H
+#define SHSHADERPARAMETERCONTAINER_H
+
+#include "qtwidgets/shcontainerwidget.h"
+#include "shshaderinfo.h"
+
+class shShaderParameterContainer : public shContainerWidget
+{
+ Q_OBJECT
+
+public:
+ shShaderParameterContainer(Shaderz::shWidget* pParent);
+
+ void setupUI( const Shaderz::shShaderInfo* pShaderInfo );
+ void setupUI( const Shaderz::shShaderInfo::shShaderParameter&
paramInfo );
+
+private:
+ typedef shContainerWidget ParentClass;
+};
+
+#endif // SHSHADERPARAMETERCONTAINER_H
=======================================
--- /dev/null
+++ /trunk/old/inc/shshaderprogram.h Sun Sep 5 01:15:27 2010
@@ -0,0 +1,51 @@
+#ifndef SHSHADERPROGRAM_H
+#define SHSHADERPROGRAM_H
+
+#include <osgNVCg/Program>
+
+/**
+ * Base class for encapsulating the functionality to load a shader
program, and get information on its parameters.
+ * To use this class, simply create an object of appropriate class, call
setFileName and apply it to the stateset of the osgnode.
+ *
+ * Technical Note:
+ * The parent class doesn't expose much information on program
handles etc. Hence this class will create a local
+ * handle for the shader and extract information from it. This might
cause a double compilation of the shader.
+ */
+class shShaderProgram : public osgNVCg::Program
+{
+public:
+ shShaderProgram();
+ shShaderProgram(const shShaderProgram& rhs, const osg::CopyOp op =
osg::CopyOp::SHALLOW_COPY );
+ virtual ~shShaderProgram() {}
+
+ META_StateAttribute(shaderz, shShaderProgram, OSGNVCG_PROGRAM);
+
+ virtual void setFileName( std::string sFileName );
+ virtual bool parseShader(std::string sShaderFile);
+
+private:
+ typedef osgNVCg::Program ParentClass;
+};
+
+/**
+ * The CG extension of the shader program. This class deals with CG
shaders.
+ */
+class shShaderProgramCG : public shShaderProgram
+{
+ public:
+ shShaderProgramCG();
+ shShaderProgramCG(std::string sShaderFile);
+ shShaderProgramCG(const shShaderProgramCG& rhs, const osg::CopyOp
op = osg::CopyOp::SHALLOW_COPY );
+ virtual ~shShaderProgramCG(){}
+
+ META_StateAttribute(shaderz, shShaderProgramCG, OSGNVCG_PROGRAM);
+
+ virtual bool parseShader(std::string sShaderFile);
+ virtual void dumpParameterInfo(CGparameter, int) const;
+
+ private:
+ CGprogram m_ShaderHandle;
+ typedef shShaderProgram ParentClass;
+};
+
+#endif // SHSHADERPROGRAM_H
=======================================
--- /dev/null
+++ /trunk/old/src/main.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,11 @@
+#include <QtGui/QApplication>
+#include "shaderzmain.h"
+#include <iostream>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ shaderzMain w;
+ w.show();
+ return a.exec();
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shaderzmain.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,20 @@
+#include "shaderzmain.h"
+#include "ui_shaderzmain.h"
+#include "shmaterialeditordialog.h"
+
+shaderzMain::shaderzMain(QWidget *parent)
+ : QMainWindow(parent), ui(new Ui::shaderzMain)
+{
+ ui->setupUi(this);
+}
+
+shaderzMain::~shaderzMain()
+{
+ delete ui;
+}
+
+void shaderzMain::on_materialEditorButton_clicked()
+{
+ shMaterialEditorDialog* pMaterialEditorDialog = new
shMaterialEditorDialog(this);
+ pMaterialEditorDialog->show();
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shhud.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,31 @@
+#include "shHud.h"
+#include "shlogger.h"
+#include "osg/Geode"
+
+using namespace Shaderz;
+
+shHud::shHud()
+{
+ m_pHudCamera = new osg::Camera;
+ m_pHudCamera->setProjectionMatrix( osg::Matrix::ortho2D(0,1280,0,1024)
);
+ m_pHudCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
+ m_pHudCamera->setViewMatrix(osg::Matrix::identity());
+
+ // only clear the depth buffer
+ m_pHudCamera->setClearMask(GL_DEPTH_BUFFER_BIT);
+
+ // draw subgraph after main camera view.
+ m_pHudCamera->setRenderOrder(osg::Camera::POST_RENDER);
+
+ // we don't want the camera to grab event focus from the viewers main
camera(s).
+ m_pHudCamera->setAllowEventFocus(false);
+}
+
+void shHud::addChild( osg::Node* pNewNode )
+{
+ if( pNewNode )
+ {
+ m_pHudCamera->addChild(pNewNode);
+ }
+}
+
=======================================
--- /dev/null
+++ /trunk/old/src/shlogger.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,38 @@
+#include "shLogger.h"
+
+using namespace Shaderz;
+
+// static members
+bool shLogger::m_bLogToScreen = true;
+int shLogger::m_iCurLogLevel = shLogger::Warn;
+std::ofstream shLogger::m_logFile;
+
+ void shLogger::log( int messageLogLevel, std::string sMessage )
+ {
+ if( messageLogLevel >= m_iCurLogLevel )
+ {
+ if( m_logFile.is_open() )
+ {
+ m_logFile<<sMessage;
+ }
+ if( m_bLogToScreen )
+ {
+ std::cout<<sMessage;
+ }
+ }
+ }
+
+ void shLogger::setLogFile( std::string sLogFile )
+ {
+ m_logFile.open(sLogFile.c_str());
+ }
+
+ void shLogger::setLoggingToScreen( bool bEnableLogToScreen )
+ {
+ m_bLogToScreen = bEnableLogToScreen;
+ }
+
+ void shLogger::setLogLevel( int newLogLevel )
+ {
+ m_iCurLogLevel = newLogLevel;
+ }
=======================================
--- /dev/null
+++ /trunk/old/src/shmaterialcontainer.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,165 @@
+#include "shmaterialcontainer.h"
+#include "shmaterialinstance.h"
+#include "shlogger.h"
+#include <qevent>
+#include <QtGui/QScrollArea>
+
+shMaterialContainer::shMaterialContainer( QWidget * pParent,
+ const char *,
+ WindowFlags)
+ : ParentClass(pParent),
+ m_iNumPreviewInstances(12),
+ m_iPreviewCellSize(150),
+ m_iInterCellGap(10),
+ m_pMaterialInstanceContainer(0)
+{
+ m_PreviewCells.reserve(m_iNumPreviewInstances);
+}
+
+shMaterialContainer::~shMaterialContainer()
+{
+ unsigned int i;
+
+ // cleanup. Delete all the preview cells we have created.
+ for( i=0; i<m_PreviewCells.size(); ++i )
+ {
+ delete m_PreviewCells[i];
+ }
+}
+
+/**
+ * Override from parent class. Makes initial size calculations of the
material container window.
+ * Also responsible for creating the material preview cells.
+ *
+ * @param: pEventInfo Event information for the resize.
+ */
+void shMaterialContainer::resizeEvent( QResizeEvent* pEventInfo)
+{
+ ParentClass::resizeEvent(pEventInfo);
+
+ // adjust the preview windows according to the new size
+ if( !m_pMaterialInstanceContainer )
+ {
+ unsigned int nCellsPerRow = pEventInfo->size().width()/
(m_iPreviewCellSize + m_iInterCellGap);
+ unsigned int nRows = m_iNumPreviewInstances / nCellsPerRow;
+ nRows += (nRows * nCellsPerRow == m_iNumPreviewInstances) ? 0 : 1;
+ unsigned int totalWidth = nCellsPerRow * (m_iPreviewCellSize +
m_iInterCellGap);
+ unsigned int totalHeight = nRows * (m_iPreviewCellSize +
m_iInterCellGap) + m_iInterCellGap;
+
+ m_pMaterialInstanceContainer = new QWidget(nativeParentWidget());
+ m_pMaterialInstanceContainer->setGeometry( geometry().left(),
+ geometry().top(),
+ totalWidth,
+ totalHeight);
+
+ setBackgroundRole( QPalette::Dark );
+ setWidget(m_pMaterialInstanceContainer);
+
+ createPreviewCells(m_pMaterialInstanceContainer->size());
+ }
+}
+
+/**
+ * Creates and updates the layout of material preview cells.
+ *
+ * @param: parentSize Size of the material container window
+ */
+void shMaterialContainer::createPreviewCells( const QSize& parentSize )
+{
+ if( m_PreviewCells.size() > 0 )
+ {
+ WARN( "Preview cells already created. Returning early.\n" );
+ return;
+ }
+
+ // create the preview cells
+ for( unsigned int i=0; i<m_iNumPreviewInstances; ++i )
+ {
+ shMaterialInstance* pMaterialInstance = new
shMaterialInstance(m_pMaterialInstanceContainer /*draw parent*/,
+
this /*material container*/,
+ 0
/*name*/,
+ 0
/*shared widget*/,
+ 0
/*flag*/,
+ ""
/*preview model load path*/
+ );
+ m_PreviewCells.push_back(pMaterialInstance);
+ }
+
+ updateLayout( parentSize );
+}
+
+/**
+ * This function will arrange the material preview cells to match the
current size of the main window and the size of each
+ * cell.
+ *
+ * @param: windowSize The size of the container window
+ */
+void shMaterialContainer::updateLayout( const QSize& windowSize )
+{
+ shMaterialInstance* pMaterialInstance;
+ int nCellsPerRow = windowSize.width() / (m_iPreviewCellSize +
m_iInterCellGap);
+ int x, y;
+ int yMax; // to determine the "bottom" position of the last cell
+
+ x = y = yMax = m_iInterCellGap;
+
+ for( unsigned int i=0; i<m_iNumPreviewInstances; ++i )
+ {
+ pMaterialInstance = m_PreviewCells[i];
+ pMaterialInstance->setGeometry( x, y, m_iPreviewCellSize,
m_iPreviewCellSize );
+ yMax = y;
+
+ // determine the location of next cell
+ if( (i+1)%nCellsPerRow == 0 )
+ {
+ y += m_iPreviewCellSize + m_iInterCellGap;
+ x = m_iInterCellGap;
+ }
+ else
+ {
+ x += m_iPreviewCellSize + m_iInterCellGap;
+ }
+ }
+
+ // update the material container geometry
+ QRect matContainerGeo = m_pMaterialInstanceContainer->geometry();
+ matContainerGeo.setBottom(yMax + m_iPreviewCellSize + m_iInterCellGap
);
+ m_pMaterialInstanceContainer->setGeometry(matContainerGeo);
+}
+
+/**
+ * Called by the material instance to indicate that a new material has
been selected.
+ */
+void shMaterialContainer::notifyNewSelection(shMaterialInstance*
pNewSelection)
+{
+ if( !pNewSelection )
+ {
+ return;
+ }
+
+ unsigned int i;
+ shMaterialInstance* pMatInst = 0;
+ for( i=0; i<m_PreviewCells.size(); ++i )
+ {
+ if( m_PreviewCells[i] != pNewSelection )
+ {
+ pMatInst = static_cast<shMaterialInstance*>(m_PreviewCells[i]);
+ pMatInst->setSelected(false);
+ }
+ }
+ pNewSelection->setSelected(true);
+}
+
+/**
+ * Slot to handle the change in material preview cell/window size.
+ */
+void shMaterialContainer::onPreviewWindowResize(int newSize)
+{
+ m_iPreviewCellSize = newSize;
+ updateLayout(m_pMaterialInstanceContainer->size());
+}
+
+shMaterialInstance* shMaterialContainer::getMaterial(unsigned int index)
+{
+ return ( index < m_PreviewCells.size() ) ? m_PreviewCells[index] : 0;
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shmaterialeditordialog.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,47 @@
+#include "shmaterialeditordialog.h"
+#include "ui_shmaterialeditordialog.h"
+#include "shshaderprogram.h"
+#include "shmaterialinstance.h"
+#include "shshaderinfo.h"
+#include "shlogger.h"
+#include "QFileDialog"
+#include "QtGui/QLineEdit"
+#include "qtwidgets/shcontainerwidget.h"
+
+
+#include "QVBoxLayout"
+
+shMaterialEditorDialog::shMaterialEditorDialog(QWidget *parent) :
+ QDialog(parent),
+ m_ui(new Ui::shMaterialEditorDialog)
+{
+ m_ui->setupUi(this);
+
+ // set slider to initial size
+
m_ui->materialPreviewSizeCtrl->setValue(m_ui->materialContainerView->getPreviewWindowSize());
+}
+
+shMaterialEditorDialog::~shMaterialEditorDialog()
+{
+ delete m_ui;
+}
+
+void shMaterialEditorDialog::on_parameterTest_clicked()
+{
+/* shShaderProgram* sh = new shShaderProgramCG("
osgnvcg1.cg");
+ sh->addVectorParameter("LightVec")->set(osg::Vec4(0, 0, 1, 0));
+
sh->addStateMatrixParameter("ModelViewProj")->set(osgNV::StateMatrixParameterValue::MODELVIEW_PROJECTION);
+
sh->addStateMatrixParameter("ModelViewIT")->set(osgNV::StateMatrixParameterValue::MODELVIEW,
osgNV::StateMatrixParameterValue::INVERSE_TRANSPOSE);
+
+ shMaterialInstance* pMatInst =
m_ui->materialContainerView->getMaterial(0);
+ pMatInst->setShader(sh);
+*/
+ // test shader info
+ std::string sFile = QFileDialog::getOpenFileName( this, "Open Shader
file" ).toStdString();
+ Shaderz::shShaderInfo* pShaderInfo = new
Shaderz::shShaderInfoCG(sFile);
+ pShaderInfo->parseShader();
+
+ m_ui->testContainerWidget->setupUI(pShaderInfo);
+
+ delete pShaderInfo;
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shmaterialinstance.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,101 @@
+#include "shmaterialinstance.h"
+#include "shmaterialcontainer.h"
+#include "shlogger.h"
+#include "osg/PolygonMode"
+#include <osg/Geode>
+#include <osg/ShapeDrawable>
+
+shMaterialInstance::shMaterialInstance( QWidget * pParent,
+ shMaterialContainer* pContainer,
+ const char * pName,
+ const QGLWidget * pShareWidget,
+ WindowFlags f,
+ std::string sSceneFilePath)
+ : ParentClass(pParent, pName, pShareWidget, f,
sSceneFilePath),
+ m_pContainer(pContainer),
+ m_bIsSelected(false)
+{
+ // load scene. This class will load a sphere from 3ds file for now.
+ // todo: avoid loading a 3ds file and generate a sphere of your own
+ if( sSceneFilePath.length() == 0 )
+ {
+ loadScene("../../../data/sphere.3ds");
+ }
+}
+
+void shMaterialInstance::loadScene(std::string strModelPath)
+{
+ ParentClass::loadScene(strModelPath);
+ // osg::ref_ptr<osg::Geode> node = new osg::Geode;
+ // node->addDrawable(new osg::ShapeDrawable(new
osg::Sphere(osg::Vec3(0.0,0.0,0.0), 100)));
+
+ //m_pRoot = node;
+}
+
+void shMaterialInstance::drawSelectionBox(void)
+{
+ const int viewportSize = width(); // assume that it is a square (hence
width = height)
+ const int border = 3;
+ const int xMin = border;
+ const int yMin = border;
+ const int xMax = viewportSize - border;
+ const int yMax = viewportSize - border;
+
+ // draw on a viewport of fixed size (this is independent of the widget
size)
+ glViewport( 0, 0, viewportSize, viewportSize );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho( 0, viewportSize, 0, viewportSize, 0.1, 1000 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glTranslatef(0,0,-1);
+ glColor3f(1,1,1);
+
+ // finally draw the selection box
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(xMin, yMin);
+ glVertex2f(xMax, yMin);
+ glVertex2f(xMax, yMax);
+ glVertex2f(xMin, yMax);
+ glVertex2f(xMin, yMin);
+ glEnd();
+}
+
+void shMaterialInstance::mousePressEvent ( QMouseEvent * )
+{
+ // not calling the parent class mouse event, as we do not want the
user to be able to manipulate the default view of the material
+
+ if( m_pContainer )
+ {
+ m_pContainer->notifyNewSelection(this);
+ }
+}
+
+void shMaterialInstance::setSelected(bool bIsSelected)
+{
+ m_bIsSelected = bIsSelected;
+}
+
+void shMaterialInstance::paintGL()
+{
+ ParentClass::paintGL();
+
+ if( m_bIsSelected )
+ {
+ drawSelectionBox();
+ }
+}
+
+void shMaterialInstance::setShader(shShaderProgram* shader)
+{
+ if( !m_pRoot )
+ {
+ LOG<<"Root not set.\n";
+ return;
+ }
+
+ LOG<<"Setting shader...\n";
+ osg::StateSet* ss = m_pRoot->getOrCreateStateSet();
+ ss->setAttributeAndModes(shader);
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shparameterwidgetui.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,65 @@
+#include "include/shparameterwidgetui.h"
+#include "shlogger.h"
+
+using namespace Shaderz;
+
+shParameterWidgetUI::shParameterWidgetUI(Shaderz::shWidget* pParent, const
Shaderz::shShaderInfo::shShaderParameter& paramInfo)
+ : ParentClass(pParent)
+ ,m_paramInfo(paramInfo)
+ ,m_iBorder(5)
+ ,m_pLabel(0)
+{
+}
+
+shParameterWidgetUI::~shParameterWidgetUI()
+{
+ unsigned int i;
+ // delete struct members if any were created
+ for( i=0; i<m_members.size(); ++i )
+ {
+ delete m_members[i];
+ }
+ m_members.clear();
+
+ // delete the label
+ if( m_pLabel )
+ {
+ delete m_pLabel;
+ }
+}
+
+void shParameterWidgetUI::initialize()
+{
+ if( !m_pLabel )
+ {
+ LOG<<"creating label for "<<"\n";
+ shString labelStr = m_paramInfo.name;
+ if( SH_PARAMETERCLASS_STRUCT == m_paramInfo.paramClass )
+ {
+ labelStr = shString("Struct::") + labelStr;
+ }
+ m_pLabel = new shLabel( labelStr, this );
+ m_pLabel->setVisible(true);
+ }
+}
+
+void shParameterWidgetUI::resizeEvent( Shaderz::shResizeEvent* pEventInfo )
+{
+ ParentClass::resizeEvent(pEventInfo);
+}
+
+void shParameterWidgetUI::handleStructParameters(const
Shaderz::shShaderInfo::shShaderParameter& paramInfo)
+{
+ if( SH_PARAMETERCLASS_STRUCT != paramInfo.paramClass )
+ {
+ return;
+ }
+
+ unsigned int i;
+ for( i=0; i<paramInfo.memberList.size(); ++i )
+ {
+ shParameterWidgetUI* pNewWidget = new shParameterWidgetUI( this,
paramInfo.memberList[i] );
+ pNewWidget->initialize();
+ m_members.push_back(pNewWidget);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shshaderinfo.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,201 @@
+#include "shshaderinfo.h"
+#include "shlogger.h"
+
+using namespace Shaderz;
+
+shShaderInfo::shShaderInfo()
+{
+}
+
+shShaderInfo::shShaderInfo(const std::string sShaderFile)
+{
+ setFile(sShaderFile);
+}
+
+void shShaderInfo::setFile(const std::string sShaderFile)
+{
+ m_sShaderFile = sShaderFile;
+}
+
+bool shShaderInfo::parseShader(void)
+{
+ return false;
+}
+
+void shShaderInfo::initShaderInfo()
+{
+ // nothing to be done here
+}
+
+void shShaderInfo::dumpParameterInfo(std::vector<shShaderParameter>*
pInParameterList, int indentLevel)
+{
+ unsigned int index;
+ std::vector<shShaderParameter> parameterRoot = pInParameterList ?
*pInParameterList : m_parameterList;
+ for( index=0; index < parameterRoot.size(); ++index )
+ {
+ for( int indentIndex=0; indentIndex<indentLevel; ++indentIndex )
LOG<<"\t";
+ LOG<<parameterRoot[index].name.toAscii().constData()<<" ";
+ LOG<<"Class="<<parameterRoot[index].paramClass<<" ";
+ LOG<<"Type="<<parameterRoot[index].paramType<<" ";
+ LOG<<"Size="<<parameterRoot[index].columns<<"
x "<<parameterRoot[index].rows;
+ if( SH_PARAMETERCLASS_STRUCT == parameterRoot[index].paramClass )
+ {
+ LOG<<"\n";
+ dumpParameterInfo( ¶meterRoot[index].memberList,
indentLevel+1 );
+ }
+ LOG<<"\n";
+ }
+}
+
+
+//////
+// shShaderInfoCG
+/////
+shShaderInfoCG::shShaderInfoCG()
+ : ParentClass()
+{
+ initShaderInfo();
+}
+
+shShaderInfoCG::shShaderInfoCG(std::string sShaderFile)
+ : ParentClass(sShaderFile)
+{
+ initShaderInfo();
+}
+
+bool shShaderInfoCG::parseShader(void)
+{
+ ParentClass::parseShader();
+
+ LOG<<"Parsing shader: "<<m_sShaderFile<<"\nContext="<<m_Context<<"\n";
+ m_ShaderHandle = cgCreateProgramFromFile( m_Context, CG_SOURCE,
m_sShaderFile.c_str(), m_VertexProfile, "main", 0 );
+ if( m_ShaderHandle == 0 )
+ {
+ LOG<<"Failed to create program handle.\n";
+ CGerror err = cgGetError();
+ LOG<<"CgErr = "<<cgGetErrorString(err)<<"\n";
+ return false;
+ }
+ // search for Global and Program parameters
+ CGenum query[] = { CG_GLOBAL, CG_PROGRAM };
+ for( unsigned int i=0; i<sizeof(query)/sizeof(query[0]); ++i )
+ {
+ CGparameter pParam = cgGetFirstParameter( m_ShaderHandle,
query[i] );
+ collectParameterInfo( pParam, m_parameterList );
+ }
+
+ dumpParameterInfo();
+
+ return true;
+}
+
+void shShaderInfoCG::collectParameterInfo( CGparameter currentParam,
std::vector<shShaderParameter>& paramRoot )
+{
+ while(currentParam)
+ {
+ struct shShaderParameter paramInfo;
+ getParameterInfo( currentParam, paramInfo );
+ if( SH_PARAMETERCLASS_STRUCT == paramInfo.paramClass )
+ {
+ CGparameter structParam =
cgGetFirstStructParameter(currentParam);
+ collectParameterInfo(structParam, paramInfo.memberList);
+ }
+ paramRoot.push_back(paramInfo);
+ currentParam = cgGetNextParameter( currentParam );
+ }
+}
+
+shParameterClass shShaderInfoCG::translateCGParamClass( const
CGparameterclass& cgParamClass ) const
+{
+ switch(cgParamClass)
+ {
+ case CG_PARAMETERCLASS_SCALAR: return SH_PARAMETERCLASS_SCALAR;
+ case CG_PARAMETERCLASS_VECTOR: return SH_PARAMETERCLASS_VECTOR;
+ case CG_PARAMETERCLASS_MATRIX: return SH_PARAMETERCLASS_MATRIX;
+ case CG_PARAMETERCLASS_STRUCT: return SH_PARAMETERCLASS_STRUCT;
+ case CG_PARAMETERCLASS_ARRAY: return SH_PARAMETERCLASS_ARRAY;
+ case CG_PARAMETERCLASS_SAMPLER: return SH_PARAMETERCLASS_SAMPLER;
+ case CG_PARAMETERCLASS_OBJECT: return SH_PARAMETERCLASS_OBJECT;
+ case CG_PARAMETERCLASS_UNKNOWN:
+ case CG_PARAMETERCLASS_MAX:
+ default: return SH_PARAMETERCLASS_UNKNOWN;
+ }
+
+ return SH_PARAMETERCLASS_UNKNOWN;
+}
+
+shParameterType shShaderInfoCG::translateCGParamType( const CGtype&
cgParamType ) const
+{
+ switch(cgParamType)
+ {
+ case CG_HALF: return SH_PARAMETERTYPE_HALF;
+ case CG_INT: return SH_PARAMETERTYPE_INT;
+ case CG_FLOAT: return SH_PARAMETERTYPE_FLOAT;
+ case CG_BOOL: return SH_PARAMETERTYPE_BOOL;
+ case CG_SAMPLER1D: return SH_PARAMETERTYPE_SAMPLER1D;
+ case CG_SAMPLER2D: return SH_PARAMETERTYPE_SAMPLER2D;
+ case CG_SAMPLER3D: return SH_PARAMETERTYPE_SAMPLER3D;
+ case CG_SAMPLERRECT: return SH_PARAMETERTYPE_SAMPLERRECT;
+ case CG_SAMPLERCUBE: return SH_PARAMETERTYPE_SAMPLERCUBE;
+ default: return SH_PARAMETERTYPE_UNKNOWN;
+ }
+
+ return SH_PARAMETERTYPE_UNKNOWN;
+}
+
+bool shShaderInfoCG::getParamSizeInfo( const CGparameter& cgParam, int&
columns, int& rows ) const
+{
+ // create the initial mapping for type and size of parameters
+ struct cgParamTypeSizeMapping
+ {
+ CGtype _type;
+ int _col;
+ int _rows;
+ };
+
+#define CG_DATATYPE_MACRO(name, compiler_name, enum_name, base_name,
ncols, nrows, pc) \
+ {enum_name, ncols, nrows},
+
+ cgParamTypeSizeMapping map[] = {
+#include <CG/cg_datatypes.h>
+ };
+#undef CG_DATATYPE_MACRO
+
+ CGtype paramType = cgGetParameterType(cgParam);
+ unsigned int mapIndex;
+ for( mapIndex=0; mapIndex < sizeof(map)/sizeof(map[0]); ++mapIndex )
+ {
+ if( paramType == map[mapIndex]._type )
+ {
+ columns = map[mapIndex]._col;
+ rows = map[mapIndex]._rows;
+ break;
+ }
+ }
+
+ return true;
+}
+
+void shShaderInfoCG::initShaderInfo()
+{
+ m_Context = cgCreateContext();
+ if( m_Context == 0 )
+ {
+ LOG<<"Failed to create context.\n";
+ }
+
+ m_VertexProfile = cgGLGetLatestProfile( CG_GL_VERTEX );
+ if( m_VertexProfile == CG_PROFILE_UNKNOWN )
+ {
+ LOG<<"Failed to get profile.\n";
+ }
+}
+
+bool shShaderInfoCG::getParameterInfo( const CGparameter& currentParam,
shShaderParameter& paramInfo ) const
+{
+ paramInfo.name = cgGetParameterName(currentParam);
+ paramInfo.paramClass = translateCGParamClass(
cgGetParameterClass(currentParam) );
+ paramInfo.paramType =
translateCGParamType(cgGetParameterBaseType(currentParam));
+ getParamSizeInfo( currentParam, paramInfo.columns, paramInfo.rows );
+ return true;
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shshaderparametercontainer.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,88 @@
+#include "include/shshaderparametercontainer.h"
+#include "shdefs.h"
+#include "shparameterwidgetui.h"
+#include "shlogger.h"
+
+using namespace Shaderz;
+
+shShaderParameterContainer::shShaderParameterContainer(shWidget* pParent)
+ : ParentClass(pParent)
+{
+ setLayout(shContainerWidget::SHCONTAINERLAYOUT_TopToBottom);
+ setWrap(shContainerWidget::SHCONTAINERWRAP_Off);
+}
+
+void shShaderParameterContainer::setupUI( const shShaderInfo* pShaderInfo )
+{
+ if( !pShaderInfo )
+ {
+ return;
+ }
+
+ // hack to prevent overwriting of parameter labels
+ setGridSizeX(100);
+ setGridSizeY(60);
+
+ const std::vector<shShaderInfo::shShaderParameter>& paramList =
pShaderInfo->getParameters();
+ unsigned int index;
+ int maxWidth = 0;
+ int maxHeight = 0;
+ for( index=0; index<paramList.size(); ++index )
+ {
+ Shaderz::shWidget* pNewChild = 0;
+ if( SH_PARAMETERCLASS_STRUCT == paramList[index].paramClass )
+ {
+ shShaderParameterContainer* pNewContainer = new
shShaderParameterContainer(container());
+
pNewContainer->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ pNewContainer->setupUI( paramList[index] );
+ pNewContainer->resizeToFitChildren();
+ pNewChild = pNewContainer;
+ }
+ else
+ {
+ shParameterWidgetUI* pNewParamWidget = new
shParameterWidgetUI( container(), paramList[index]);
+ pNewParamWidget->initialize();
+ pNewChild = pNewParamWidget;
+ }
+ pNewChild->setVisible(true);
+ maxWidth = (maxWidth > pNewChild->geometry().width()) ? maxWidth :
pNewChild->geometry().width();
+ maxHeight = (maxHeight > pNewChild->geometry().height()) ?
maxHeight : pNewChild->geometry().height();
+ addChildWidget( pNewChild );
+ }
+
+ // todo: review the code for expansion to largest child
+/*
+ // expand the grid according to the largest child
+ bool updateRequired = false;
+ if( maxWidth > gridSizeX() )
+ {
+ setGridSizeX(maxWidth, false);
+ updateRequired = true;
+ }
+ if( maxHeight > gridSizeY() )
+ {
+ setGridSizeY(maxHeight, false);
+ updateRequired = true;
+ }
+ if( updateRequired )
+ {
+ updateChildrenPositions();
+ }
+ */
+}
+
+void shShaderParameterContainer::setupUI( const
Shaderz::shShaderInfo::shShaderParameter& paramInfo )
+{
+ if( SH_PARAMETERCLASS_STRUCT != paramInfo.paramClass )
+ {
+ return;
+ }
+
+ unsigned int i;
+ for( i=0; i<paramInfo.memberList.size(); ++i )
+ {
+ shParameterWidgetUI* pNewWidget = new shParameterWidgetUI(
container(), paramInfo.memberList[i] );
+ pNewWidget->initialize();
+ addChildWidget(pNewWidget);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/old/src/shshaderprogram.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,84 @@
+#include "shshaderprogram.h"
+#include "shlogger.h"
+
+shShaderProgram::shShaderProgram()
+ : osgNVCg::Program(new osgNVCg::Context, osgNVCg::Program::BEST_VP)
+{
+}
+
+shShaderProgram::shShaderProgram(const shShaderProgram& rhs, const
osg::CopyOp op )
+ : ParentClass(rhs, op)
+{
+}
+
+bool shShaderProgram::parseShader(std::string sShaderFile)
+{
+ // nothing to do in base class
+ return false;
+}
+
+void shShaderProgram::setFileName(std::string sShaderFileName)
+{
+ parseShader(sShaderFileName);
+ ParentClass::setFileName(sShaderFileName);
+}
+
+//////////
+// shShaderProgramCG
+//////////
+shShaderProgramCG::shShaderProgramCG()
+ : ParentClass()
+{
+}
+
+shShaderProgramCG::shShaderProgramCG(std::string sShaderFile)
+ : ParentClass()
+{
+ ParentClass::setFileName(sShaderFile);
+ parseShader(sShaderFile);
+}
+
+shShaderProgramCG::shShaderProgramCG(const shShaderProgramCG& rhs, const
osg::CopyOp op )
+ : ParentClass(rhs, op)
+{
+ m_ShaderHandle = rhs.m_ShaderHandle;
+}
+
+bool shShaderProgramCG::parseShader(std::string sShaderFile)
+{
+ if( !cgIsProgram(m_ShaderHandle) )
+ {
+ LOG<<"program not compiled.\n";
+ return false;
+ }
+
+ CGenum query[] = { CG_GLOBAL, CG_PROGRAM };
+ for( unsigned int i=0; i<sizeof(query)/sizeof(query[0]); ++i )
+ {
+ LOG<<"--------------------\n";
+ CGparameter pParam = cgGetFirstParameter( m_ShaderHandle, query[i]
);
+ dumpParameterInfo( pParam, 0 );
+ }
+
+ return true;
+}
+
+void shShaderProgramCG::dumpParameterInfo( CGparameter pParam, int
indentLevel ) const
+{
+ while(pParam)
+ {
+ for( int k=0; k<indentLevel; ++k) LOG<<" ";
+ LOG<<"param: "<<cgGetParameterName(pParam)<<" ";
+ LOG<<cgGetTypeString(cgGetParameterNamedType(pParam))<<" ";
+ LOG<<cgGetParameterClass(pParam)<<" ";
+ LOG<<cgGetParameterSemantic(pParam)<<" * ";
+ LOG<<"\n";
+
+ if( cgGetParameterClass(pParam) == CG_PARAMETERCLASS_STRUCT )
+ {
+ CGparameter structParam = cgGetFirstStructParameter(pParam);
+ dumpParameterInfo(structParam, indentLevel+1);
+ }
+ pParam = cgGetNextParameter( pParam );
+ }
+}
=======================================
--- /dev/null
+++ /trunk/shaderz.xcodeproj/vijayjoseph.mode1v3 Sun Sep 5 01:15:27 2010
@@ -0,0 +1,1360 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST
1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ActivePerspectiveName</key>
+ <string>Project</string>
+ <key>AllowedModules</key>
+ <array>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Name</key>
+ <string>Groups and Files Outline View</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Name</key>
+ <string>Editor</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCTaskListModule</string>
+ <key>Name</key>
+ <string>Task List</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Name</key>
+ <string>File and Smart Group Detail Viewer</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXBuildResultsModule</string>
+ <key>Name</key>
+ <string>Detailed Build Results Viewer</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ <key>Name</key>
+ <string>Project Batch Find Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCProjectFormatConflictsModule</string>
+ <key>Name</key>
+ <string>Project Format Conflicts List</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXBookmarksModule</string>
+ <key>Name</key>
+ <string>Bookmarks Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXClassBrowserModule</string>
+ <key>Name</key>
+ <string>Class Browser</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ <key>Name</key>
+ <string>Source Code Control Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXDebugBreakpointsModule</string>
+ <key>Name</key>
+ <string>Debug Breakpoints Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCDockableInspector</string>
+ <key>Name</key>
+ <string>Inspector</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXOpenQuicklyModule</string>
+ <key>Name</key>
+ <string>Open Quickly Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXDebugSessionModule</string>
+ <key>Name</key>
+ <string>Debugger</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXDebugCLIModule</string>
+ <key>Name</key>
+ <string>Debug Console</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCSnapshotModule</string>
+ <key>Name</key>
+ <string>Snapshots Tool</string>
+ </dict>
+ </array>
+ <key>BundlePath</key>
+
<string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
+ <key>Description</key>
+ <string>DefaultDescriptionKey</string>
+ <key>DockingSystemVisible</key>
+ <false/>
+ <key>Extension</key>
+ <string>mode1v3</string>
+ <key>FavBarConfig</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>49C7DC701232ABF600E24C8D</string>
+ <key>XCBarModuleItemNames</key>
+ <dict/>
+ <key>XCBarModuleItems</key>
+ <array/>
+ </dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
+ <key>Identifier</key>
+ <string>com.apple.perspectives.project.mode1v3</string>
+ <key>MajorVersion</key>
+ <integer>33</integer>
+ <key>MinorVersion</key>
+ <integer>0</integer>
+ <key>Name</key>
+ <string>Default</string>
+ <key>Notifications</key>
+ <array/>
+ <key>OpenEditors</key>
+ <array/>
+ <key>PerspectiveWidths</key>
+ <array>
+ <integer>-1</integer>
+ <integer>-1</integer>
+ </array>
+ <key>Perspectives</key>
+ <array>
+ <dict>
+ <key>ChosenToolbarItems</key>
+ <array>
+ <string>active-target-popup</string>
+ <string>active-buildstyle-popup</string>
+ <string>action</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>buildOrClean</string>
+ <string>build-and-goOrGo</string>
+ <string>com.apple.ide.PBXToolbarStopButton</string>
+ <string>get-info</string>
+ <string>toggle-editor</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>com.apple.pbx.toolbar.searchfield</string>
+ </array>
+ <key>ControllerClassBaseName</key>
+ <string></string>
+ <key>IconName</key>
+ <string>WindowOfProjectWithEditor</string>
+ <key>Identifier</key>
+ <string>perspective.project</string>
+ <key>IsVertical</key>
+ <false/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <true/>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C37FBAC04509CD000000102</string>
+ <string>1C37FAAC04509CD000000102</string>
+ <string>1C08E77C0454961000C914BD</string>
+ <string>1C37FABC05509CD000000102</string>
+ <string>1C37FABC05539CD112110102</string>
+ <string>E2644B35053B69B200211256</string>
+ <string>1C37FABC04509CD000100104</string>
+ <string>1CC0EA4004350EF90044410B</string>
+ <string>1CC0EA4004350EF90041110B</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>yes</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>186</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>49C7DC641232ABF100E24C8D</string>
+ <string>49C7DC861232AFB600E24C8D</string>
+ <string>49C7DC871232AFB600E24C8D</string>
+ <string>49C7DC8C1232AFB600E24C8D</string>
+ <string>49C7DC8D1232AFB600E24C8D</string>
+ <string>1C37FABC05509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>12</integer>
+ <integer>10</integer>
+ <integer>9</integer>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {186, 338}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <true/>
+ <key>XCSharingToken</key>
+ <string>com.apple.Xcode.GFSharingToken</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {203, 356}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>186</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>797 328 690 397 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>203pt</string>
+ </dict>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B20306471E060097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B20406471E060097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string></string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {482, 0}}</string>
+ <key>RubberWindowFrame</key>
+ <string>797 328 690 397 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>0pt</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B20506471E060097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Detail</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 5}, {482, 351}}</string>
+ <key>RubberWindowFrame</key>
+ <string>797 328 690 397 0 0 1280 778 </string>
+ </dict>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Proportion</key>
+ <string>351pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>482pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>PBXSmartGroupTreeModule</string>
+ <string>XCModuleDock</string>
+ <string>PBXNavigatorGroup</string>
+ <string>XCDetailModule</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>49C7DC6E1232ABF600E24C8D</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>49C7DC6F1232ABF600E24C8D</string>
+ <string>1CE0B20306471E060097A5F4</string>
+ <string>1CE0B20506471E060097A5F4</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.defaultV3</string>
+ </dict>
+ <dict>
+ <key>ControllerClassBaseName</key>
+ <string></string>
+ <key>IconName</key>
+ <string>WindowOfProject</string>
+ <key>Identifier</key>
+ <string>perspective.morph</string>
+ <key>IsVertical</key>
+ <integer>0</integer>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C37FBAC04509CD000000102</string>
+ <string>1C37FAAC04509CD000000102</string>
+ <string>1C08E77C0454961000C914BD</string>
+ <string>1C37FABC05509CD000000102</string>
+ <string>1C37FABC05539CD112110102</string>
+ <string>E2644B35053B69B200211256</string>
+ <string>1C37FABC04509CD000100104</string>
+ <string>1CC0EA4004350EF90044410B</string>
+ <string>1CC0EA4004350EF90041110B</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>11E0B1FE06471DED0097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>yes</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>186</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>29B97314FDCFA39411CA2CEA</string>
+ <string>1C37FABC05509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {186, 337}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <integer>1</integer>
+ <key>XCSharingToken</key>
+ <string>com.apple.Xcode.GFSharingToken</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {203, 355}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>186</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>373 269 690 397 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Morph</string>
+ <key>PreferredWidth</key>
+ <integer>300</integer>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>PBXSmartGroupTreeModule</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>11E0B1FE06471DED0097A5F4</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.default.shortV3</string>
+ </dict>
+ </array>
+ <key>PerspectivesBarVisible</key>
+ <false/>
+ <key>ShelfIsVisible</key>
+ <false/>
+ <key>SourceDescription</key>
+ <string>file
at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
+ <key>StatusbarIsVisible</key>
+ <true/>
+ <key>TimeStamp</key>
+ <real>0.0</real>
+ <key>ToolbarDisplayMode</key>
+ <integer>1</integer>
+ <key>ToolbarIsVisible</key>
+ <true/>
+ <key>ToolbarSizeMode</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Perspectives</string>
+ <key>UpdateMessage</key>
+ <string>The Default Workspace in this version of Xcode now includes
support to hide and show the detail view (what has been referred to as
the "Metro-Morph" feature). You must discard your current Default
Workspace settings and update to the latest Default Workspace in order to
gain this feature. Do you wish to update to the latest Workspace defaults
for project '%@'?</string>
+ <key>WindowJustification</key>
+ <integer>5</integer>
+ <key>WindowOrderList</key>
+ <array>
+ <string>/Users/vijayjoseph/projects/shaderz/shaderz.xcodeproj</string>
+ </array>
+ <key>WindowString</key>
+ <string>797 328 690 397 0 0 1280 778 </string>
+ <key>WindowToolsV3</key>
+ <array>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.build</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528F0623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD052900623707200166675</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {500, 215}}</string>
+ <key>RubberWindowFrame</key>
+ <string>192 257 500 500 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>218pt</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>XCMainBuildResultsModuleGUID</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Build</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 222}, {500, 236}}</string>
+ <key>RubberWindowFrame</key>
+ <string>192 257 500 500 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXBuildResultsModule</string>
+ <key>Proportion</key>
+ <string>236pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>458pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Build Results</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXBuildResultsModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EAA5065D492600B07095</string>
+ <string>1C78EAA6065D492600B07095</string>
+ <string>1CD0528F0623707200166675</string>
+ <string>XCMainBuildResultsModuleGUID</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.buildV3</string>
+ <key>WindowString</key>
+ <string>192 257 500 500 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.debugger</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>Debugger</key>
+ <dict>
+ <key>HorizontalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {317, 164}}</string>
+ <string>{{317, 0}, {377, 164}}</string>
+ </array>
+ </dict>
+ <key>VerticalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {694, 164}}</string>
+ <string>{{0, 164}, {694, 216}}</string>
+ </array>
+ </dict>
+ </dict>
+ <key>LauncherConfigVersion</key>
+ <string>8</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C162984064C10D400B95A72</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Debug - GLUTExamples (Underwater)</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>DebugConsoleDrawerSize</key>
+ <string>{100, 120}</string>
+ <key>DebugConsoleVisible</key>
+ <string>None</string>
+ <key>DebugConsoleWindowFrame</key>
+ <string>{{200, 200}, {500, 300}}</string>
+ <key>DebugSTDIOWindowFrame</key>
+ <string>{{200, 200}, {500, 300}}</string>
+ <key>Frame</key>
+ <string>{{0, 0}, {694, 380}}</string>
+ <key>RubberWindowFrame</key>
+ <string>321 238 694 422 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXDebugSessionModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debugger</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXDebugSessionModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1CD10A99069EF8BA00B06720</string>
+ <string>1C0AD2AB069F1E9B00FABCE6</string>
+ <string>1C162984064C10D400B95A72</string>
+ <string>1C0AD2AC069F1E9B00FABCE6</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.debugV3</string>
+ <key>WindowString</key>
+ <string>321 238 694 422 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1CD10A99069EF8BA00B06720</string>
+ <key>WindowToolIsVisible</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.find</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CDD528C0622207200134675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528D0623707200166675</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {781, 167}}</string>
+ <key>RubberWindowFrame</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>781pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>50%</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528E0623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Project Find</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{8, 0}, {773, 254}}</string>
+ <key>RubberWindowFrame</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ <key>Proportion</key>
+ <string>50%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>428pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project Find</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXProjectFindModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <string>1C530D58069F1CE1000CFCEE</string>
+ <string>1C530D59069F1CE1000CFCEE</string>
+ <string>1CDD528C0622207200134675</string>
+ <string>1C530D5A069F1CE1000CFCEE</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>1CD0528E0623707200166675</string>
+ </array>
+ <key>WindowString</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <key>WindowToolIsVisible</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>MENUSEPARATOR</string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.debuggerConsole</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAAC065D492600B07095</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Debugger Console</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {650, 250}}</string>
+ <key>RubberWindowFrame</key>
+ <string>516 632 650 250 0 0 1680 1027 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXDebugCLIModule</string>
+ <key>Proportion</key>
+ <string>209pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>209pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debugger Console</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXDebugCLIModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EAAD065D492600B07095</string>
+ <string>1C78EAAE065D492600B07095</string>
+ <string>1C78EAAC065D492600B07095</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.consoleV3</string>
+ <key>WindowString</key>
+ <string>650 41 650 250 0 0 1280 1002 </string>
+ <key>WindowToolGUID</key>
+ <string>1C78EAAD065D492600B07095</string>
+ <key>WindowToolIsVisible</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.snapshots</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>XCSnapshotModule</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Snapshots</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCSnapshotModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <string>Yes</string>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.snapshots</string>
+ <key>WindowString</key>
+ <string>315 824 300 550 0 0 1440 878 </string>
+ <key>WindowToolIsVisible</key>
+ <string>Yes</string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.scm</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAB2065D492600B07095</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAB3065D492600B07095</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {452, 0}}</string>
+ <key>RubberWindowFrame</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>0pt</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD052920623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>SCM</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>ConsoleFrame</key>
+ <string>{{0, 259}, {452, 0}}</string>
+ <key>Frame</key>
+ <string>{{0, 7}, {452, 259}}</string>
+ <key>RubberWindowFrame</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ <key>TableConfiguration</key>
+ <array>
+ <string>Status</string>
+ <real>30</real>
+ <string>FileName</string>
+ <real>199</real>
+ <string>Path</string>
+ <real>197.09500122070312</real>
+ </array>
+ <key>TableFrame</key>
+ <string>{{0, 0}, {452, 250}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ <key>Proportion</key>
+ <string>262pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>266pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>SCM</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXCVSModule</string>
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /trunk/shaderz.xcodeproj/vijayjoseph.pbxuser Sun Sep 5 01:15:27 2010
@@ -0,0 +1,148 @@
+// !$*UTF8*$!
+{
+ 49C7DC661232ABF100E24C8D /* Project object */ = {
+ activeArchitecture = i386;
+ activeBuildConfigurationName = Debug;
+ addToTargets = (
+ );
+ codeSenseManager = 49C7DC6B1232ABF100E24C8D /* Code sense */;
+ ignoreBreakpointsInProjectsDict = {
+ };
+ perUserDictionary = {
+ PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey =
PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 243,
+ 20,
+ 48.16259765625,
+ 43,
+ 43,
+ 20,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ PBXFileDataSource_Target_ColumnID,
+ );
+ };
+ PBXPerProjectTemplateStateSaveDate = 305310706;
+ PBXWorkspaceStateSaveDate = 305310706;
+ };
+ sourceControlManager = 49C7DC6A1232ABF100E24C8D /* Source Control */;
+ userBuildSettings = {
+ };
+ };
+ 49C7DC6A1232ABF100E24C8D /* Source Control */ = {
+ isa = PBXSourceControlManager;
+ fallbackIsa = XCSourceControlManager;
+ isSCMEnabled = 0;
+ scmConfiguration = {
+ };
+ };
+ 49C7DC6B1232ABF100E24C8D /* Code sense */ = {
+ isa = PBXCodeSenseManager;
+ indexTemplatePath = "";
+ };
+ 49C7DC811232ACD900E24C8D /* CMakeLists.txt */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {988, 1840}}";
+ sepNavSelRange = "{2901, 40}";
+ sepNavVisRange = "{3080, 851}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC881232AFB600E24C8D /* osgadapterwidget.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1023, 1776}}";
+ sepNavSelRange = "{1035, 20}";
+ sepNavVisRange = "{2213, 1410}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC891232AFB600E24C8D /* qtmainwindow.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 646}}";
+ sepNavSelRange = "{386, 15}";
+ sepNavVisRange = "{0, 474}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC8A1232AFB600E24C8D /* qtshaderzviewwidget.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {883, 646}}";
+ sepNavSelRange = "{0, 1}";
+ sepNavVisRange = "{0, 895}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC8B1232AFB600E24C8D /* shlogger.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 646}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 921}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC8E1232AFB600E24C8D /* osgadapterwidget.cpp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {827, 1216}}";
+ sepNavSelRange = "{800, 90}";
+ sepNavVisRange = "{956, 1220}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC8F1232AFB600E24C8D /* qtmainwindow.cpp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 912}}";
+ sepNavSelRange = "{687, 0}";
+ sepNavVisRange = "{161, 911}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC901232AFB600E24C8D /* qtshaderzviewwidget.cpp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 768}}";
+ sepNavSelRange = "{1163, 0}";
+ sepNavVisRange = "{313, 913}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC911232AFB600E24C8D /* shmain.cpp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 646}}";
+ sepNavSelRange = "{177, 0}";
+ sepNavVisRange = "{0, 222}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DC921232AFB600E24C8D /* shlogger.cpp */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 646}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 791}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DCA81232C9EF00E24C8D /* shdefs.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 646}}";
+ sepNavSelRange = "{0, 3}";
+ sepNavVisRange = "{0, 157}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+ 49C7DCE51232DB5D00E24C8D /* ReadMe.txt */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {743, 646}}";
+ sepNavSelRange = "{79, 0}";
+ sepNavVisRange = "{0, 79}";
+ sepNavWindowFrame = "{{15, -1}, {802, 774}}";
+ };
+ };
+}
=======================================
--- /dev/null
+++ /trunk/src/qt/osgadapterwidget.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,75 @@
+#include "qt/osgadapterwidget.h"
+
+using namespace osg;
+
+AdapterWidget::AdapterWidget( QWidget * parent, const char * /*name*/,
const QGLWidget * shareWidget, WindowFlags f):
+#if USE_QT4
+ QGLWidget(parent, shareWidget, f)
+#else
+ QGLWidget(parent, name, shareWidget, f)
+#endif
+{
+ _gw = new osgViewer::GraphicsWindowEmbedded(0,0,width(),height());
+#if USE_QT4
+ setFocusPolicy(Qt::ClickFocus);
+#else
+ setFocusPolicy(QWidget::ClickFocus);
+#endif
+}
+
+void AdapterWidget::resizeGL( int width, int height )
+{
+ _gw->getEventQueue()->windowResize(0, 0, width, height );
+ _gw->resized(0,0,width,height);
+}
+
+void AdapterWidget::keyPressEvent( QKeyEvent* event )
+{
+#if USE_QT4
+ _gw->getEventQueue()->keyPress( (osgGA::GUIEventAdapter::KeySymbol)
*(event->text().toAscii().data() ) );
+#else
+ _gw->getEventQueue()->keyPress( (osgGA::GUIEventAdapter::KeySymbol)
event->ascii() );
+#endif
+}
+
+void AdapterWidget::keyReleaseEvent( QKeyEvent* event )
+{
+#if USE_QT4
+ _gw->getEventQueue()->keyRelease( (osgGA::GUIEventAdapter::KeySymbol)
*(event->text().toAscii().data() ) );
+#else
+ _gw->getEventQueue()->keyRelease( (osgGA::GUIEventAdapter::KeySymbol)
event->ascii() );
+#endif
+}
+
+void AdapterWidget::mousePressEvent( QMouseEvent* event )
+{
+ int button = 0;
+ switch(event->button())
+ {
+ case(Qt::LeftButton): button = 1; break;
+ case(Qt::MidButton): button = 2; break;
+ case(Qt::RightButton): button = 3; break;
+ case(Qt::NoButton): button = 0; break;
+ default: button = 0; break;
+ }
+ _gw->getEventQueue()->mouseButtonPress(event->x(), event->y(), button);
+}
+
+void AdapterWidget::mouseReleaseEvent( QMouseEvent* event )
+{
+ int button = 0;
+ switch(event->button())
+ {
+ case(Qt::LeftButton): button = 1; break;
+ case(Qt::MidButton): button = 2; break;
+ case(Qt::RightButton): button = 3; break;
+ case(Qt::NoButton): button = 0; break;
+ default: button = 0; break;
+ }
+ _gw->getEventQueue()->mouseButtonRelease(event->x(), event->y(),
button);
+}
+
+void AdapterWidget::mouseMoveEvent( QMouseEvent* event )
+{
+ _gw->getEventQueue()->mouseMotion(event->x(), event->y());
+}
=======================================
--- /dev/null
+++ /trunk/src/qt/qtmainwindow.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,55 @@
+#include "qt/qtMainWindow.h"
+
+using namespace Shaderz;
+
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include "qt/qtshaderzviewwidget.h"
+#include "shlogger.h"
+
+qtMainWindow::qtMainWindow()
+ : ParentClass(0)
+{
+ QBoxLayout* mainLayout = new QVBoxLayout;
+ mainLayout->setContentsMargins( 10, 10, 10, 10 );
+
+ // put the browse button and viewport in a horizontal line
+ QHBoxLayout* hLayout = new QHBoxLayout;
+ {
+ // create the browse button
+ QPushButton* browseButton = new QPushButton("Browse");
+
+ connect( browseButton, SIGNAL(clicked()), this, SLOT(OnClickedBrowse())
);
+ hLayout->addWidget(browseButton);
+
+ // add some spacing
+ hLayout->addSpacing(10);
+
+ // create the main view widget
+ qtShaderzViewWidget* viewWidget = new qtShaderzViewWidget(this);
+ hLayout->addWidget(viewWidget);
+ }
+ mainLayout->addItem(hLayout);
+
+ QLayout* currentLayout = layout();
+ if( currentLayout )
+ {
+ currentLayout->addItem(mainLayout);
+ }
+ else
+ {
+ setLayout( mainLayout );
+ }
+
+ setGeometry(100, 100, 800, 600);
+}
+
+qtMainWindow::~qtMainWindow()
+{
+}
+
+void qtMainWindow::OnClickedBrowse()
+{
+ LOG<<"Clicked browse button. Put your code changes here.\n";
+}
=======================================
--- /dev/null
+++ /trunk/src/qt/qtshaderzviewwidget.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,47 @@
+#include "qt/qtshaderzviewwidget.h"
+#include "shlogger.h"
+
+qtShaderzViewWidget::qtShaderzViewWidget( QWidget * pParent,
+ const char * pName,
+ const QGLWidget * pShareWidget,
+ WindowFlags f,
+ std::string sSceneFilePath )
+ : osg::ViewerQT(pParent, pName, pShareWidget, f),
+ m_pRoot(0)
+{
+ if( sSceneFilePath.length() > 0 )
+ {
+ loadScene(sSceneFilePath);
+ }
+}
+
+void qtShaderzViewWidget::loadScene(std::string sModelFilePath)
+{
+ if( m_pRoot )
+ {
+ return;
+ }
+
+ m_pRoot = osgDB::readNodeFile(sModelFilePath);
+ if( m_pRoot.valid() )
+ {
+ setCameraManipulator(new osgGA::TrackballManipulator);
+ setSceneData(m_pRoot.get());
+ }
+
+ LOG<<"Loading scene: "<<sModelFilePath<<" "<<m_pRoot<<"\n";
+
+}
+
+// events
+void qtShaderzViewWidget::resizeGL( int w, int h )
+{
+ if( !m_pRoot )
+ {
+ // log error and load default
+ INFO( "shaderQtViewWidget doesn't have a valid scene loaded.
Loading default.\n" );
+ loadScene("defaultScene.3ds");
+ }
+
+ osg::ViewerQT::resizeGL(w,h);
+}
=======================================
--- /dev/null
+++ /trunk/src/shmain.cpp Sun Sep 5 01:15:27 2010
@@ -0,0 +1,12 @@
+#include <QtGui/QApplication>
+#include "qt/qtMainWindow.h"
+
+using namespace Shaderz;
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ qtMainWindow mainWindow;
+ mainWindow.show();
+ return a.exec();
+}
=======================================
--- /trunk/Info.plist Thu Dec 24 16:19:14 2009
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist
SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
-<dict>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleExecutable</key>
- <string>shaderz</string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.shaderz</string>
- <key>NOTE</key>
- <string>This file was generated by Qt/QMake.</string>
-</dict>
-</plist>
=======================================
--- /trunk/MakefileOSG Fri Dec 25 16:38:02 2009
+++ /dev/null
@@ -1,23 +0,0 @@
-OSG_DEFINES =-DUSE_QT4
-OSG_INCLUDE =-I../OpenSceneGraph/include -I./include
-OSG_LIBFLAGS =-isysroot /Developer/SDKs/MacOSX10.5.sdk
-mmacosx-version-min=10.5 -mmacosx-version-min=10.5
-Wl,-search_paths_first -headerpad_max_install_names
-
-OSG_CPPFLAGS =-isysroot /Developer/SDKs/MacOSX10.5.sdk
-mmacosx-version-min=10.5 -mmacosx-version-min=10.5 -Wl,
-headerpad_max_install_names $(OSG_DEFINES) $(OSG_INCLUDE)
-OSG_LIBS
=$(OSG_LIBFLAGS) ../OpenSceneGraph/lib/libOpenThreads.2.4.0.dylib ../OpenSceneGraph/lib/libosg.2.8.2.dylib ../OpenSceneGraph/lib/libosgDB.2.8.2.dylib ../OpenSceneGraph/lib/libosgUtil.2.8.2.dylib ../OpenSceneGraph/lib/libosgGA.2.8.2.dylib ../OpenSceneGraph/lib/libosgViewer.2.8.2.dylib ../OpenSceneGraph/lib/libosgText.2.8.2.dylib
-framework QtCore -framework QtGui -framework QtOpenGL -lpthread
/usr/lib/libm.dylib -framework Carbon -framework AGL -framework OpenGL
-
-QMAKE =qmake
-SCRATCH_FILE =scratchFile.txt
-
-patch: Makefile
- @echo Patching Makefile...
- @$(QMAKE)
- @echo Including OSG flags...
- @sed -e 's%(CXXFLAGS)%(CXXFLAGS) $(OSG_CPPFLAGS)%' Makefile >
$(SCRATCH_FILE)
- @rm Makefile
- @mv $(SCRATCH_FILE) Makefile
- @sed -e 's%(LIBS)%(LIBS) $(OSG_LIBS)%' Makefile > $(SCRATCH_FILE)
- @rm Makefile
- @mv $(SCRATCH_FILE) Makefile
- @echo Patching complete!
- @make -f Makefile
-
=======================================
--- /trunk/include/shaderzmain.h Wed May 12 12:24:14 2010
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef SHADERZMAIN_H
-#define SHADERZMAIN_H
-
-#include <QtGui/QMainWindow>
-
-namespace Ui
-{
- class shaderzMain;
-}
-
-class shaderzMain : public QMainWindow
-{
- Q_OBJECT
-
-public:
- shaderzMain(QWidget *parent = 0);
- ~shaderzMain();
-
-private:
- Ui::shaderzMain *ui;
-
-private slots:
- void on_actionLoad_Scene_activated();
- void on_materialEditorButton_clicked();
-};
-
-#endif // SHADERZMAIN_H
=======================================
--- /trunk/include/shhud.h Fri Jan 1 19:07:15 2010
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef SHHUD_H
-#define SHHUD_H
-
-#include "osg/Camera"
-#include "osg/Geometry"
-
-namespace Shaderz
-{
- class shHud
- {
- public:
- shHud();
- void addChild( osg::Node* pNewNode );
- osg::ref_ptr<osg::Camera> getCamera(void) { return
m_pHudCamera; }
-
- private:
- osg::ref_ptr<osg::Camera> m_pHudCamera;
- };
-}
-#endif // SHHUD_H
=======================================
--- /trunk/include/shmaterialcontainer.h Thu Mar 11 14:28:24 2010
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef SHMATERIALCONTAINER_H
-#define SHMATERIALCONTAINER_H
-
-#include <QtGui/QScrollArea>
-using Qt::WindowFlags;
-
-class shMaterialInstance;
-class QResizeEvent;
-
-class shMaterialContainer : public QScrollArea
-{
- Q_OBJECT
-
- public:
- shMaterialContainer( QWidget * pParent = 0,
- const char * pName = 0,
- WindowFlags f = 0 );
-
- virtual ~shMaterialContainer();
- virtual void notifyNewSelection(shMaterialInstance* pNewSelection);
- int getPreviewWindowSize(){ return m_iPreviewCellSize; }
- shMaterialInstance* getMaterial(unsigned int index);
-
- public slots:
- void onPreviewWindowResize(int);
-
- protected:
- virtual void resizeEvent(QResizeEvent*);
- virtual void createPreviewCells( const QSize& parentSize );
- virtual void updateLayout( const QSize& windowSize );
-
- protected:
- unsigned int m_iNumPreviewInstances;
- unsigned int m_iPreviewCellSize;
- unsigned int m_iInterCellGap;
- std::vector<shMaterialInstance*> m_PreviewCells;
-
- // widget that will contain the material preview windows. Its size
will be determined by the preview windows size and
- // number. This will allow the shMaterialContainer to create
scrollbars as necessary.
- QWidget* m_pMaterialInstanceContainer;
-
- typedef QScrollArea ParentClass;
-};
-
-#endif // SHMATERIALCONTAINER_H
=======================================
--- /trunk/include/shmaterialeditordialog.h Thu Mar 11 14:28:24 2010
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef SHMATERIALEDITORDIALOG_H
-#define SHMATERIALEDITORDIALOG_H
-
-#include <QtGui/QDialog>
-
-namespace Ui {
- class shMaterialEditorDialog;
-}
-
-class shMaterialEditorDialog : public QDialog {
- Q_OBJECT
-public:
- shMaterialEditorDialog(QWidget *parent = 0);
- ~shMaterialEditorDialog();
-
-private:
- Ui::shMaterialEditorDialog *m_ui;
-
-private slots:
- void on_parameterTest_clicked();
-};
-
-#endif // SHMATERIALEDITORDIALOG_H
=======================================
--- /trunk/include/shmaterialinstance.h Thu Mar 11 14:28:24 2010
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef SHMATERIALINSTANCE_H
-#define SHMATERIALINSTANCE_H
-
-#include "qtwidgets/shaderz_qtviewwidget.h"
-#include "shShaderProgram.h"
-
-class shMaterialContainer;
-
-/**
- * This class will hold the code for displaying the material instance
preview in the material editor.
- */
-class shMaterialInstance : public shaderzQtViewWidget
-{
- public:
- shMaterialInstance( QWidget * pParent = 0,
- shMaterialContainer* pContainer=0,
- const char * pName = 0,
- const QGLWidget * pShareWidget = 0,
- WindowFlags f = 0,
- std::string sSceneFilePath = ""
- );
- virtual void drawSelectionBox(void);
- virtual void setSelected(bool bIsSelected = true);
- virtual void loadScene(std::string);
- virtual void setShader(shShaderProgram* shader);
-
- protected: // events
- virtual void mousePressEvent ( QMouseEvent * e );
- virtual void paintGL();
-
- protected:
- shMaterialContainer* m_pContainer;
- bool m_bIsSelected;
-
- typedef shaderzQtViewWidget ParentClass;
-};
-
-#endif // SHMATERIALINSTANCE_H
=======================================
--- /trunk/include/shparameterwidgetui.h Sat Mar 27 20:07:00 2010
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef SHPARAMETERWIDGETUI_H
-#define SHPARAMETERWIDGETUI_H
-
-#include "shdefs.h"
-#include "shshaderinfo.h"
-#include "qtwidgets/shcontainerwidget.h"
-
-class shParameterWidgetUI : public Shaderz::shWidget
-{
-public:
- shParameterWidgetUI(Shaderz::shWidget* pParent, const
Shaderz::shShaderInfo::shShaderParameter& paramInfo);
- ~shParameterWidgetUI();
- void initialize();
-
-public slots:
- void resizeEvent( Shaderz::shResizeEvent* pEventInfo );
-
-protected:
- const Shaderz::shShaderInfo::shShaderParameter& m_paramInfo;
- int m_iBorder;
- Shaderz::shLabel* m_pLabel; // label
for the parameter.
- std::vector<shParameterWidgetUI*> m_members; // members
of the widget if it is a struct
-
- void handleStructParameters(const
Shaderz::shShaderInfo::shShaderParameter& paramInfo);
-
-private:
- typedef Shaderz::shWidget ParentClass;
-};
-
-#endif // SHPARAMETERWIDGETUI_H
=======================================
--- /trunk/include/shshaderinfo.h Sun Mar 21 14:48:06 2010
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef SHSHADERINFO_H
-#define SHSHADERINFO_H
-
-#include "shdefs.h"
-#include <CG/cg.h>
-#include <CG/cggl.h>
-#include <vector>
-
-namespace Shaderz
-{
- typedef enum
- {
- SH_PARAMETERCLASS_UNKNOWN = 0,
- SH_PARAMETERCLASS_SCALAR,
- SH_PARAMETERCLASS_VECTOR,
- SH_PARAMETERCLASS_MATRIX,
- SH_PARAMETERCLASS_STRUCT,
- SH_PARAMETERCLASS_ARRAY,
- SH_PARAMETERCLASS_SAMPLER,
- SH_PARAMETERCLASS_OBJECT,
-
- SH_PARAMETERCLASS_MAX
- } shParameterClass;
-
- typedef enum
- {
- SH_PARAMETERTYPE_UNKNOWN = 0,
- SH_PARAMETERTYPE_HALF,
- SH_PARAMETERTYPE_INT,
- SH_PARAMETERTYPE_FLOAT,
- SH_PARAMETERTYPE_BOOL,
- SH_PARAMETERTYPE_SAMPLER1D,
- SH_PARAMETERTYPE_SAMPLER2D,
- SH_PARAMETERTYPE_SAMPLER3D,
- SH_PARAMETERTYPE_SAMPLERRECT,
- SH_PARAMETERTYPE_SAMPLERCUBE,
-
- SH_PARAMETERTYPE_MAX
- } shParameterType;
-
- /**
- * Base class for shader program information.
- */
- class shShaderInfo
- {
- public:
- struct shShaderParameter
- {
- Shaderz::shString name; // name of the parameter
as it exists in the shader
- shParameterClass paramClass; // the class this
parameter belongs to
- shParameterType paramType; // the type this
parameter belongs to
- int rows; // the number of
rows (default=1 for all, >1 for matrix/vectors)
- int columns; // the number of
columns for this parameter
- std::vector<shShaderParameter> memberList; // the members
(iff this is a struct)
- };
-
- public:
- shShaderInfo();
- shShaderInfo(const std::string sShaderFile);
- virtual ~shShaderInfo(){}
-
- void setFile(const std::string sShaderFile);
- virtual bool parseShader(void);
- virtual const std::vector<shShaderParameter>& getParameters()
const { return m_parameterList; }
- virtual void dumpParameterInfo(std::vector<shShaderParameter>*
pInParameterList = 0, int indentLevel=0);
-
- protected:
- virtual void initShaderInfo();
-
- protected:
- std::string m_sShaderFile;
- std::vector<shShaderParameter> m_parameterList;
- };
-
- /**
- * ShaderInfo implementation for shaders writen in CG
- */
- class shShaderInfoCG : public shShaderInfo
- {
- public:
- shShaderInfoCG();
- shShaderInfoCG(std::string sShaderFile);
- virtual ~shShaderInfoCG(){}
- virtual bool parseShader(void);
-
- protected:
- virtual void initShaderInfo();
- virtual void collectParameterInfo( CGparameter currentParam,
std::vector<shShaderParameter>& paramRoot );
- virtual bool getParameterInfo( const CGparameter& currentParam,
shShaderParameter& paramInfo ) const;
- virtual shParameterClass translateCGParamClass( const
CGparameterclass& cgParamClass ) const;
- virtual shParameterType translateCGParamType( const CGtype&
cgParamType ) const;
- virtual bool getParamSizeInfo( const CGparameter& cgParam, int&
columns, int& rows ) const;
-
- protected:
- CGprogram m_ShaderHandle;
- CGcontext m_Context;
- CGprofile m_VertexProfile;
-
- private:
- typedef shShaderInfo ParentClass;
- };
-}
-#endif // SHSHADERINFO_H
=======================================
--- /trunk/include/shshaderparametercontainer.h Sat Mar 27 20:07:00 2010
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef SHSHADERPARAMETERCONTAINER_H
-#define SHSHADERPARAMETERCONTAINER_H
-
-#include "qtwidgets/shcontainerwidget.h"
-#include "shshaderinfo.h"
-
-class shShaderParameterContainer : public shContainerWidget
-{
- Q_OBJECT
-
-public:
- shShaderParameterContainer(Shaderz::shWidget* pParent);
-
- void setupUI( const Shaderz::shShaderInfo* pShaderInfo );
- void setupUI( const Shaderz::shShaderInfo::shShaderParameter&
paramInfo );
-
-private:
- typedef shContainerWidget ParentClass;
-};
-
-#endif // SHSHADERPARAMETERCONTAINER_H
=======================================
--- /trunk/include/shshaderprogram.h Thu Mar 11 14:28:24 2010
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef SHSHADERPROGRAM_H
-#define SHSHADERPROGRAM_H
-
-#include <osgNVCg/Program>
-
-/**
- * Base class for encapsulating the functionality to load a shader
program, and get information on its parameters.
- * To use this class, simply create an object of appropriate class, call
setFileName and apply it to the stateset of the osgnode.
- *
- * Technical Note:
- * The parent class doesn't expose much information on program
handles etc. Hence this class will create a local
- * handle for the shader and extract information from it. This might
cause a double compilation of the shader.
- */
-class shShaderProgram : public osgNVCg::Program
-{
-public:
- shShaderProgram();
- shShaderProgram(const shShaderProgram& rhs, const osg::CopyOp op =
osg::CopyOp::SHALLOW_COPY );
- virtual ~shShaderProgram() {}
-
- META_StateAttribute(shaderz, shShaderProgram, OSGNVCG_PROGRAM);
-
- virtual void setFileName( std::string sFileName );
- virtual bool parseShader(std::string sShaderFile);
-
-private:
- typedef osgNVCg::Program ParentClass;
-};
-
-/**
- * The CG extension of the shader program. This class deals with CG
shaders.
- */
-class shShaderProgramCG : public shShaderProgram
-{
- public:
- shShaderProgramCG();
- shShaderProgramCG(std::string sShaderFile);
- shShaderProgramCG(const shShaderProgramCG& rhs, const osg::CopyOp
op = osg::CopyOp::SHALLOW_COPY );
- virtual ~shShaderProgramCG(){}
-
- META_StateAttribute(shaderz, shShaderProgramCG, OSGNVCG_PROGRAM);
-
- virtual bool parseShader(std::string sShaderFile);
- virtual void dumpParameterInfo(CGparameter, int) const;
-
- private:
- CGprogram m_ShaderHandle;
- typedef shShaderProgram ParentClass;
-};
-
-#endif // SHSHADERPROGRAM_H
=======================================
--- /trunk/main.cpp Thu Dec 24 16:19:14 2009
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <QtGui/QApplication>
-#include "shaderzmain.h"
-
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
- shaderzMain w;
- w.show();
- return a.exec();
-}
=======================================
--- /trunk/
shaderz.pro Sun Mar 21 14:48:06 2010
+++ /dev/null
@@ -1,88 +0,0 @@
-# -------------------------------------------------
-# Project created by QtCreator 2009-12-25T07:12:19
-# -------------------------------------------------
-# Vijay Michael Joseph: Modified for cross platform includes and libs -
06-01-2010 (DD-MM-YYYY)
-macx {
- message("Platform = mac")
- INCLUDEPATH = ../sdks/include \
- ./include
- QMAKE_CXXFLAGS += -isysroot \
- /Developer/SDKs/MacOSX10.5.sdk \
- -mmacosx-version-min=10.5 \
- -mmacosx-version-min=10.5 \
- -Wl, \
- -headerpad_max_install_names
- LIBS += ../sdks/lib/libOpenThreads.2.4.0.dylib \
- ../sdks/lib/libosg.2.8.2.dylib \
- ../sdks/lib/libosgDB.2.8.2.dylib \
- ../sdks/lib/libosgUtil.2.8.2.dylib \
- ../sdks/lib/libosgGA.2.8.2.dylib \
- ../sdks/lib/libosgViewer.2.8.2.dylib \
- ../sdks/lib/libosgText.2.8.2.dylib \
- ../sdks/lib/libosgNVCg.dylib \
- ../sdks/lib/libosgNV.dylib \
- ../sdks/lib/libosgNVExt.dylib \
- -framework \
- QtCore \
- -framework \
- QtGui \
- -framework \
- QtOpenGL \
- -lpthread \
- /usr/lib/libm.dylib \
- -framework \
- Carbon \
- -framework \
- AGL \
- -framework \
- OpenGL \
- -framework \
- Cg
-}
-else win32 {
- message("Platform = win32")
- INCLUDEPATH = ../sdks/include \
- ./include
- LIBS += ../sdks/lib/OpenThreads.lib \
- ../sdks/lib/osg.lib \
- ../sdks/lib/osgDB.lib \
- ../sdks/lib/osgUtil.lib \
- ../sdks/lib/osgGA.lib \
- ../sdks/lib/osgViewer.lib \
- ../sdks/lib/osgText.lib
-}
-DEFINES += USE_QT4
-QT += opengl
-TARGET = shaderz
-TEMPLATE = app
-OBJECTS_DIR = obj
-SOURCES += src/main.cpp \
- src/shaderzmain.cpp \
- src/qtwidgets/osgadapterwidget.cpp \
- src/shlogger.cpp \
- src/shmaterialinstance.cpp \
- src/shmaterialcontainer.cpp \
- src/shhud.cpp \
- src/qtwidgets/shaderz_qtviewwidget.cpp \
- src/shmaterialeditordialog.cpp \
- src/shshaderprogram.cpp \
- src/shshaderinfo.cpp \
- src/qtwidgets/shcontainerwidget.cpp \
- src/shshaderparametercontainer.cpp \
- src/shparameterwidgetui.cpp
-HEADERS += include/shaderzmain.h \
- include/qtwidgets/osgadapterwidget.h \
- include/shlogger.h \
- include/shmaterialinstance.h \
- include/shmaterialcontainer.h \
- include/shhud.h \
- include/qtwidgets/shaderz_qtviewwidget.h \
- include/shmaterialeditordialog.h \
- include/shshaderprogram.h \
- include/shshaderinfo.h \
- include/qtwidgets/shcontainerwidget.h \
- include/shdefs.h \
- include/shshaderparametercontainer.h \
- include/shparameterwidgetui.h
-FORMS += ui/shaderzmain.ui \
- ui/shmaterialeditordialog.ui
=======================================
***Additional files exist in this changeset.***