本文整理汇总了C++中ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH函数的具体用法?C++ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH怎么用?C++ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _mesa_AlphaFunc
void
_mesa_AlphaFunc( GLenum func, GLclampf ref )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAlphaFunc");
switch (func) {
case GL_NEVER:
case GL_LESS:
case GL_EQUAL:
case GL_LEQUAL:
case GL_GREATER:
case GL_NOTEQUAL:
case GL_GEQUAL:
case GL_ALWAYS:
ctx->Color.AlphaFunc = func;
if (ref <= 0.0)
ctx->Color.AlphaRef = (GLubyte) 0;
else if (ref >= 1.0)
ctx->Color.AlphaRef = (GLubyte) 255;
else
CLAMPED_FLOAT_COLOR_TO_UBYTE_COLOR(ctx->Color.AlphaRef, ref);
if (ctx->Driver.AlphaFunc) {
(*ctx->Driver.AlphaFunc)(ctx, func, ctx->Color.AlphaRef);
}
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glAlphaFunc(func)" );
break;
}
}
开发者ID:wwzbwwzb,项目名称:fbdri,代码行数:31,代码来源:alpha.c
示例2: _mesa_CopyConvolutionFilter2D
void
_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height)
{
GLint baseFormat;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (target != GL_CONVOLUTION_2D) {
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D(target)");
return;
}
baseFormat = base_filter_format(internalFormat);
if (baseFormat < 0 || baseFormat == GL_COLOR_INDEX) {
_mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D(internalFormat)");
return;
}
if (width < 0 || width > MAX_CONVOLUTION_WIDTH) {
_mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter2D(width)");
return;
}
if (height < 0 || height > MAX_CONVOLUTION_HEIGHT) {
_mesa_error(ctx, GL_INVALID_VALUE, "glCopyConvolutionFilter2D(height)");
return;
}
ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y,
width, height );
}
开发者ID:DavidGriffith,项目名称:finx,代码行数:31,代码来源:convolve.c
示例3: _mesa_Ortho
/**
* Apply an orthographic projection matrix.
*
* \param left left clipping plane coordinate.
* \param right right clipping plane coordinate.
* \param bottom bottom clipping plane coordinate.
* \param top top clipping plane coordinate.
* \param nearval distance to the near clipping plane.
* \param farval distance to the far clipping plane.
*
* \sa glOrtho().
*
* Flushes vertices and validates parameters. Calls _math_matrix_ortho() with
* the top matrix of the current matrix stack and sets
* __GLcontextRec::NewState.
*/
void GLAPIENTRY
_mesa_Ortho( GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top,
GLdouble nearval, GLdouble farval )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glOrtho(%f, %f, %f, %f, %f, %f)\n",
left, right, bottom, top, nearval, farval);
if (left == right ||
bottom == top ||
nearval == farval)
{
_mesa_error( ctx, GL_INVALID_VALUE, "glOrtho" );
return;
}
_math_matrix_ortho( ctx->CurrentStack->Top,
(GLfloat) left, (GLfloat) right,
(GLfloat) bottom, (GLfloat) top,
(GLfloat) nearval, (GLfloat) farval );
ctx->NewState |= ctx->CurrentStack->DirtyFlag;
}
开发者ID:mariuz,项目名称:haiku,代码行数:42,代码来源:matrix.c
示例4: _mesa_PrioritizeTextures
/**
* Set texture priorities.
*
* \param n number of textures.
* \param texName texture names.
* \param priorities corresponding texture priorities.
*
* \sa glPrioritizeTextures().
*
* Looks up each texture in the hash, clamps the corresponding priority between
* 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture.
*/
void GLAPIENTRY
_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName,
const GLclampf *priorities )
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (n < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPrioritizeTextures" );
return;
}
if (!priorities)
return;
for (i = 0; i < n; i++) {
if (texName[i] > 0) {
struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]);
if (t) {
t->Priority = CLAMP( priorities[i], 0.0F, 1.0F );
}
}
}
ctx->NewState |= _NEW_TEXTURE;
}
开发者ID:jay8muel,项目名称:Renderfusion,代码行数:39,代码来源:texobj.c
示例5: _mesa_GetCompressedTexImageARB
void GLAPIENTRY
_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
{
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (getcompressedteximage_error_check(ctx, target, level, img)) {
return;
}
if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !img) {
/* not an error, do nothing */
return;
}
texObj = _mesa_get_current_tex_object(ctx, target);
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) {
_mesa_debug(ctx,
"glGetCompressedTexImage(tex %u) format = %s, w=%d, h=%d\n",
texObj->Name,
_mesa_get_format_name(texImage->TexFormat),
texImage->Width, texImage->Height);
}
_mesa_lock_texture(ctx, texObj);
{
ctx->Driver.GetCompressedTexImage(ctx, target, level, img,
texObj, texImage);
}
_mesa_unlock_texture(ctx, texObj);
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:35,代码来源:texgetimage.c
示例6: _mesa_Viewport
/**
* Set the viewport.
*
* \param x, y coordinates of the lower-left corner of the viewport rectangle.
* \param width width of the viewport rectangle.
* \param height height of the viewport rectangle.
*
* \sa Called via glViewport() or display list execution.
*
* Flushes the vertices and calls _mesa_set_viewport() with the given
* parameters.
*/
void GLAPIENTRY
_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
_mesa_set_viewport(ctx, x, y, width, height);
}
开发者ID:mariuz,项目名称:haiku,代码行数:19,代码来源:matrix.c
示例7: _mesa_LogicOp
void
_mesa_LogicOp( GLenum opcode )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLogicOp");
switch (opcode) {
case GL_CLEAR:
case GL_SET:
case GL_COPY:
case GL_COPY_INVERTED:
case GL_NOOP:
case GL_INVERT:
case GL_AND:
case GL_NAND:
case GL_OR:
case GL_NOR:
case GL_XOR:
case GL_EQUIV:
case GL_AND_REVERSE:
case GL_AND_INVERTED:
case GL_OR_REVERSE:
case GL_OR_INVERTED:
ctx->Color.LogicOp = opcode;
ctx->NewState |= NEW_RASTER_OPS;
return;
default:
gl_error( ctx, GL_INVALID_ENUM, "glLogicOp" );
return;
}
}
开发者ID:OS2World,项目名称:LIB-VIDEO-MGL,代码行数:30,代码来源:logic.c
示例8: _mesa_PopMatrix
/**
* Pop the current matrix stack.
*
* \sa glPopMatrix().
*
* Flushes the vertices, verifies the current matrix stack is not empty, and
* moves the stack head down. Marks __GLcontextRec::NewState with the dirty
* stack flag.
*/
void GLAPIENTRY
_mesa_PopMatrix( void )
{
GET_CURRENT_CONTEXT(ctx);
struct gl_matrix_stack *stack = ctx->CurrentStack;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glPopMatrix %s\n",
_mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
if (stack->Depth == 0) {
if (ctx->Transform.MatrixMode == GL_TEXTURE) {
_mesa_error(ctx, GL_STACK_UNDERFLOW,
"glPopMatrix(mode=GL_TEXTURE, unit=%d)",
ctx->Texture.CurrentUnit);
}
else {
_mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
_mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
}
return;
}
stack->Depth--;
stack->Top = &(stack->Stack[stack->Depth]);
ctx->NewState |= stack->DirtyFlag;
}
开发者ID:mariuz,项目名称:haiku,代码行数:36,代码来源:matrix.c
示例9: _mesa_LockArraysEXT
void GLAPIENTRY
_mesa_LockArraysEXT(GLint first, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
if (first == 0 && count > 0 &&
count <= (GLint) ctx->Const.MaxArrayLockSize) {
ctx->Array.LockFirst = first;
ctx->Array.LockCount = count;
}
else {
ctx->Array.LockFirst = 0;
ctx->Array.LockCount = 0;
}
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= _NEW_ARRAY_ALL;
if (ctx->Driver.LockArraysEXT)
ctx->Driver.LockArraysEXT( ctx, first, count );
}
开发者ID:BackupTheBerlios,项目名称:dri-ex-svn,代码行数:25,代码来源:varray.c
示例10: _mesa_FogCoordPointerEXT
void GLAPIENTRY
_mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr)
{
GLint elementSize;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (stride < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glFogCoordPointer(stride)" );
return;
}
switch (type) {
case GL_FLOAT:
elementSize = sizeof(GLfloat);
break;
case GL_DOUBLE:
elementSize = sizeof(GLdouble);
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glFogCoordPointer(type)" );
return;
}
update_array(ctx, &ctx->Array.FogCoord, _NEW_ARRAY_FOGCOORD,
elementSize, 1, type, stride, GL_FALSE, ptr);
if (ctx->Driver.FogCoordPointer)
ctx->Driver.FogCoordPointer( ctx, type, stride, ptr );
}
开发者ID:BackupTheBerlios,项目名称:dri-ex-svn,代码行数:30,代码来源:varray.c
示例11: _mesa_PixelTexGenSGIX
void
_mesa_PixelTexGenSGIX(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelTexGenSGIX");
switch (mode) {
case GL_NONE:
ctx->Pixel.FragmentRgbSource = GL_PIXEL_GROUP_COLOR_SGIS;
ctx->Pixel.FragmentAlphaSource = GL_PIXEL_GROUP_COLOR_SGIS;
break;
case GL_ALPHA:
ctx->Pixel.FragmentRgbSource = GL_PIXEL_GROUP_COLOR_SGIS;
ctx->Pixel.FragmentAlphaSource = GL_CURRENT_RASTER_COLOR;
break;
case GL_RGB:
ctx->Pixel.FragmentRgbSource = GL_CURRENT_RASTER_COLOR;
ctx->Pixel.FragmentAlphaSource = GL_PIXEL_GROUP_COLOR_SGIS;
break;
case GL_RGBA:
ctx->Pixel.FragmentRgbSource = GL_CURRENT_RASTER_COLOR;
ctx->Pixel.FragmentAlphaSource = GL_CURRENT_RASTER_COLOR;
break;
default:
gl_error(ctx, GL_INVALID_ENUM, "glPixelTexGenSGIX(mode)");
return;
}
}
开发者ID:wwzbwwzb,项目名称:fbdri,代码行数:28,代码来源:pixeltex.c
示例12: glDrawElements
void glDrawElements(GLenum mode, GLsizei count,
GLenum type, const GLvoid *indices)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (!(ctx->clientstate_flags & GL_VERTEX_ARRAY))
return;
_math_matrix_mul_matrix(&ctx->model_projection_matrix,
&ctx->viewport.window_map,
ctx->projection_matrix_stack.top);
_math_matrix_mul_matrix(&ctx->model_projection_matrix,
&ctx->model_projection_matrix,
ctx->modelview_matrix_stack.top);
switch (mode) {
case GL_POINTS:
case GL_LINES:
case GL_TRIANGLES:
case GL_QUADS:
break;
default:
_sgl_error(ctx, GL_INVALID_ENUM, "glDrawElements(): Invalid mode\n");
return;
}
ctx->varray.mode = mode;
ctx->varray.count = count;
ctx->varray.type = type;
ctx->varray.indices_ptr = indices;
ctx->render_state.type = GL_VERTEX_ARRAY;
_sgl_pipeline_iteration();
}
开发者ID:aitjcize,项目名称:SGL,代码行数:34,代码来源:geometry.c
示例13: _mesa_StencilFunc
void
_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
GLint maxref;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilFunc");
switch (func) {
case GL_NEVER:
case GL_LESS:
case GL_LEQUAL:
case GL_GREATER:
case GL_GEQUAL:
case GL_EQUAL:
case GL_NOTEQUAL:
case GL_ALWAYS:
ctx->Stencil.Function = func;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glStencilFunc" );
return;
}
maxref = (1 << STENCIL_BITS) - 1;
ctx->Stencil.Ref = (GLstencil) CLAMP( ref, 0, maxref );
ctx->Stencil.ValueMask = (GLstencil) mask;
if (ctx->Driver.StencilFunc) {
(*ctx->Driver.StencilFunc)( ctx, func, ctx->Stencil.Ref, mask );
}
}
开发者ID:wwzbwwzb,项目名称:fbdri,代码行数:32,代码来源:stencil.c
示例14: _mesa_ReadPixels
void GLAPIENTRY
_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type, GLvoid *pixels )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (width < 0 || height < 0) {
_mesa_error( ctx, GL_INVALID_VALUE,
"glReadPixels(width=%d height=%d)", width, height );
return;
}
if (ctx->NewState)
_mesa_update_state(ctx);
if (error_check_format_type(ctx, format, type, GL_FALSE)) {
/* found an error */
return;
}
if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
"glReadPixels(incomplete framebuffer)" );
return;
}
if (!_mesa_source_buffer_exists(ctx, format)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)");
return;
}
ctx->Driver.ReadPixels(ctx, x, y, width, height,
format, type, &ctx->Pack, pixels);
}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:35,代码来源:drawpix.c
示例15: _mesa_LockArraysEXT
void GLAPIENTRY
_mesa_LockArraysEXT(GLint first, GLsizei count)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
if (first < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(first)" );
return;
}
if (count <= 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(count)" );
return;
}
if (ctx->Array.LockCount != 0) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glLockArraysEXT(reentry)" );
return;
}
ctx->Array.LockFirst = first;
ctx->Array.LockCount = count;
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= VERT_BIT_ALL;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:28,代码来源:varray.c
示例16: _mesa_ResetMinmax
static void GLAPIENTRY
_mesa_ResetMinmax(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glResetMinmax");
return;
}
if (target != GL_MINMAX) {
_mesa_error(ctx, GL_INVALID_ENUM, "glResetMinMax(target)");
return;
}
ctx->MinMax.Min[RCOMP] = 1000;
ctx->MinMax.Max[RCOMP] = -1000;
ctx->MinMax.Min[GCOMP] = 1000;
ctx->MinMax.Max[GCOMP] = -1000;
ctx->MinMax.Min[BCOMP] = 1000;
ctx->MinMax.Max[BCOMP] = -1000;
ctx->MinMax.Min[ACOMP] = 1000;
ctx->MinMax.Max[ACOMP] = -1000;
}
开发者ID:digdugg,项目名称:chromium.src,代码行数:25,代码来源:histogram.c
示例17: _mesa_DepthRange
/**
* Called by glDepthRange
*
* \param nearval specifies the Z buffer value which should correspond to
* the near clip plane
* \param farval specifies the Z buffer value which should correspond to
* the far clip plane
*/
void GLAPIENTRY
_mesa_DepthRange( GLclampd nearval, GLclampd farval )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval);
ctx->Viewport.Near = (GLfloat) CLAMP( nearval, 0.0, 1.0 );
ctx->Viewport.Far = (GLfloat) CLAMP( farval, 0.0, 1.0 );
ctx->NewState |= _NEW_VIEWPORT;
#if 1
/* XXX remove this someday. Currently the DRI drivers rely on
* the WindowMap matrix being up to date in the driver's Viewport
* and DepthRange functions.
*/
_math_matrix_viewport(&ctx->Viewport._WindowMap,
ctx->Viewport.X, ctx->Viewport.Y,
ctx->Viewport.Width, ctx->Viewport.Height,
ctx->Viewport.Near, ctx->Viewport.Far,
ctx->DrawBuffer->_DepthMaxF);
#endif
if (ctx->Driver.DepthRange) {
(*ctx->Driver.DepthRange)( ctx, nearval, farval );
}
}
开发者ID:mariuz,项目名称:haiku,代码行数:37,代码来源:matrix.c
示例18: _mesa_ResetHistogram
void
_mesa_ResetHistogram(GLenum target)
{
GLuint i;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* sideeffects */
if (!ctx->Extensions.EXT_histogram && !ctx->Extensions.ARB_imaging) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glResetHistogram");
return;
}
if (target != GL_HISTOGRAM) {
_mesa_error(ctx, GL_INVALID_ENUM, "glResetHistogram(target)");
return;
}
for (i = 0; i < HISTOGRAM_TABLE_SIZE; i++) {
ctx->Histogram.Count[i][0] = 0;
ctx->Histogram.Count[i][1] = 0;
ctx->Histogram.Count[i][2] = 0;
ctx->Histogram.Count[i][3] = 0;
}
ctx->NewState |= _NEW_PIXEL;
}
开发者ID:DavidGriffith,项目名称:finx,代码行数:26,代码来源:histogram.c
示例19: _mesa_ClearBufferfi
/**
* New in GL 3.0
* Clear depth/stencil buffer only.
*/
void GLAPIENTRY
_mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
GLfloat depth, GLint stencil)
{
GET_CURRENT_CONTEXT(ctx);
GLbitfield mask = 0;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
FLUSH_CURRENT(ctx, 0);
if (buffer != GL_DEPTH_STENCIL) {
_mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfi(buffer=%s)",
_mesa_lookup_enum_by_nr(buffer));
return;
}
/* Page 264 (page 280 of the PDF) of the OpenGL 3.0 spec says:
*
* "ClearBuffer generates an INVALID VALUE error if buffer is
* COLOR and drawbuffer is less than zero, or greater than the
* value of MAX DRAW BUFFERS minus one; or if buffer is DEPTH,
* STENCIL, or DEPTH STENCIL and drawbuffer is not zero."
*/
if (drawbuffer != 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glClearBufferfi(drawbuffer=%d)",
drawbuffer);
return;
}
if (ctx->RasterDiscard)
return;
if (ctx->NewState) {
_mesa_update_state( ctx );
}
if (ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer)
mask |= BUFFER_BIT_DEPTH;
if (ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer)
mask |= BUFFER_BIT_STENCIL;
if (mask) {
/* save current clear values */
const GLclampd clearDepthSave = ctx->Depth.Clear;
const GLuint clearStencilSave = ctx->Stencil.Clear;
/* set new clear values */
ctx->Depth.Clear = depth;
ctx->Stencil.Clear = stencil;
/* clear buffers */
ctx->Driver.Clear(ctx, mask);
/* restore */
ctx->Depth.Clear = clearDepthSave;
ctx->Stencil.Clear = clearStencilSave;
}
}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:63,代码来源:clear.c
示例20: _mesa_DrawPixels
/*
* Execute glDrawPixels
*/
void GLAPIENTRY
_mesa_DrawPixels( GLsizei width, GLsizei height,
GLenum format, GLenum type, const GLvoid *pixels )
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (width < 0 || height < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" );
return;
}
if (ctx->NewState) {
_mesa_update_state(ctx);
}
if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glDrawPixels (invalid fragment program)");
return;
}
if (error_check_format_type(ctx, format, type, GL_TRUE)) {
/* found an error */
return;
}
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
"glDrawPixels(incomplete framebuffer)" );
return;
}
if (!ctx->Current.RasterPosValid) {
return;
}
if (ctx->RenderMode == GL_RENDER) {
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
GLint x = IROUND(ctx->Current.RasterPos[0]);
GLint y = IROUND(ctx->Current.RasterPos[1]);
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
&ctx->Unpack, pixels);
}
else if (ctx->RenderMode == GL_FEEDBACK) {
/* Feedback the current raster pos info */
FLUSH_CURRENT( ctx, 0 );
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
_mesa_feedback_vertex( ctx,
ctx->Current.RasterPos,
ctx->Current.RasterColor,
ctx->Current.RasterIndex,
ctx->Current.RasterTexCoords[0] );
}
else {
ASSERT(ctx->RenderMode == GL_SELECT);
/* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:62,代码来源:drawpix.c
注:本文中的ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论