summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/context.c8
-rw-r--r--src/mesa/main/context.h2
-rw-r--r--src/mesa/main/imports.c10
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c3
-rw-r--r--src/mesa/state_tracker/st_context.c13
-rw-r--r--src/mesa/state_tracker/st_public.h6
6 files changed, 29 insertions, 13 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ff9dd488c7..ad47e22580 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1259,7 +1259,7 @@ initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
* \param drawBuffer the drawing framebuffer
* \param readBuffer the reading framebuffer
*/
-void
+GLboolean
_mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer )
{
@@ -1272,14 +1272,14 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
if (!check_compatible(newCtx, drawBuffer)) {
_mesa_warning(newCtx,
"MakeCurrent: incompatible visuals for context and drawbuffer");
- return;
+ return GL_FALSE;
}
}
if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) {
if (!check_compatible(newCtx, readBuffer)) {
_mesa_warning(newCtx,
"MakeCurrent: incompatible visuals for context and readbuffer");
- return;
+ return GL_FALSE;
}
}
@@ -1384,6 +1384,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
newCtx->FirstTimeCurrent = GL_FALSE;
}
}
+
+ return GL_TRUE;
}
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 5b57d88029..6b3e1b2b97 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -130,7 +130,7 @@ extern void
_mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
-extern void
+extern GLboolean
_mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer );
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 615f7c9a6d..3fb67083a2 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -1008,6 +1008,16 @@ output_if_debug(const char *prefixString, const char *outputString,
fprintf(stderr, "%s: %s", prefixString, outputString);
if (newline)
fprintf(stderr, "\n");
+
+#if defined(_WIN32) && !defined(_WIN32_WCE)
+ /* stderr from windows applications without console is not usually
+ * visible, so communicate with the debugger instead */
+ {
+ char buf[4096];
+ _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : "");
+ OutputDebugStringA(buf);
+ }
+#endif
}
}
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 4e70510c0c..5c7206409c 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -192,7 +192,8 @@ static void update_raster_state( struct st_context *st )
raster->point_sprite = ctx->Point.PointSprite;
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
if (ctx->Point.CoordReplace[i]) {
- if (ctx->Point.SpriteOrigin == GL_UPPER_LEFT)
+ if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
+ (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_UPPER_LEFT;
else
raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_LOWER_LEFT;
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index e536029e86..92ddffc014 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -263,9 +263,10 @@ void st_destroy_context( struct st_context *st )
}
-void st_make_current(struct st_context *st,
- struct st_framebuffer *draw,
- struct st_framebuffer *read)
+GLboolean
+st_make_current(struct st_context *st,
+ struct st_framebuffer *draw,
+ struct st_framebuffer *read)
{
/* Call this periodically to detect when the user has begun using
* GL rendering from multiple threads.
@@ -274,7 +275,8 @@ void st_make_current(struct st_context *st,
if (st) {
GLboolean firstTime = st->ctx->FirstTimeCurrent;
- _mesa_make_current(st->ctx, &draw->Base, &read->Base);
+ if(!_mesa_make_current(st->ctx, &draw->Base, &read->Base))
+ return GL_FALSE;
/* Need to initialize viewport here since draw->Base->Width/Height
* will still be zero at this point.
* This could be improved, but would require rather extensive work
@@ -286,9 +288,10 @@ void st_make_current(struct st_context *st,
_mesa_set_scissor(st->ctx, 0, 0, w, h);
}
+ return GL_TRUE;
}
else {
- _mesa_make_current(NULL, NULL, NULL);
+ return _mesa_make_current(NULL, NULL, NULL);
}
}
diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h
index 174fbc6394..04d3a3d7c2 100644
--- a/src/mesa/state_tracker/st_public.h
+++ b/src/mesa/state_tracker/st_public.h
@@ -91,9 +91,9 @@ void *st_framebuffer_private( struct st_framebuffer *stfb );
void st_unreference_framebuffer( struct st_framebuffer *stfb );
-void st_make_current(struct st_context *st,
- struct st_framebuffer *draw,
- struct st_framebuffer *read);
+GLboolean st_make_current(struct st_context *st,
+ struct st_framebuffer *draw,
+ struct st_framebuffer *read);
struct st_context *st_get_current(void);