Commit 4b92dc76 authored by Jan Möbius's avatar Jan Möbius

Added non working version for philips display

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7478 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b78c81ea
......@@ -436,7 +436,8 @@ bool dataDir(QString _dir);
enum StereoMode {
OpenGL,
AnaglyphRedCyan,
AnaglyphCustom
AnaglyphCustom,
Philips
};
/// Store opengl stereo support setting
......
......@@ -728,7 +728,15 @@ glViewer::drawScene_stereo()
// if somthing went wrong, fallback to normal anaglyph
if (customAnaglyphSupported_)
return;
} else if (OpenFlipper::Options::stereoMode () == OpenFlipper::Options::Philips )
{
drawScenePhilipsStereo ();
return;
}
drawScene_anaglyphStereo ();
}
......
......@@ -533,6 +533,9 @@ private:
// helper called to cleanup custom anaglyph stereo
void finiCustomAnaglyphStereo();
// Draws the scene for a philips stereo display ( Header, left color image, right depth map )
void drawScenePhilipsStereo();
//-------------------------------------------------------------- protected data
protected:
......
......@@ -58,6 +58,8 @@
#include <OpenFlipper/common/GlobalOptions.hh>
#include <QGLFramebufferObject>
//== NAMESPACES ===============================================================
......@@ -149,6 +151,71 @@ glViewer::drawScene_glStereo()
}
void
glViewer::drawScenePhilipsStereo()
{
std::cerr << "Rendering into new buffer" << std::endl;
QGLFramebufferObject* buffer = new QGLFramebufferObject (glWidth (), glHeight (), QGLFramebufferObject::Depth);
buffer->bind();
drawScene_mono();
// buffer->drawTexture(QRectF(0,0,1,1),buffer->texture());
QImage image = buffer->toImage();
image.save("test.jpg");
buffer->release();
// glBindTexture(GL_TEXTURE_2D, buffer->texture());
// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// // glEnable(GL_TEXTURE_2D);
// glEnable(GL_BLEND);
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// glDisable(GL_DEPTH_TEST);
//
// glColor3f(1.0,1.0,1.0);
//
// // draw into the GL widget
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// glMatrixMode(GL_PROJECTION);
// // glPushMatrix();
//
// glLoadIdentity();
// glOrtho(-1, 1, -1, 1, 10, 100);
//
//
// glMatrixMode(GL_MODELVIEW);
// // glPushMatrix();
// glLoadIdentity();
// // glViewport(0, 0, glWidth(), glHeight());
//
//
//
// glBegin(GL_QUADS);
// {
//
// glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 15.0f);
// glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 15.0f);
// glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 15.0f);
// glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 15.0f);
//
// }
// glEnd();
//
// glDisable(GL_TEXTURE_2D);
//
//
// // glPopMatrix();
//
// glMatrixMode(GL_PROJECTION);
// glPopMatrix();
}
//-----------------------------------------------------------------------------
......
......@@ -207,6 +207,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
stereoOpengl->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::OpenGL);
stereoAnaglyph->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphRedCyan);
stereoCustomAnaglyph->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::AnaglyphCustom);
stereoPhilips->setChecked (OpenFlipper::Options::stereoMode() == OpenFlipper::Options::Philips);
eyeDistance->setValue (OpenFlipper::Options::eyeDistance());
focalDistance->setValue (OpenFlipper::Options::focalDistance() * 1000);
......@@ -500,7 +501,9 @@ void OptionsWidget::slotApply() {
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphCustom);
else if (stereoAnaglyph->isChecked ())
OpenFlipper::Options::stereoMode(OpenFlipper::Options::AnaglyphRedCyan);
else
else if (stereoPhilips->isChecked() )
OpenFlipper::Options::stereoMode(OpenFlipper::Options::Philips);
else
OpenFlipper::Options::stereoMode(OpenFlipper::Options::OpenGL);
OpenFlipper::Options::eyeDistance(eyeDistance->value ());
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>670</width>
<height>863</height>
<height>917</height>
</rect>
</property>
<property name="windowTitle">
......@@ -23,7 +23,7 @@
<string/>
</property>
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
......@@ -658,6 +658,13 @@ You can select multiple modes at the same time.</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="stereoPhilips">
<property name="text">
<string>Philips Stereo Mode (For 3D autostereoskopic displays)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment