/*
* Return a handle to the current context.
*/
-void *DMesaGetCurrentContext (void);
+DMesaContext DMesaGetCurrentContext (void);
*/
void DMesaDestroyBuffer (DMesaBuffer b);
+/*
+ * Return a handle to the current buffer.
+ */
+DMesaBuffer DMesaGetCurrentBuffer (void);
+
/*
* Swap the front and back buffers for the given Buffer.
* No action is taken if the buffer is not double buffered.
GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx);
-GLAPI void * GLAPIENTRY fxMesaGetCurrentContext(void);
+GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void);
GLAPI void GLAPIENTRY fxMesaSwapBuffers(void);
switch (name) {
case GL_RENDERER:
return (const GLubyte *)"Mesa DJGPP"
- "\0port (c) Borca Daniel dec-2003";
+ "\0port (c) Borca Daniel feb-2004";
default:
return NULL;
}
DMesaContext DMesaCreateContext (DMesaVisual visual,
DMesaContext share)
{
-#ifndef FX
GLcontext *c;
+#ifndef FX
TNLcontext *tnl;
struct dd_function_table functions;
_swsetup_Wakeup(c);
}
- return (DMesaContext)c;
-
#else /* FX */
- return (DMesaContext)visual;
+ c = (GLcontext *)0xdeadbeef;
#endif /* FX */
+
+ return (DMesaContext)c;
}
-void *DMesaGetCurrentContext (void)
+DMesaContext DMesaGetCurrentContext (void)
{
-#ifndef FX
GET_CURRENT_CONTEXT(ctx);
- return ctx;
+
+#ifndef FX
+#else
+ if (ctx != NULL) {
+ ctx = (GLcontext *)0xdeadbeef;
+ }
+#endif
+
+ return (DMesaContext)ctx;
+}
+
+
+
+DMesaBuffer DMesaGetCurrentBuffer (void)
+{
+ const DMesaContext dmesa = DMesaGetCurrentContext();
+
+ if (dmesa == NULL) {
+ return NULL;
+ }
+
+#ifndef FX
+ return dmesa->buffer;
#else
- return fxMesaGetCurrentContext();
+ return (DMesaBuffer)fxMesaGetCurrentContext();
#endif
}
}
-void * GLAPIENTRY fxMesaGetCurrentContext (void)
+fxMesaContext GLAPIENTRY fxMesaGetCurrentContext (void)
{
- GET_CURRENT_CONTEXT(ctx);
- return ctx;
+ return fxMesaCurrentCtx;
}
}
}
#endif
-#if 1 || FX_COMPRESS_DXT5_AS_DXT3_HACK
+#if 0 && FX_COMPRESS_DXT5_AS_DXT3_HACK
/* [dBorca] either VSA is stupid at DXT5,
* or our compression tool is broken. See
* above for caveats.