本文整理汇总了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函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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 );
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
}
示例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;
}
示例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 );
}
示例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 );
}
示例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;
}
}
示例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();
}
示例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 );
}
}
示例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);
}
示例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;
}