ReactOS 0.4.15-dev-8058-ga7cbb60
vb.c
Go to the documentation of this file.
1/* $Id: vb.c,v 1.8 1997/07/24 01:25:27 brianp Exp $ */
2
3/*
4 * Mesa 3-D graphics library
5 * Version: 2.4
6 * Copyright (C) 1995-1997 Brian Paul
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23
24/*
25 * $Log: vb.c,v $
26 * Revision 1.8 1997/07/24 01:25:27 brianp
27 * changed precompiled header symbol from PCH to PC_HEADER
28 *
29 * Revision 1.7 1997/05/28 03:26:49 brianp
30 * added precompiled header (PCH) support
31 *
32 * Revision 1.6 1997/05/09 22:41:55 brianp
33 * replaced gl_init_vb() with gl_alloc_vb()
34 *
35 * Revision 1.5 1997/04/24 00:29:36 brianp
36 * added TexCoordSize
37 *
38 * Revision 1.4 1997/04/20 15:59:30 brianp
39 * removed VERTEX2_BIT stuff
40 *
41 * Revision 1.3 1997/04/12 16:21:24 brianp
42 * updated gl_init_vb()
43 *
44 * Revision 1.2 1996/09/27 01:31:08 brianp
45 * make gl_init_vb() non-static
46 *
47 * Revision 1.1 1996/09/13 01:38:16 brianp
48 * Initial revision
49 *
50 */
51
52
53#ifdef PC_HEADER
54#include "all.h"
55#else
56#include <stdlib.h>
57#include "types.h"
58#include "vb.h"
59#endif
60
61
62/*
63 * Allocate and initialize a vertex buffer.
64 */
66{
67 struct vertex_buffer *vb;
68 vb = (struct vertex_buffer *) calloc(sizeof(struct vertex_buffer), 1);
69 if (vb) {
70 /* set non-zero fields */
71 GLuint i;
72 for (i=0;i<VB_SIZE;i++) {
73 vb->MaterialMask[i] = 0;
74 vb->ClipMask[i] = 0;
75 vb->Obj[i][3] = 1.0F;
76 vb->TexCoord[i][2] = 0.0F;
77 vb->TexCoord[i][3] = 1.0F;
78 }
80 vb->TexCoordSize = 2;
81 vb->MonoColor = GL_TRUE;
83 vb->MonoNormal = GL_TRUE;
84 vb->ClipOrMask = 0;
86 }
87 return vb;
88}
#define GL_TRUE
Definition: gl.h:174
unsigned int GLuint
Definition: gl.h:159
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define calloc
Definition: rosglue.h:14
GLfloat TexCoord[VB_SIZE][4]
Definition: vb.h:117
GLuint TexCoordSize
Definition: vb.h:128
GLboolean MonoMaterial
Definition: vb.h:131
GLuint MaterialMask[VB_SIZE]
Definition: vb.h:134
GLubyte ClipAndMask
Definition: vb.h:121
GLboolean MonoColor
Definition: vb.h:129
GLfloat Obj[VB_SIZE][4]
Definition: vb.h:100
GLboolean MonoNormal
Definition: vb.h:130
GLubyte ClipOrMask
Definition: vb.h:120
GLuint VertexSizeMask
Definition: vb.h:127
GLubyte ClipMask[VB_SIZE]
Definition: vb.h:119
struct vertex_buffer * gl_alloc_vb(void)
Definition: vb.c:65
#define VB_SIZE
Definition: vb.h:89
#define CLIP_ALL_BITS
Definition: vb.h:148
#define VERTEX3_BIT
Definition: vb.h:94