ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

m_vector.h
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  7.3
00004  *
00005  * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this software and associated documentation files (the "Software"),
00009  * to deal in the Software without restriction, including without limitation
00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011  * and/or sell copies of the Software, and to permit persons to whom the
00012  * Software is furnished to do so, subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice shall be included
00015  * in all copies or substantial portions of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 /*
00026  * New (3.1) transformation code written by Keith Whitwell.
00027  */
00028 
00029 
00030 #ifndef _M_VECTOR_H_
00031 #define _M_VECTOR_H_
00032 
00033 #include "main/glheader.h"
00034 #include "main/mtypes.h"        /* hack for GLchan */
00035 
00036 
00037 #define VEC_DIRTY_0        0x1
00038 #define VEC_DIRTY_1        0x2
00039 #define VEC_DIRTY_2        0x4
00040 #define VEC_DIRTY_3        0x8
00041 #define VEC_MALLOC         0x10 /* storage field points to self-allocated mem*/
00042 #define VEC_NOT_WRITEABLE  0x40 /* writable elements to hold clipped data */
00043 #define VEC_BAD_STRIDE     0x100 /* matches tnl's prefered stride */
00044 
00045 
00046 #define VEC_SIZE_1   VEC_DIRTY_0
00047 #define VEC_SIZE_2   (VEC_DIRTY_0|VEC_DIRTY_1)
00048 #define VEC_SIZE_3   (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2)
00049 #define VEC_SIZE_4   (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3)
00050 
00051 
00052 
00053 /* Wrap all the information about vectors up in a struct.  Has
00054  * additional fields compared to the other vectors to help us track of
00055  * different vertex sizes, and whether we need to clean columns out
00056  * because they contain non-(0,0,0,1) values.
00057  *
00058  * The start field is used to reserve data for copied vertices at the
00059  * end of _mesa_transform_vb, and avoids the need for a multiplication in
00060  * the transformation routines.
00061  */
00062 typedef struct {
00063    GLfloat (*data)[4];  /* may be malloc'd or point to client data */
00064    GLfloat *start;  /* points somewhere inside of <data> */
00065    GLuint count;    /* size of the vector (in elements) */
00066    GLuint stride;   /* stride from one element to the next (in bytes) */
00067    GLuint size;     /* 2-4 for vertices and 1-4 for texcoords */
00068    GLuint flags;    /* which columns are dirty */
00069    void *storage;   /* self-allocated storage */
00070 } GLvector4f;
00071 
00072 
00073 extern void _mesa_vector4f_init( GLvector4f *v, GLuint flags,
00074                   GLfloat (*storage)[4] );
00075 extern void _mesa_vector4f_alloc( GLvector4f *v, GLuint flags,
00076                    GLuint count, GLuint alignment );
00077 extern void _mesa_vector4f_free( GLvector4f *v );
00078 extern void _mesa_vector4f_print( GLvector4f *v, GLubyte *, GLboolean );
00079 extern void _mesa_vector4f_clean_elem( GLvector4f *vec, GLuint nr, GLuint elt );
00080 
00081 
00082 
00083 
00084 
00085 /*
00086  * Given vector <v>, return a pointer (cast to <type *> to the <i>-th element.
00087  *
00088  * End up doing a lot of slow imuls if not careful.
00089  */
00090 #define VEC_ELT( v, type, i ) \
00091        ( (type *)  ( ((GLbyte *) ((v)->data)) + (i) * (v)->stride) )
00092 
00093 
00094 #endif

Generated on Sat May 26 2012 04:19:18 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.