Re: [osg-users] 答复: Blank screen

2015-01-31 Thread Philip Taylor
It is possible that the MFC screen needs to be told to repaint. 

If so, try sending a WM_PAINT message to the screen by using CWnd::Invalidate();

PhilT

-Original Message-
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
Of padd...@gmx.net
Sent: 31 January 2015 10:55
To: OpenSceneGraph Users
Subject: Re: [osg-users] 答复: Blank screen

Hi Clement,

about your second screen: if you create your OpenGL context on the external 
screen - have you checked if this screen also has hardware acceleration? I 
remember having a smimilar behaviour with another toolkit. Black screen when 
creating the OGL context not on the primary screen with OGL hardware 
acceleration enabled...

Perhaps this is a hint...

Greets,

Patrik


On 31.01.2015 11:43, Robert Osfield wrote:
 Hi Clement,

 I'm afraid I can't help you, I not a windows expert and don't know MFC 
 at all, I'm not the author of the osgviewerMFC example.

 The code snippets you have provide don't really give me any clues to 
 what might be amiss.

 I don't have any means of recreating the problems you are seeing with 
 your application, or you hardware and data.

 All I can say it general it is possible to changing window sizes, and 
 it is possible to create new windows without problems, others do and 
 I've done it lots myself but never with MFC.  I have no clue with it's 
 a MFC specific issue you are up against, or how you've gone around 
 implementing it.

 Robert.

 On 31 January 2015 at 03:12, clement@csiro.au 
 mailto:clement@csiro.au wrote:

 Hi Robert,

This is the code for showing image in MFC window. (I followed the
 osgviewerMFC example).

 osg::ref_ptrosg::GraphicsContext::Traits traits = new
 osg::GraphicsContext::Traits;
 traits-x = 0;
 traits-y = 0;
 traits-windowDecoration = false;
 traits-doubleBuffer = true;
 traits-sharedContext = 0;
 traits-setInheritedWindowPixelFormat = true;
 traits-width = rect.right - rect.left;
 traits-height = rect.bottom - rect.top;
 traits-inheritedWindowData = new
 osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);
 osg::ref_ptrosg::GraphicsContext gc =
 osg::GraphicsContext::createGraphicsContext(traits.get());
 osgCamera-setGraphicsContext(gc.get());

 It requires to set window handle (HWND) into Trait to show image
 into MFC window.  The window decoration is already set to false.  If
 I changed the size, the osgViewer is still inside the MFC window.  I
 would like to switch the osgviewer to display on external monitor
 (full screen) programmatically.  I tried many methods and seems I
 can do it with creating a new GraphicsContext and new Trait without
 assign any HWND and specify the screen number, such as...

 osg::GraphicsContext::WindowingSystemInterface* wsi =
 osg::GraphicsContext::getWindowingSystemInterface();
 osg::GraphicsContext::ScreenIdentifier si;
 si.readDISPLAY();
 traits-hostName = si.hostName;
 traits-displayNum = si.displayNum;
 traits-screenNum = si.screenNum;


 The method seems working fine, but the image is already blank at the
 first.  Once I changed DisplaySettings with grayscale and stereo
 mode, the image will come out properly.  I would like to know why
 replaced a new GraphicsContext with existing camera will cause the
 blank problem and why the image can show up again after changing
 some display settings.  Or I already did a wrong way to switch the
 current viewer to show on full screen.  Please advise.  Thanks.



 Regards,
 Clement




 
 发件人: osg-users [osg-users-boun...@lists.openscenegraph.org
 mailto:osg-users-boun...@lists.openscenegraph.org] 代表 Robert
 Osfield [robert.osfi...@gmail.com mailto:robert.osfi...@gmail.com]
 发送时间: 2015年1月31日 03:18
 收件人: OpenSceneGraph Users
 主题: Re: [osg-users] Blank screen

 Hi Clement,

 My guess is that way you hacking the screen size change by creating
 a new context is screwing up the way context ID's and OpenGL objects
 are managed.

 My recommendation would be to just switch off window decoration and
 change the window size of the context rather than creating a new one.

 Robert.

 On 30 January 2015 at 16:04,
 clement@csiro.aumailto:clement@csiro.au
 mailto:clement@csiro.au wrote:
 Hi all,

I am trying to output my volume image on full screen with MFC by
 changing GraphicsContext in camera.  First I get GraphicsContext
 from camera and then close it.  Then I created a new GraphicsContext
 with setting screen number and size of full screen and then set it
 to camera.  It works to show full screen and also restore back to
 mfc window, but the image cannot show probably.  There is no image
 on screen (volume data) and show the axes I drawn only.  If I
 changed the display 

[osg-users] (no subject)

2015-01-31 Thread philippe renon
Hi,
Compilation of osg 3.2.1 against Qt 5.4.0 (mingw) was working perfectly fine.
After switching to 3.3.3 we are seeing this compilation error :
In file included from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopengl.h:123:0,
 from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/qgl.h:39,
 from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/QGLWidget:1,
 from 
d:/Projects/OpenPilot/3rdparty/osg/include/osgQt/GraphicsWindowQt:17,
 from 
d:\Projects\OpenPilot\3rdparty\osg\examples\osgviewerQt\osgviewerQt.cpp:12:
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h:10653:130:
 error: 'GLintptrARB' has not been declared
 typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint 
video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);

The issue comes from a conflict between 
   osg/include/osg/BufferObjectand   
qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h
within the section starting with:   #ifndef GL_ARB_vertex_buffer_object
   #define GL_ARB_vertex_buffer_object
I beleive that this issue was introduced by openscenegraph/osg

|   |
|   |  |   |   |   |   |   |
| openscenegraph/osgosg - OpenSceneGraph git mirror |
|  |
| Afficher sur github.com | Aperçu par Yahoo |
|  |
|   |


Regards,Philippe.
  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] (no subject)

2015-01-31 Thread Robert Osfield
Hi Philippe,

Could you try removing the #define GL_ARB_vertex_buffer_object line from
the include/osg/BufferObject header to see if that allows the Qt header to
compile fine.

Robert.

On 31 January 2015 at 20:44, philippe renon philippe_re...@yahoo.fr wrote:

 Hi,

 Compilation of osg 3.2.1 against Qt 5.4.0 (mingw) was working perfectly
 fine.

 After switching to 3.3.3 we are seeing this compilation error :

 In file included from
 d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopengl.h:123:0,
  from
 d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/qgl.h:39,
  from
 d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/QGLWidget:1,
  from
 d:/Projects/OpenPilot/3rdparty/osg/include/osgQt/GraphicsWindowQt:17,
  from
 d:\Projects\OpenPilot\3rdparty\osg\examples\osgviewerQt\osgviewerQt.cpp:12:
 d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h:10653:130:
 error: 'GLintptrARB' has not been declared
  typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint
 video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);

 The issue comes from a conflict between
osg/include/osg/BufferObject
 and
qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h

 within the section starting with:
#ifndef GL_ARB_vertex_buffer_object
#define GL_ARB_vertex_buffer_object

 I beleive that this issue was introduced by openscenegraph/osg
 https://github.com/openscenegraph/osg/commit/2c9d3671404583e797e9fdd5cc7687985c1bdf3b#diff-9e6bea70325f4962c2d5c856e6e5001c


 [image: image]
 https://github.com/openscenegraph/osg/commit/2c9d3671404583e797e9fdd5cc7687985c1bdf3b#diff-9e6bea70325f4962c2d5c856e6e5001c





 openscenegraph/osg
 https://github.com/openscenegraph/osg/commit/2c9d3671404583e797e9fdd5cc7687985c1bdf3b#diff-9e6bea70325f4962c2d5c856e6e5001c
 osg - OpenSceneGraph git mirror
 Afficher sur github.com
 https://github.com/openscenegraph/osg/commit/2c9d3671404583e797e9fdd5cc7687985c1bdf3b#diff-9e6bea70325f4962c2d5c856e6e5001c
 Aperçu par Yahoo


 Regards,
 Philippe.


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] (no subject)

2015-01-31 Thread philippe renon
I am also seeing this warnings multiple times:
[ 92%] Building CXX object 
src/applications/osgearth_package_qt/CMakeFiles/application_osgearth_package_qt.dir/package_qt.cpp.obj
In file included from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopengl.h:123:0,
 from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/qgl.h:39,
 from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/QGLWidget:1,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osgQt/GraphicsWindowQt:17,
 from 
d:/Projects/OpenPilot/3rdparty/osgearth/src/osgEarthQt/ViewerWidget:26,
 from 
d:\Projects\OpenPilot\3rdparty\osgearth\src\applications\osgearth_package_qt\package_qt.cpp:26:
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h:2431:0:
 warning: GL_SHADER_STORAGE_BARRIER_BIT redefined
 #define GL_SHADER_STORAGE_BARRIER_BIT 0x2000
 ^
In file included from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osg/GLExtensions:18:0,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osg/BufferObject:19,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osg/Array:46,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osg/Shape:21,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osg/KdTree:17,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osgDB/Registry:21,
 from 
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osgDB/FileUtils:17,
 from 
d:\Projects\OpenPilot\3rdparty\osgearth\src\applications\osgearth_package_qt\package_qt.cpp:21:
D:/Projects/OpenPilot/build/3rdparty/install/osg-3.3.3-mingw491_32-qt-5.4.0/include/osg/GLDefines:496:0:
 note: this is the location of the previous definition
 #define GL_SHADER_STORAGE_BARRIER_BIT 0x2000
 ^
PS : sorry for the missing email object.


 

 Le Samedi 31 janvier 2015 21h44, philippe renon philippe_re...@yahoo.fr 
a écrit :
   
 

 Hi,
Compilation of osg 3.2.1 against Qt 5.4.0 (mingw) was working perfectly fine.
After switching to 3.3.3 we are seeing this compilation error :
In file included from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopengl.h:123:0,
 from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/qgl.h:39,
 from 
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtOpenGL/QGLWidget:1,
 from 
d:/Projects/OpenPilot/3rdparty/osg/include/osgQt/GraphicsWindowQt:17,
 from 
d:\Projects\OpenPilot\3rdparty\osg\examples\osgviewerQt\osgviewerQt.cpp:12:
d:/Projects/OpenPilotTools/qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h:10653:130:
 error: 'GLintptrARB' has not been declared
 typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint 
video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);

The issue comes from a conflict between 
   osg/include/osg/BufferObjectand   
qt-5.4.0/5.4/mingw491_32/include/QtGui/qopenglext.h
within the section starting with:   #ifndef GL_ARB_vertex_buffer_object
   #define GL_ARB_vertex_buffer_object
I beleive that this issue was introduced by openscenegraph/osg

|   |
|   |  |   |   |   |   |   |
| openscenegraph/osgosg - OpenSceneGraph git mirror |
|  |
| Afficher sur github.com | Aperçu par Yahoo |
|  |
|   |


Regards,Philippe.
  


 
   ___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 答复: Blank screen

2015-01-31 Thread padd...@gmx.net

Hi Clement,

about your second screen: if you create your OpenGL context on the 
external screen - have you checked if this screen also has hardware 
acceleration? I remember having a smimilar behaviour with another 
toolkit. Black screen when creating the OGL context not on the primary 
screen with OGL hardware acceleration enabled...


Perhaps this is a hint...

Greets,

Patrik


On 31.01.2015 11:43, Robert Osfield wrote:

Hi Clement,

I'm afraid I can't help you, I not a windows expert and don't know MFC
at all, I'm not the author of the osgviewerMFC example.

The code snippets you have provide don't really give me any clues to
what might be amiss.

I don't have any means of recreating the problems you are seeing with
your application, or you hardware and data.

All I can say it general it is possible to changing window sizes, and it
is possible to create new windows without problems, others do and I've
done it lots myself but never with MFC.  I have no clue with it's a MFC
specific issue you are up against, or how you've gone around
implementing it.

Robert.

On 31 January 2015 at 03:12, clement@csiro.au
mailto:clement@csiro.au wrote:

Hi Robert,

   This is the code for showing image in MFC window. (I followed the
osgviewerMFC example).

osg::ref_ptrosg::GraphicsContext::Traits traits = new
osg::GraphicsContext::Traits;
traits-x = 0;
traits-y = 0;
traits-windowDecoration = false;
traits-doubleBuffer = true;
traits-sharedContext = 0;
traits-setInheritedWindowPixelFormat = true;
traits-width = rect.right - rect.left;
traits-height = rect.bottom - rect.top;
traits-inheritedWindowData = new
osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);
osg::ref_ptrosg::GraphicsContext gc =
osg::GraphicsContext::createGraphicsContext(traits.get());
osgCamera-setGraphicsContext(gc.get());

It requires to set window handle (HWND) into Trait to show image
into MFC window.  The window decoration is already set to false.  If
I changed the size, the osgViewer is still inside the MFC window.  I
would like to switch the osgviewer to display on external monitor
(full screen) programmatically.  I tried many methods and seems I
can do it with creating a new GraphicsContext and new Trait without
assign any HWND and specify the screen number, such as...

osg::GraphicsContext::WindowingSystemInterface* wsi =
osg::GraphicsContext::getWindowingSystemInterface();
osg::GraphicsContext::ScreenIdentifier si;
si.readDISPLAY();
traits-hostName = si.hostName;
traits-displayNum = si.displayNum;
traits-screenNum = si.screenNum;


The method seems working fine, but the image is already blank at the
first.  Once I changed DisplaySettings with grayscale and stereo
mode, the image will come out properly.  I would like to know why
replaced a new GraphicsContext with existing camera will cause the
blank problem and why the image can show up again after changing
some display settings.  Or I already did a wrong way to switch the
current viewer to show on full screen.  Please advise.  Thanks.



Regards,
Clement





发件人: osg-users [osg-users-boun...@lists.openscenegraph.org
mailto:osg-users-boun...@lists.openscenegraph.org] 代表 Robert
Osfield [robert.osfi...@gmail.com mailto:robert.osfi...@gmail.com]
发送时间: 2015年1月31日 03:18
收件人: OpenSceneGraph Users
主题: Re: [osg-users] Blank screen

Hi Clement,

My guess is that way you hacking the screen size change by creating
a new context is screwing up the way context ID's and OpenGL objects
are managed.

My recommendation would be to just switch off window decoration and
change the window size of the context rather than creating a new one.

Robert.

On 30 January 2015 at 16:04,
clement@csiro.aumailto:clement@csiro.au
mailto:clement@csiro.au wrote:
Hi all,

   I am trying to output my volume image on full screen with MFC by
changing GraphicsContext in camera.  First I get GraphicsContext
from camera and then close it.  Then I created a new GraphicsContext
with setting screen number and size of full screen and then set it
to camera.  It works to show full screen and also restore back to
mfc window, but the image cannot show probably.  There is no image
on screen (volume data) and show the axes I drawn only.  If I
changed the display setting to stereo (Anaglyphic) and set grayscale
on and off.  Then the image will come out.  I am not sure how to fix
it.  See if anyone can help me.  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org

mailto:osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
mailto:osg-users@lists.openscenegraph.org

Re: [osg-users] 答复: Blank screen

2015-01-31 Thread Robert Osfield
Hi Clement,

I'm afraid I can't help you, I not a windows expert and don't know MFC at
all, I'm not the author of the osgviewerMFC example.

The code snippets you have provide don't really give me any clues to what
might be amiss.

I don't have any means of recreating the problems you are seeing with your
application, or you hardware and data.

All I can say it general it is possible to changing window sizes, and it is
possible to create new windows without problems, others do and I've done it
lots myself but never with MFC.  I have no clue with it's a MFC specific
issue you are up against, or how you've gone around implementing it.

Robert.

On 31 January 2015 at 03:12, clement@csiro.au wrote:

 Hi Robert,

   This is the code for showing image in MFC window. (I followed the
 osgviewerMFC example).

 osg::ref_ptrosg::GraphicsContext::Traits traits = new
 osg::GraphicsContext::Traits;
 traits-x = 0;
 traits-y = 0;
 traits-windowDecoration = false;
 traits-doubleBuffer = true;
 traits-sharedContext = 0;
 traits-setInheritedWindowPixelFormat = true;
 traits-width = rect.right - rect.left;
 traits-height = rect.bottom - rect.top;
 traits-inheritedWindowData = new
 osgViewer::GraphicsWindowWin32::WindowData(m_hWnd);
 osg::ref_ptrosg::GraphicsContext gc =
 osg::GraphicsContext::createGraphicsContext(traits.get());
 osgCamera-setGraphicsContext(gc.get());

 It requires to set window handle (HWND) into Trait to show image into MFC
 window.  The window decoration is already set to false.  If I changed the
 size, the osgViewer is still inside the MFC window.  I would like to switch
 the osgviewer to display on external monitor (full screen)
 programmatically.  I tried many methods and seems I can do it with creating
 a new GraphicsContext and new Trait without assign any HWND and specify the
 screen number, such as...

 osg::GraphicsContext::WindowingSystemInterface* wsi =
 osg::GraphicsContext::getWindowingSystemInterface();
 osg::GraphicsContext::ScreenIdentifier si;
 si.readDISPLAY();
 traits-hostName = si.hostName;
 traits-displayNum = si.displayNum;
 traits-screenNum = si.screenNum;


 The method seems working fine, but the image is already blank at the
 first.  Once I changed DisplaySettings with grayscale and stereo mode, the
 image will come out properly.  I would like to know why replaced a new
 GraphicsContext with existing camera will cause the blank problem and why
 the image can show up again after changing some display settings.  Or I
 already did a wrong way to switch the current viewer to show on full
 screen.  Please advise.  Thanks.



 Regards,
 Clement




 
 发件人: osg-users [osg-users-boun...@lists.openscenegraph.org] 代表 Robert
 Osfield [robert.osfi...@gmail.com]
 发送时间: 2015年1月31日 03:18
 收件人: OpenSceneGraph Users
 主题: Re: [osg-users] Blank screen

 Hi Clement,

 My guess is that way you hacking the screen size change by creating a new
 context is screwing up the way context ID's and OpenGL objects are managed.

 My recommendation would be to just switch off window decoration and change
 the window size of the context rather than creating a new one.

 Robert.

 On 30 January 2015 at 16:04, clement@csiro.aumailto:
 clement@csiro.au wrote:
 Hi all,

   I am trying to output my volume image on full screen with MFC by
 changing GraphicsContext in camera.  First I get GraphicsContext from
 camera and then close it.  Then I created a new GraphicsContext with
 setting screen number and size of full screen and then set it to camera.
 It works to show full screen and also restore back to mfc window, but the
 image cannot show probably.  There is no image on screen (volume data) and
 show the axes I drawn only.  If I changed the display setting to stereo
 (Anaglyphic) and set grayscale on and off.  Then the image will come out.
 I am not sure how to fix it.  See if anyone can help me.  Thanks.


 Regards,
 Clement



 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.orgmailto:
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org