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

accum.c
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.5
00004  *
00005  * Copyright (C) 1999-2005  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 #include "glheader.h"
00026 #include "accum.h"
00027 #include "context.h"
00028 #include "imports.h"
00029 #include "macros.h"
00030 #include "state.h"
00031 #include "mtypes.h"
00032 
00033 
00034 void GLAPIENTRY
00035 _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
00036 {
00037    GLfloat tmp[4];
00038    GET_CURRENT_CONTEXT(ctx);
00039    ASSERT_OUTSIDE_BEGIN_END(ctx);
00040 
00041    tmp[0] = CLAMP( red,   -1.0F, 1.0F );
00042    tmp[1] = CLAMP( green, -1.0F, 1.0F );
00043    tmp[2] = CLAMP( blue,  -1.0F, 1.0F );
00044    tmp[3] = CLAMP( alpha, -1.0F, 1.0F );
00045 
00046    if (TEST_EQ_4V(tmp, ctx->Accum.ClearColor))
00047       return;
00048 
00049    FLUSH_VERTICES(ctx, _NEW_ACCUM);
00050    COPY_4FV( ctx->Accum.ClearColor, tmp );
00051 }
00052 
00053 
00054 void GLAPIENTRY
00055 _mesa_Accum( GLenum op, GLfloat value )
00056 {
00057    GET_CURRENT_CONTEXT(ctx);
00058    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
00059 
00060    switch (op) {
00061    case GL_ADD:
00062    case GL_MULT:
00063    case GL_ACCUM:
00064    case GL_LOAD:
00065    case GL_RETURN:
00066       /* OK */
00067       break;
00068    default:
00069       _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)");
00070       return;
00071    }
00072 
00073    if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) {
00074       _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)");
00075       return;
00076    }
00077 
00078    if (ctx->DrawBuffer != ctx->ReadBuffer) {
00079       /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read,
00080        * or GL_EXT_framebuffer_blit.
00081        */
00082       _mesa_error(ctx, GL_INVALID_OPERATION,
00083                   "glAccum(different read/draw buffers)");
00084       return;
00085    }
00086 
00087    if (ctx->NewState)
00088       _mesa_update_state(ctx);
00089 
00090    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
00091       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
00092                   "glAccum(incomplete framebuffer)");
00093       return;
00094    }
00095 
00096    if (ctx->RenderMode == GL_RENDER) {
00097       ctx->Driver.Accum(ctx, op, value);
00098    }
00099 }
00100 
00101 
00102 
00103 void 
00104 _mesa_init_accum( GLcontext *ctx )
00105 {
00106    /* Accumulate buffer group */
00107    ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 );
00108 }

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