3 ** License Applicability. Except to the extent portions of this file are
4 ** made subject to an alternative license as permitted in the SGI Free
5 ** Software License B, Version 1.1 (the "License"), the contents of this
6 ** file are subject only to the provisions of the License. You may not use
7 ** this file except in compliance with the License. You may obtain a copy
8 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
9 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
11 ** http://oss.sgi.com/projects/FreeB
13 ** Note that, as provided in the License, the Software is distributed on an
14 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
15 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
16 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
17 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
19 ** Original Code. The Original Code is: OpenGL Sample Implementation,
20 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
21 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
22 ** Copyright in any portions created by third parties is as indicated
23 ** elsewhere herein. All Rights Reserved.
25 ** Additional Notice Provisions: The application programming interfaces
26 ** established by SGI in conjunction with the Original Code are The
27 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
28 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
29 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
30 ** Window System(R) (Version 1.3), released October 19, 1998. This software
31 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
32 ** published by SGI, but has not been independently verified as being
33 ** compliant with the OpenGL(R) version 1.2.1 Specification.
37 #include "packrender.h"
40 ** Routines to pack evaluator maps into the transport buffer. Maps are
41 ** allowed to have extra arbitrary data, so these routines extract just
42 ** the information that the GL needs.
45 void __glFillMap1f(GLint k
, GLint order
, GLint stride
,
46 const GLfloat
*points
, GLubyte
*pc
)
49 /* Just copy the data */
50 __GLX_PUT_FLOAT_ARRAY(0, points
, order
* k
);
54 for (i
= 0; i
< order
; i
++) {
55 __GLX_PUT_FLOAT_ARRAY(0, points
, k
);
57 pc
+= k
* __GLX_SIZE_FLOAT32
;
62 void __glFillMap1d(GLint k
, GLint order
, GLint stride
,
63 const GLdouble
*points
, GLubyte
*pc
)
66 /* Just copy the data */
67 __GLX_PUT_DOUBLE_ARRAY(0, points
, order
* k
);
70 for (i
= 0; i
< order
; i
++) {
71 __GLX_PUT_DOUBLE_ARRAY(0, points
, k
);
73 pc
+= k
* __GLX_SIZE_FLOAT64
;
78 void __glFillMap2f(GLint k
, GLint majorOrder
, GLint minorOrder
,
79 GLint majorStride
, GLint minorStride
,
80 const GLfloat
*points
, GLfloat
*data
)
84 if ((minorStride
== k
) && (majorStride
== minorOrder
*k
)) {
85 /* Just copy the data */
86 __GLX_MEM_COPY(data
, points
, majorOrder
* majorStride
*
90 for (i
= 0; i
< majorOrder
; i
++) {
91 for (j
= 0; j
< minorOrder
; j
++) {
92 for (x
= 0; x
< k
; x
++) {
95 points
+= minorStride
;
98 points
+= majorStride
- minorStride
* minorOrder
;
102 void __glFillMap2d(GLint k
, GLint majorOrder
, GLint minorOrder
,
103 GLint majorStride
, GLint minorStride
,
104 const GLdouble
*points
, GLdouble
*data
)
108 if ((minorStride
== k
) && (majorStride
== minorOrder
*k
)) {
109 /* Just copy the data */
110 __GLX_MEM_COPY(data
, points
, majorOrder
* majorStride
*
116 x
= k
* __GLX_SIZE_FLOAT64
;
118 for (i
= 0; i
<majorOrder
; i
++) {
119 for (j
= 0; j
<minorOrder
; j
++) {
121 __GLX_MEM_COPY(data
, points
, x
);
123 for (x
= 0; x
<k
; x
++) {
127 points
+= minorStride
;
130 points
+= majorStride
- minorStride
* minorOrder
;