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

lines.c
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.5.3
00004  *
00005  * Copyright (C) 1999-2006  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 #include "glheader.h"
00027 #include "context.h"
00028 #include "depth.h"
00029 #include "lines.h"
00030 #include "macros.h"
00031 #include "texstate.h"
00032 #include "mtypes.h"
00033 
00034 
00042 void GLAPIENTRY
00043 _mesa_LineWidth( GLfloat width )
00044 {
00045    GET_CURRENT_CONTEXT(ctx);
00046    ASSERT_OUTSIDE_BEGIN_END(ctx);
00047 
00048    if (width<=0.0) {
00049       _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
00050       return;
00051    }
00052 
00053    if (ctx->Line.Width == width)
00054       return;
00055 
00056    FLUSH_VERTICES(ctx, _NEW_LINE);
00057    ctx->Line.Width = width;
00058 
00059    if (width != 1.0F)
00060       ctx->_TriangleCaps |= DD_LINE_WIDTH;
00061    else
00062       ctx->_TriangleCaps &= ~DD_LINE_WIDTH;
00063 
00064    if (ctx->Driver.LineWidth)
00065       ctx->Driver.LineWidth(ctx, width);
00066 }
00067 
00068 
00081 void GLAPIENTRY
00082 _mesa_LineStipple( GLint factor, GLushort pattern )
00083 {
00084    GET_CURRENT_CONTEXT(ctx);
00085    ASSERT_OUTSIDE_BEGIN_END(ctx);
00086 
00087    factor = CLAMP( factor, 1, 256 );
00088 
00089    if (ctx->Line.StippleFactor == factor &&
00090        ctx->Line.StipplePattern == pattern)
00091       return;
00092 
00093    FLUSH_VERTICES(ctx, _NEW_LINE);
00094    ctx->Line.StippleFactor = factor;
00095    ctx->Line.StipplePattern = pattern;
00096 
00097    if (ctx->Driver.LineStipple)
00098       ctx->Driver.LineStipple( ctx, factor, pattern );
00099 }
00100 
00101 
00110 void GLAPIENTRY
00111 _mesa_init_line( GLcontext * ctx )
00112 {
00113    ctx->Line.SmoothFlag = GL_FALSE;
00114    ctx->Line.StippleFlag = GL_FALSE;
00115    ctx->Line.Width = 1.0;
00116    ctx->Line.StipplePattern = 0xffff;
00117    ctx->Line.StippleFactor = 1;
00118 }

Generated on Sat May 26 2012 04:19:07 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.