From 9fa5db9841ecc20300c96e7f6957096c6cf83d9e Mon Sep 17 00:00:00 2001 From: Rcmaniac25 Date: Sun, 6 Dec 2015 01:01:28 -0500 Subject: [PATCH] Updated documentation in relation to GLUT_ALLOW_NEGATIVE_WINDOW_POSITION. --- freeglut/web-src/docs/api.php | 58 +++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/freeglut/web-src/docs/api.php b/freeglut/web-src/docs/api.php index 9146ef0..d9b672f 100644 --- a/freeglut/web-src/docs/api.php +++ b/freeglut/web-src/docs/api.php @@ -457,7 +457,13 @@ With glutGet information can be acquired about the current window's size, position and decorations. Note however that according to FreeGLUT's conventions, the information returned about the window coordinates does not correspond to the -coordinates used when setting window position. +coordinates used when setting window position. In addition, GLUT only +accepts positive window coordinates, and ignores all negative window +coordinates. But if GLUT_ALLOW_NEGATIVE_WINDOW_POSITION is enabled, +then negative window coordinates can be used. This is useful for +multi-montitor setups where the second monitor may be in the negative +desktop space of the primary monitor, as now the window can be placed +on the additional monitors.

@@ -479,6 +485,11 @@ the window will immediately snap out to this width, but the application can call glutReshapeWindow and make a window narrower again.

+

+If GLUT_ALLOW_NEGATIVE_WINDOW_POSITION is enabled, glutInitWindowPosition +will accept negative window coordinates. +

+

4.3 glutInitDisplayMode

4.4 glutInitDisplayString

@@ -634,9 +645,9 @@ will exit.

If the application has two nested calls to glutMainLoop and calls glutLeaveMainLoop, the behaviour -of freeglut is undefined. It may leave only the inner nested +of FreeGLUT is undefined. It may leave only the inner nested loop or it may leave both loops. If the reader has a strong preference -for one behaviour over the other he should contact the freeglut Programming +for one behaviour over the other he should contact the FreeGLUT Programming Consortium and ask for the code to be fixed.

@@ -650,6 +661,44 @@ Consortium and ask for the code to be fixed.

6.2 glutCreateSubwindow

+

+The glutCreateSubwindow function creates a subwindow of an existing window. +

+ +

Usage

+ +

+int glutCreateSubwindow(int window, int x, int y, int width, int height); +

+ +

Description

+ +

+Creates a subwindow of window that is at location x and y +relative to the window's upper-left corner, and is of the specified width and height. The newly created +window ID is returned by glutCreateSubwindow. By default, the position coordinates will only allow windows within the bounds of the parent. +Negative coordinates be treated as coordinates from the opposite edge for a given axis. In addition, the width of the window will be taken into account. +For example, if the parent window is 100 pixels wide, and the x is 10, and width is 20, the subwindow will be located at x = 10. +If x is -10, then the subwindow will be located at 70 (parent - abs(pos) - dim). If the width or height are negative, then the dimension is taken as a +subtraction of the parent dimension. For example, if the parent window is 100 pixels wide, and the x is 10, and width is 20, the +subwindow will have a size of 20. If width is -20, then the subwindow will have a width of 70 (parent - pos - abs(dim)). +

+ +

+If GLUT_ALLOW_NEGATIVE_WINDOW_POSITION is enabled, the window behavior differs. Negative window coordinates are now accepted and may result in windows outside +of the viewing area, depending on the platform of operation. Negative width and height are still used as a subtraction of the parent window dimension, +but they do not take x or y into account. For example, if the parent window is 100 pixels wide, and the x is 10, and width is 20, the +subwindow will be located at x = 10. If x is -10, then the subwindow will be located at x = -10. If the parent window is 100 pixels wide, +and the x is 10, and width is 20, the subwindow will have a size of 20. If width is -20, then the subwindow will have a width of 80 (parent - abs(dim)). +

+ +

Changes From GLUT

+ +

+GLUT does not support negative x or y. Nor does it have GLUT_ALLOW_NEGATIVE_WINDOW_POSITION +which changes the the functionality of glutCreateSubwindow. +

+

6.3 glutDestroyWindow

6.4 glutSetWindow, glutGetWindow

@@ -1528,6 +1577,8 @@ href="#GeometricObject">FreeGLUT's geometric object rendering functions also visualize the object's normals or not.
  • GLUT_STROKE_FONT_DRAW_JOIN_DOTS - Set whether join dots are drawn between line segments when drawing letters of stroke fonts or not.
  • +
  • GLUT_ALLOW_NEGATIVE_WINDOW_POSITION - Set if negative positions can be +used for window coordinates.
  • @@ -1606,6 +1657,7 @@ glutInitDisplayMode or glutSetOption(GLUT_INIT_DISPLAY_MODE, value)
  • GLUT_VERSION - Return value will be X*10000+Y*100+Z where X is the major version, Y is the minor version and Z is the patch level. This query is only supported in freeglut (version 2.0.0 or later).
  • +
  • GLUT_ALLOW_NEGATIVE_WINDOW_POSITION - 1 if negative window positions are enabled, 0 otherwise
  • 13.3 glutDeviceGet