summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/packer/pack_stipple.c')
-rw-r--r--src/VBox/GuestHost/OpenGL/packer/pack_stipple.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c b/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c
new file mode 100644
index 00000000..8d3e59dd
--- /dev/null
+++ b/src/VBox/GuestHost/OpenGL/packer/pack_stipple.c
@@ -0,0 +1,36 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#include "packer.h"
+#include "cr_opcodes.h"
+#include "cr_mem.h"
+#include "cr_glstate.h"
+
+void PACK_APIENTRY crPackPolygonStipple( const GLubyte *mask )
+{
+ CR_GET_PACKER_CONTEXT(pc);
+ unsigned char *data_ptr;
+ int nodata = crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB);
+ int packet_length = sizeof(int);
+
+ if (nodata)
+ packet_length += sizeof(GLint);
+ else
+ packet_length += 32*32/8;
+
+ CR_GET_BUFFERED_POINTER(pc, packet_length );
+ WRITE_DATA_AI(int, nodata);
+ if (nodata)
+ {
+ WRITE_DATA_AI(GLint, (GLint)(uintptr_t)mask);
+ }
+ else
+ {
+ crMemcpy( data_ptr, mask, 32*32/8 );
+ }
+ WRITE_OPCODE( pc, CR_POLYGONSTIPPLE_OPCODE );
+ CR_UNLOCK_PACKER_CONTEXT(pc);
+}