29 #ifndef __H3DWINDOWNODE_H__
30 #define __H3DWINDOWNODE_H__
71 virtual void update();
164 return value !=
"MONO";
170 return value ==
"MONO"||
171 value ==
"VERTICAL_SPLIT_KEEP_ASPECT_ONE_PASS";
181 if(
"VERTICAL_INTERLACED" == value||
182 "HORIZONTAL_INTERLACED" == value||
183 "CHECKER_INTERLACED" == value ||
184 "VERTICAL_INTERLACED_GREEN_SHIFT" == value ) {
186 window->rebuild_stencil_mask =
true;
193 Inst< SFInt32 > _height = 0,
194 Inst< SFBool > _fullscreen = 0,
195 Inst< SFBool > _mirrored = 0,
196 Inst< RenderMode > _renderMode = 0,
197 Inst< SFViewpoint > _viewpoint = 0,
198 Inst< SFInt32 > _posX = 0,
199 Inst< SFInt32 > _posY = 0,
200 Inst< SFBool > _manualCursorControl = 0,
201 Inst< SFString > _cursorType = 0,
202 Inst< SFNavigationInfo > _navigationInfo = 0,
203 Inst< SFBool > _useFullscreenAntiAliasing = 0,
204 Inst< SFVec2f > _clipDistances = 0,
205 Inst< SFBool > _singlePassStereo = 0,
206 Inst< SFString > _pointingDeviceRefreshMode = 0,
207 Inst< SFBool > _resetViewPoint = 0,
208 Inst< SFInt32 > _numSamples = 0);
222 virtual void deinitWindow();
238 virtual void initialize();
247 virtual void reshape(
int w,
int h );
250 virtual void display();
260 virtual void onKeyDown(
int key,
bool special );
270 virtual void onKeyUp(
int key,
bool special );
277 virtual void onMouseButtonAction(
int button,
int state );
281 virtual void onMouseMotionAction(
int x,
int y );
286 virtual void onMouseWheelAction(
int direction );
302 static bool calculateFarAndNearPlane(
H3DFloat &far,
306 bool include_stylus );
461 static set< H3DWindowNode* > windows;
463 inline static bool getMultiPassTransparency() {
464 return multi_pass_transparency;
477 virtual void shareRenderingContext( H3DWindowNode *w );
480 HGLRC getRenderingContext() {
481 return rendering_context;
486 operator HWND() {
return hWnd; }
494 vector< H3DFloat > default_avatar;
496 bool default_collision;
497 vector< string > default_transition_type;
498 H3DTime default_transition_time;
529 void initWindowWithContext();
531 HGLRC rendering_context;
533 HINSTANCE windowInstance;
544 static LRESULT CALLBACK WindowProc(HWND _hWnd, UINT uMsg,
545 WPARAM wParam, LPARAM lParam);
547 LRESULT Message(HWND _hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
556 multi_pass_transparency = b;
566 bool render_fbo_only );
589 static bool multi_pass_transparency;
591 static bool GLEW_init;
593 bool rebuild_stencil_mask;
594 unsigned char *stencil_mask;
595 unsigned int stencil_mask_height;
596 unsigned int stencil_mask_width;
597 bool last_loop_mirrored;
614 H3DInt32 previous_mouse_position[2];
616 vector< bool > left_mouse_button;
618 bool previous_left_mouse_button;
623 bool window_is_made_active, check_if_stereo_obtained;
630 void checkIfStereoObtained();
640 DEPRECATED(
"takeScreenshot", )
645 static
string takeScreenShot( const
string &url );
649 static
string takeScreenshot( const
string &url );
Header file for DefaultAppearance.
Header file for FrameBufferTextureGenerator.
Contains the MFNode class.
Header file for NavigationInfo, X3D scene-graph node.
Contains the SFInt32 field class.
Contains the SFVec2f field class.
Header file for X3DViewpointNode, X3D scene-graph node.
The FrameBufferTextureGenerator node provides a mean to render a sub-scene into a texture instead of ...
Definition: FrameBufferTextureGenerator.h:209
H3DNavigation is a class used for navigation in H3DAPI.
Definition: H3DNavigation.h:41
Thrown when the value of RenderMode is an invalid mode.
Definition: H3DWindowNode.h:81
The mode for rendering specified as a string.
Definition: H3DWindowNode.h:78
bool isStereoMode()
Returns true if the current render mode is a stereo mode.
Definition: H3DWindowNode.h:162
bool isSinglePass()
Returns true if stereo rendering only need one pass.
Definition: H3DWindowNode.h:168
Mode
The different render modes supported.
Definition: H3DWindowNode.h:83
@ VERTICAL_SPLIT_KEEP_RATIO
Stereo mode where the left eye is rendered as the left half of the screen and the right eye as the ri...
Definition: H3DWindowNode.h:124
@ VERTICAL_INTERLACED
Stereo mode where every second vertical line is rendered for the left eye and every other line for th...
Definition: H3DWindowNode.h:100
@ RED_BLUE_STEREO
Stereo mode where the left eye is rendered in red and the right eye in blue.
Definition: H3DWindowNode.h:111
@ CHECKER_INTERLACED
Stereo mode where "white" and "black" in a checker pattern are rendered for the left and right eye,...
Definition: H3DWindowNode.h:103
@ MONO
Normal rendering.
Definition: H3DWindowNode.h:85
@ HORIZONTAL_SPLIT_KEEP_RATIO
Stereo mode where the left eye is rendered as the top half of the screen and the right eye as the bot...
Definition: H3DWindowNode.h:131
@ HORIZONTAL_INTERLACED
Stereo mode where every second horizontal line is rendered for the left eye and every other line for ...
Definition: H3DWindowNode.h:97
@ RED_CYAN_STEREO
Stereo mode where the left eye is rendered in red and the right eye in cyan.
Definition: H3DWindowNode.h:117
@ QUAD_BUFFERED_STEREO
Quad buffered stereo rendering.
Definition: H3DWindowNode.h:88
@ HDMI_FRAME_PACKED_1080P
HDMI 1.4 frame packed format.
Definition: H3DWindowNode.h:139
@ HDMI_FRAME_PACKED_720P
HDMI 1.4 frame packed format.
Definition: H3DWindowNode.h:135
@ VERTICAL_SPLIT
Stereo mode where the left eye is rendered as the left half of the screen and the right eye as the ri...
Definition: H3DWindowNode.h:94
@ NVIDIA_3DVISION
NVidia 3DVision format when not using quad-buffered stereo.
Definition: H3DWindowNode.h:145
@ HORIZONTAL_SPLIT
Stereo mode where the left eye is rendered as the top half of the screen and the right eye as the bot...
Definition: H3DWindowNode.h:91
@ VERTICAL_SPLIT_KEEP_ASPECT_ONE_PASS
It is almost the same as the VERTICAL_SPLIT_KEEP_RATIO model, left half of the screen for left eye an...
Definition: H3DWindowNode.h:153
@ RED_GREEN_STEREO
Stereo mode where the left eye is rendered in red and the right eye in green.
Definition: H3DWindowNode.h:114
@ VERTICAL_INTERLACED_GREEN_SHIFT
Stereo mode where every second vertical line is rendered for the left eye and every other line for th...
Definition: H3DWindowNode.h:108
void updateRebuildStencilMaskFlag()
Function to update rebuild_stencil_mask when necessary.
Definition: H3DWindowNode.h:179
Class which handles the windows resizing related operations.
Definition: H3DWindowNode.h:64
The base class for all window nodes.
Definition: H3DWindowNode.h:57
H3DUniquePtr< SFInt32 > width
The width in pixels of the window.
Definition: H3DWindowNode.h:324
virtual void initWindow()=0
Virtual function that should create a new window and set its properties depending on the fields.
H3DUniquePtr< WindowSizeChanged > windowSizeChanged
Field handles necessary operations needed when window size actually changes.
Definition: H3DWindowNode.h:626
H3DUniquePtr< SFInt32 > viewportHeight
The height of the viewport being used for this window Access type: outputOnly .
Definition: H3DWindowNode.h:420
virtual int setCursorType(const std::string &)
Set the cursor to the given cursor type.
Definition: H3DWindowNode.h:571
H3DUniquePtr< SFBool > singlePassStereo
Flag for whether singlePassStereo is enabled or not.
Definition: H3DWindowNode.h:433
RenderMode::Mode last_render_mode
The render mode used in the last render loop.
Definition: H3DWindowNode.h:602
H3DUniquePtr< SFBool > mirrored
Determines if the scene rendered should be mirrored or not.
Definition: H3DWindowNode.h:342
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: H3DWindowNode.h:490
H3DUniquePtr< SFBool > manualCursorControl
If set to true changes of cursor is totally up to the user of the window by changing the cursorType.
Definition: H3DWindowNode.h:369
H3DUniquePtr< SFBool > resetViewPoint
Reset viewpoint Access type: inputOutput Default value: false .
Definition: H3DWindowNode.h:449
H3DUniquePtr< SFInt32 > posY
The y coordinate in pixels of the window in screen coordinates.
Definition: H3DWindowNode.h:318
H3DUniquePtr< SFViewpoint > viewpoint
If the viewpoint field is specified, that viewpoint is used by the rendering in H3DWindowNode instead...
Definition: H3DWindowNode.h:360
virtual void setFullscreen(bool fullscreen)=0
Virtual function to set whether the window should be fullscreen or not.
H3DUniquePtr< SFInt32 > height
The height in pixels of the window.
Definition: H3DWindowNode.h:330
H3DUniquePtr< RenderMode > renderMode
The mode to render the scene in the window in.
Definition: H3DWindowNode.h:351
H3DUniquePtr< SFString > cursorType
The cursorType field specifies the look of the mouse pointer.
Definition: H3DWindowNode.h:382
H3DUniquePtr< SFBool > useFullscreenAntiAliasing
If set to true fullscreen anti-aliasing is used for this window.
Definition: H3DWindowNode.h:406
H3DUniquePtr< SFInt32 > viewportWidth
The width of the viewport being used for this window Access type: outputOnly .
Definition: H3DWindowNode.h:410
virtual void swapBuffers()=0
Virtual function to swap buffers.
X3DViewpointNode::EyeMode eye_mode
Current eye mode.
Definition: H3DWindowNode.h:605
H3DUniquePtr< SFInt32 > projectionHeight
The height of the projection height, mostly of the time it is the same as the viewport height.
Definition: H3DWindowNode.h:426
virtual void initWindowHandler()=0
Virtual function to initialize the window handler if needed.
H3DUniquePtr< SFVec2f > clipDistances
The distance (in meters) used for the far and near clip plane.
Definition: H3DWindowNode.h:398
H3DUniquePtr< SFInt32 > numSamples
Number of samples used by this window.
Definition: H3DWindowNode.h:455
H3DUniquePtr< SFNavigationInfo > navigationInfo
If the navigationInfo field is specified, that NavigationInfo is used for rendering in H3DWindowNode ...
Definition: H3DWindowNode.h:391
H3DUniquePtr< SFString > pointingDeviceRefreshMode
Determines how often the X3DPointingDeviceSensorNode's in the scene will be checked for intersection.
Definition: H3DWindowNode.h:444
H3DUniquePtr< SFInt32 > posX
The x coordinate in pixels of the window in screen coordinates.
Definition: H3DWindowNode.h:312
H3DUniquePtr< SFInt32 > projectionWidth
The width of the projection width, mostly of the time it is the same as the viewport width.
Definition: H3DWindowNode.h:415
string current_cursor
The cursor currently in use.
Definition: H3DWindowNode.h:608
H3DUniquePtr< SFBool > fullscreen
Determines if the window should be in fullscreen or not.
Definition: H3DWindowNode.h:336
virtual string getCursorForMode(const string &)
Return the cursor type to use for given modes.
Definition: H3DWindowNode.h:583
static void setMultiPassTransparency(bool b)
If multi pass transparency is set to true the scene will be rendered three times graphically,...
Definition: H3DWindowNode.h:555
virtual void makeWindowActive()=0
Virtual function to make the current window active, i.e.
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
The SFString field contains a string.
Definition: SFString.h:41
The Scene node is topmost node that takes care of the rendering of the scene graph both haptically an...
Definition: Scene.h:56
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
The X3DViewpointNode node defines a specific location in the local coordinate system from which the u...
Definition: X3DViewpointNode.h:239
EyeMode
Used with setupProjection function to indicate for which eye the frustum should be calculated.
Definition: X3DViewpointNode.h:244
The OculusRiftHandler class provides support for the Oculus Rift VR device.
Definition: OculusRiftHandler.h:49
H3D_VALUE_EXCEPTION(string, InvalidType)
An exception thrown when a field is of the wrong type when it is checked.
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194