コード例 #1
0
ファイル: GL.cs プロジェクト: jbnivoit/projects
        // glx render opcode 145 - map2d
        /**
           * @see <a href="glMap2d.html">glMap2d</a>
           */
        public void map2d(int target, double u1, double u2, 
    int ustride, int uorder, double v1, double v2,
    int vstride, int vorder, double [] points)
        {
            int k = 0;

            switch (target) {
            case MAP2_INDEX:            // fall through
            case MAP2_TEXTURE_COORD_1: k = 1; break;
            case MAP2_TEXTURE_COORD_2: k = 2; break;
            case MAP2_NORMAL:           // fall through
            case MAP2_TEXTURE_COORD_3:  // fall through
            case MAP2_VERTEX_3: k = 3; break;
            case MAP2_COLOR_4:          // fall through
            case MAP2_TEXTURE_COORD_4:  // fall through
            case MAP2_VERTEX_4: k = 4; break;
            }

            int n = vorder * uorder * k * 8;

            Data data = new Data (n);
            for (int i=0; i<vorder; i++)
              for (int j=0; j<uorder; j++)
            for (int m=0; m<k; m++)
              data.write8 (points [i*ustride + j*vstride + m]);

            begin_render_large_request (145, 48, n);
            render_request.write8 (u1);
            render_request.write8 (u2);
            render_request.write8 (v1);
            render_request.write8 (v2);
            render_request.write4 (target);
            render_request.write4 (uorder);
            render_request.write4 (vorder);
            end_render_large_request (data);
        }
コード例 #2
0
ファイル: GL.cs プロジェクト: jbnivoit/projects
        // glx render opcode 143 - map1d
        /**
           * @see <a href="glMap1d.html">glMap1d</a>
           */
        public void map1d(int target, double u1, double u2, int stride, 
    int order, double [] points)
        {
            int k = 0;

            switch (target) {
            case MAP1_INDEX:            // fall through
            case MAP1_TEXTURE_COORD_1: k = 1; break;
            case MAP1_TEXTURE_COORD_2: k = 2; break;
            case MAP1_NORMAL:           // fall through
            case MAP1_TEXTURE_COORD_3:  // fall through
            case MAP1_VERTEX_3: k = 3; break;
            case MAP1_COLOR_4:          // fall through
            case MAP1_TEXTURE_COORD_4:  // fall through
            case MAP1_VERTEX_4: k = 4; break;
            }

            int n = order * k * 8;

            Data data = new Data (n);
            for (int i=0; i<order; i++)
              for (int j=0; j<k; j++)
            data.write8 (points [i*stride + j]);

            begin_render_large_request (143, 28, n);
            render_request.write8 (u1);
            render_request.write8 (u2);
            render_request.write4 (target);
            render_request.write4 (order);
            end_render_large_request (data);
        }