VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/xf86glx_util.h@ 107044

Last change on this file since 107044 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 3.1 KB
Line 
1/* $XFree86: xc/programs/Xserver/GL/mesa/src/X/xf86glx_util.h,v 1.5 2000/08/10 17:40:29 dawes Exp $ */
2/**************************************************************************
3
4Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5All Rights Reserved.
6
7Permission is hereby granted, free of charge, to any person obtaining a
8copy of this software and associated documentation files (the
9"Software"), to deal in the Software without restriction, including
10without limitation the rights to use, copy, modify, merge, publish,
11distribute, sub license, and/or sell copies of the Software, and to
12permit persons to whom the Software is furnished to do so, subject to
13the following conditions:
14
15The above copyright notice and this permission notice (including the
16next paragraph) shall be included in all copies or substantial portions
17of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
27**************************************************************************/
28
29/*
30 * Authors:
31 * Kevin E. Martin <kevin@precisioninsight.com>
32 * Brian Paul <brian@precisioninsight.com>
33 */
34
35#ifdef HAVE_DIX_CONFIG_H
36#include <dix-config.h>
37#endif
38
39#ifndef _XF86GLX_UTIL_H_
40#define _XF86GLX_UTIL_H_
41
42#ifdef __CYGWIN__
43#undef WIN32
44#undef _WIN32
45#endif
46
47#include <screenint.h>
48#include <pixmap.h>
49#include <gc.h>
50#include "GL/xmesa.h"
51
52#define XMESA_USE_PUTPIXEL_MACRO
53
54struct _XMesaImageRec {
55 int width, height;
56 char *data;
57 int bytes_per_line; /* Padded to 32 bits */
58 int bits_per_pixel;
59};
60
61extern XMesaImage *XMesaCreateImage(int bitsPerPixel, int width, int height,
62 char *data);
63extern void XMesaDestroyImage(XMesaImage *image);
64extern unsigned long XMesaGetPixel(XMesaImage *image, int x, int y);
65#ifdef XMESA_USE_PUTPIXEL_MACRO
66#define XMesaPutPixel(__i,__x,__y,__p) \
67{ \
68 CARD8 *__row = (CARD8 *)(__i->data + __y*__i->bytes_per_line); \
69 CARD8 *__i8; \
70 CARD16 *__i16; \
71 CARD32 *__i32; \
72 switch (__i->bits_per_pixel) { \
73 case 8: \
74 __i8 = (CARD8 *)__row; \
75 __i8[__x] = (CARD8)__p; \
76 break; \
77 case 15: \
78 case 16: \
79 __i16 = (CARD16 *)__row; \
80 __i16[__x] = (CARD16)__p; \
81 break; \
82 case 24: /* WARNING: architecture specific code */ \
83 __i8 = (CARD8 *)__row; \
84 __i8[__x*3] = (CARD8)(__p); \
85 __i8[__x*3+1] = (CARD8)(__p>>8); \
86 __i8[__x*3+2] = (CARD8)(__p>>16); \
87 break; \
88 case 32: \
89 __i32 = (CARD32 *)__row; \
90 __i32[__x] = (CARD32)__p; \
91 break; \
92 } \
93}
94#else
95extern void XMesaPutPixel(XMesaImage *image, int x, int y,
96 unsigned long pixel);
97#endif
98
99extern void XMesaPutImageHelper(ScreenPtr display,
100 DrawablePtr d, GCPtr gc,
101 XMesaImage *image,
102 int src_x, int src_y,
103 int dest_x, int dest_y,
104 unsigned int width, unsigned int height);
105
106#endif /* _XF86GLX_UTIL_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette