summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/ggi/include
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-06-10 15:16:44 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-06-10 15:16:44 +0000
commitb58c5ad7b0a2c3ed3ecf189f284e23118091fa68 (patch)
tree65f0df21580a254758afe61094c51d436118ec54 /src/mesa/drivers/ggi/include
parentdd41748f63b819c36c4234a525e5609660ceb395 (diff)
GGI driver updates (Filip Spacek)
Diffstat (limited to 'src/mesa/drivers/ggi/include')
-rw-r--r--src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h58
-rw-r--r--src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h31
2 files changed, 50 insertions, 39 deletions
diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h
index a1e67fcbbf..5596e765d4 100644
--- a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h
+++ b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h
@@ -45,50 +45,40 @@
#include <ggi/ggi.h>
#include "GL/ggimesa.h"
-struct ggi_mesa_info;
+/*
+ * GGIMesa visual configuration.
+ *
+ * This structure "derives" from Mesa's GLvisual and extends it by
+ * GGI's visual. Combination of these two structures is enough to fully
+ * describe the mode the application is currently running in. GGI
+ * visual provides information about color configuration and buffering
+ * method, GLvisual fills the rest.
+ */
+struct ggi_mesa_visual {
+ GLvisual gl_visual;
+ ggi_visual_t ggi_visual;
+};
+/*
+ * GGIMesa context.
+ *
+ * GGIMesa context expands the Mesa's context (it doesn't actualy derive
+ * from it, but this ability isn't needed, and it is best if GL context
+ * creation is left up to Mesa). It also contains a reference to the GGI
+ * visual it is attached to, which is very useful for all Mesa callbacks.
+ */
struct ggi_mesa_context
{
GLcontext *gl_ctx;
- GLvisual *gl_vis;
- GLframebuffer *gl_buffer;
+ ggi_visual_t ggi_visual;
- ggi_visual_t ggi_vis;
- ggi_coord origin;
- int flip_y;
- int width, height, stride; /* Stride is in pixels */
ggi_pixel color; /* Current color or index*/
ggi_pixel clearcolor;
- void *lfb[2]; /* Linear frame buffers */
- int active_buffer;
- int bufsize;
- int viewport_init;
-};
-
-struct ggi_mesa_info
-{
- GLboolean rgb_flag;
- GLboolean db_flag;
- GLboolean alpha_flag;
- GLint index_bits;
- GLint red_bits, green_bits, blue_bits, alpha_bits;
- GLint depth_bits, stencil_bits, accum_bits;
+
+ void *private;
};
-extern GGIMesaContext GGIMesa; /* The current context */
-
#define SHIFT (GGI_COLOR_PRECISION - 8)
-#define GGICTX ((GGIMesaContext)ctx->DriverCtx)
-#define VIS (GGICTX->ggi_vis)
-#define FLIP(y) (GGICTX->flip_y-(y))
-
-#define LFB(type,x,y) ((type *)GGICTX->lfb[0] + (x) + (y) * GGICTX->stride)
-
-#define CTX_OPMESA(ctx) \
-((struct mesa_ext *)LIBGGI_EXT(((GGIMesaContext)ctx->DriverCtx)->ggi_vis, \
- ggiMesaID))
-
-
#endif
diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h
index ae4a3c5825..da8b10f2ff 100644
--- a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h
+++ b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h
@@ -11,14 +11,35 @@ extern ggi_extid ggiMesaID;
ggifunc_setmode GGIMesa_setmode;
ggifunc_getapi GGIMesa_getapi;
-typedef struct mesa_ext
+typedef struct ggi_mesa_ext
{
- void (*update_state)(GLcontext *ctx);
- int (*setup_driver)(GGIMesaContext ctx, struct ggi_mesa_info *info);
+ /*
+ * How mesa extends this visual; i.e., size of the depth buffer etc.
+ *
+ * By default (upon attaching) this structure is initialized to what
+ * libggi is guaranteed to handle without any help: single buffered
+ * visual without any ancilary buffers.
+ */
+ struct ggi_mesa_visual mesa_visual;
+
+ /*
+ * Mesa framebuffer is a collection of all ancilary buffers required.
+ *
+ * This structure contains the ancilary buffers provided in in
+ * software. On each mode change it is loaded with the list of
+ * required buffers and the target is expected to clear the ones
+ * it can provide in hw. The remaining ones are then provided in sw.
+ *
+ */
+ GLframebuffer mesa_buffer;
+
+ void (*update_state)(ggi_mesa_context_t ctx);
+ int (*setup_driver)(ggi_mesa_context_t ctx);
+
void *private;
-} mesaext;
+} ggi_mesa_ext_t;
-#define LIBGGI_MESAEXT(vis) ((mesaext *)LIBGGI_EXT(vis,ggiMesaID))
+#define LIBGGI_MESAEXT(vis) ((ggi_mesa_ext_t *)LIBGGI_EXT(vis,ggiMesaID))
#define GGIMESA_PRIVATE(vis) ((LIBGGI_MESAEXT(vis)->private))
#endif /* _GGI_MISC_INT_H */