if (firstTime) {
pipe_mutex_init(_xmesa_lock);
screen = driver.create_pipe_screen( display );
- stapi = xmesa_create_st_api();
+ stapi = driver.create_st_api();
smapi = CALLOC_STRUCT(st_manager);
if (smapi)
smapi->screen = screen;
*
**************************************************************************/
-#ifndef XM_WINSYS_H
-#define XM_WINSYS_H
+#ifndef XM_PUBLIC_H
+#define XM_PUBLIC_H
-struct xm_driver;
+#include <X11/Xlib.h>
+
+struct pipe_screen;
+struct st_api;
/* This is the driver interface required by the glx/xlib state tracker.
*/
struct xm_driver {
struct pipe_screen *(*create_pipe_screen)( Display *display );
+ struct st_api *(*create_st_api)( void );
};
extern void
xmesa_set_driver( const struct xm_driver *driver );
-#endif
+#endif /* XM_PUBLIC_H */
#include "xm_api.h"
#include "xm_st.h"
-/* support OpenGL by default */
-#ifndef XMESA_ST_MODULE
-#define XMESA_ST_MODULE st_module_OpenGL
-#endif
-
struct xmesa_st_framebuffer {
struct pipe_screen *screen;
XMesaBuffer buffer;
{
/* TODO */
}
-
-struct st_api *
-xmesa_create_st_api(void)
-{
- return XMESA_ST_MODULE.create_api();
-}
#include "xm_api.h"
-struct st_api *
-xmesa_create_st_api(void);
-
struct st_framebuffer_iface *
xmesa_create_st_framebuffer(struct pipe_screen *screen, XMesaBuffer b);
return NULL;
}
-struct xm_driver xlib_driver =
+static struct xm_driver xlib_driver =
{
.create_pipe_screen = swrast_xlib_create_screen,
+ .create_st_api = st_manager_create_api,
};