diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 03:01:46 +0000 |
commit | f8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch) | |
tree | 26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/packer/pack_stipple.c | |
parent | Initial commit. (diff) | |
download | virtualbox-upstream.tar.xz virtualbox-upstream.zip |
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/packer/pack_stipple.c')
-rw-r--r-- | src/VBox/GuestHost/OpenGL/packer/pack_stipple.c | 36 |
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); +} |