Exemplo n.º 1
0
        // glx render opcode 2 - call lists
        /**
           * @see <a href="glCallLists.html">glCallLists</a>
           */
        public void call_lists(int type, Object lists)
        {
            Data data;

            switch (type) {
            case BYTE:                  // fall through
            case UNSIGNED_BYTE:
              data = new Data ((byte []) lists);
              break;

            case SHORT:                 // fall through
            case UNSIGNED_SHORT:        // fall through
            case X2_BYTES:
              data = new Data ((int []) lists, 2);
              break;

            case INT:                   // fall through
            case UNSIGNED_INT:          // fall through
            case X4_BYTES:
              data = new Data ((int []) lists, 4);
              break;

            case FLOAT:
              data = new Data ((float []) lists);
              break;

            default:
              return;
            }

            begin_render_large_request (2, 12, data.np ());
            render_request.write4 (data.n ());
            render_request.write4 (type);
            end_render_large_request (data);
        }
Exemplo n.º 2
0
        // glx render opcode 5 - bitmap
        /**
           * @see <a href="glBitmap.html">glBitmap</a>
           */
        public void bitmap(int width, int height, float xorig, float yorig,
    float xmove, float ymove, byte [] bitmap)
        {
            Data data = new Data (bitmap);

            begin_render_large_request (5, 48, data.np ());
            render_request.write1_unused ();
            render_request.write1 (false); // java = msb = !lsb_first
            render_request.write2_unused ();

            // FIXME work with other cases??
            render_request.write4 (0);  // row len
            render_request.write4 (0);  // skip rows
            render_request.write4 (0);  // skip pixels
            render_request.write4 (1);  // alignment

            render_request.write4 (width);
            render_request.write4 (height);
            render_request.write4 (xorig);
            render_request.write4 (yorig);
            render_request.write4 (xmove);
            render_request.write4 (ymove);
            end_render_large_request (data);
        }
Exemplo n.º 3
0
        // glx render opcode 4100 - tex subimage 2d
        /**
           * @see <a href="glTexSubimage2d.html">glTexSubimage2D</a>
           */
        public void tex_subimage_2d(int target, int level, 
    int xoffset, int yoffset, int width, int height,
    int format, int type, Data pixels)
        {
            begin_render_large_request (4100, 60, pixels.np ());
            render_request.write1 (0);  // swap bytes
            render_request.write1 (false); // java = msb = !lsb_first
            render_request.write2_unused ();

            // FIXME work with other cases??
            render_request.write4 (0);  // row len
            render_request.write4 (0);  // skip rows
            render_request.write4 (0);  // skip pixels
            render_request.write4 (1);  // alignment

            render_request.write4 (target);
            render_request.write4 (level);
            render_request.write4 (xoffset);
            render_request.write4 (yoffset);
            render_request.write4 (width);
            render_request.write4 (height);
            render_request.write4 (format);
            render_request.write4 (type);
            render_request.write4_unused ();
            end_render_large_request (pixels);
        }
Exemplo n.º 4
0
        // glx render opcode 110 - tex image 2d
        /**
           * @see <a href="glTexImage2d.html">glTexImage2D</a>
           */
        public void tex_image_2d(int target, int level, int internal_format,
    int width, int height, int border, int format, int type, 
    Data pixels)
        {
            begin_render_large_request (110, 56, pixels.np ());
            render_request.write1 (0);  // swap bytes
            render_request.write1 (false); // java = msb = !lsb_first
            render_request.write2_unused ();

            // FIXME GL_ABGR_EXT?

            // FIXME work with other cases??
            render_request.write4 (0);  // row len
            render_request.write4 (0);  // skip rows
            render_request.write4 (0);  // skip pixels
            render_request.write4 (1);  // alignment

            render_request.write4 (target);
            render_request.write4 (level);
            render_request.write4 (internal_format);
            render_request.write4 (width);
            render_request.write4 (height);
            render_request.write4 (border);
            render_request.write4 (format);
            render_request.write4 (type);
            end_render_large_request (pixels);
        }
Exemplo n.º 5
0
        // glx render opcode 102 - polygon stipple
        /**
           * @see <a href="glPolygonMode.html">glPolygonStipple</a>
           */
        public void polygon_stipple(byte [] mask)
        {
            Data data = new Data (mask);

            begin_render_large_request (102, 24, data.np ());
            render_request.write1 (0);  // swap bytes
            render_request.write1 (false); // java = msb = !lsb_first
            render_request.write2_unused ();

            // FIXME work with other cases??
            render_request.write4 (0);  // row len
            render_request.write4 (0);  // skip rows
            render_request.write4 (0);  // skip pixels
            render_request.write4 (1);  // alignment

            end_render_large_request (data);
        }
Exemplo n.º 6
0
        // glx render opcode 173 - draw pixels
        /**
           * @see <a href="glDrawPixels.html">glDrawPixels</a>
           */
        public void draw_pixels(int width, int height, int format, int type,
    Data pixels)
        {
            begin_render_large_request (173, 40, pixels.np ());
            render_request.write1 (0);  // swap bytes
            render_request.write1 (false); // java = msb = !lsb_first
            render_request.write2_unused ();

            // FIXME work with other cases??
            render_request.write4 (0);  // row len
            render_request.write4 (0);  // skip rows
            render_request.write4 (0);  // skip pixels
            render_request.write4 (1);  // alignment

            render_request.write4 (width);
            render_request.write4 (height);
            render_request.write4 (format);
            render_request.write4 (type);
            end_render_large_request (pixels);
        }