-/* $Id: drawpix.c,v 1.58 2001/12/14 02:55:08 brianp Exp $ */
+/* $Id: drawpix.c,v 1.59 2002/01/15 21:49:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
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->RenderMode==GL_RENDER) {
GLint x, y;
if (!pixels || !ctx->Current.RasterPosValid) {
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ if (width < 0 || height < 0) {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glReadPixels(width or height < 0)" );
+ return;
+ }
+
if (!pixels) {
_mesa_error( ctx, GL_INVALID_VALUE, "glReadPixels(pixels)" );
return;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glCopyPixels" );
+ _mesa_error( ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)" );
return;
}
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- /* Error checking */
if (width < 0 || height < 0) {
- _mesa_error( ctx, GL_INVALID_VALUE, "glBitmap" );
+ _mesa_error( ctx, GL_INVALID_VALUE, "glBitmap(width or height < 0)" );
return;
}
-/* $Id: s_drawpix.c,v 1.24 2002/01/10 16:54:29 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.25 2002/01/15 21:49:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
return;
}
+ if (ctx->Visual.stencilBits == 0) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawPixels(no stencil buffer)");
+ return;
+ }
+
drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
for (row = 0; row < height; row++, y++) {