};
}
+// TODO: This probably should not be included directly.
+#include "config-host.h"
class QOpenGLFunctions;
class QOpenGLShaderProgram;
void changedTexture(struct dpy_item *tex);
+#ifdef CONFIG_OPENGL
QOpenGLContext *createSharedContext(int major, int minor);
bool activateSharedContext(QOpenGLContext *ctx);
+#endif
protected:
void initializeGL();
QOpenGLShaderProgram *texProgram;
QOpenGLShaderProgram *scaleProgram;
+#ifdef CONFIG_OPENGL
QOffscreenSurface *offscreen;
+#endif
};
#endif // DISPLAYGLWIDGET_H
qt5_refresh_internal();
}
+static void qt5_mouse_warp(DisplayChangeListener *dcl,
+ int x, int y, int on)
+{
+}
+
+static void qt5_mouse_define(DisplayChangeListener *dcl,
+ QEMUCursor *c)
+{
+}
+
+static const DisplayChangeListenerOps dcl_ops = {
+ .dpy_name = "qt5",
+ .dpy_gfx_update = qt5_update,
+ .dpy_gfx_switch = qt5_switch,
+ .dpy_refresh = qt5_refresh,
+ .dpy_mouse_set = qt5_mouse_warp,
+ .dpy_cursor_define = qt5_mouse_define,
+};
+
+#ifdef CONFIG_OPENGL
static void qt5_gl_update(DisplayChangeListener *dcl,
int x, int y, int w, int h)
{
}
}
-static void qt5_mouse_warp(DisplayChangeListener *dcl,
- int x, int y, int on)
-{
-}
-
-static void qt5_mouse_define(DisplayChangeListener *dcl,
- QEMUCursor *c)
-{
-}
-
static QEMUGLContext qt5_gl_create_context(DisplayChangeListener *dcl,
QEMUGLParams *params)
{
static int qt5_gl_make_context_current(DisplayChangeListener *dcl,
QEMUGLContext ctx)
{
- qt5_gl_make_context_current_internal(ctx);
+ return qt5_gl_make_context_current_internal(ctx);
}
static QEMUGLContext qt5_gl_get_current_context(DisplayChangeListener *dcl)
}
}
-static const DisplayChangeListenerOps dcl_ops = {
- .dpy_name = "qt5",
- .dpy_gfx_update = qt5_update,
- .dpy_gfx_switch = qt5_switch,
- .dpy_refresh = qt5_refresh,
- .dpy_mouse_set = qt5_mouse_warp,
- .dpy_cursor_define = qt5_mouse_define,
-};
-
static const DisplayChangeListenerOps dcl_gl_ops = {
.dpy_name = "qt5-gl",
.dpy_gfx_update = qt5_gl_update,
.dpy_gl_scanout = qt5_gl_scanout,
.dpy_gl_update = qt5_gl_scanout_flush,
};
+#endif
void maru_early_qt5_display_init(enum maru_display_type display_type)
{
qt5_console = g_new0(struct qt5_state, qt5_num_outputs);
for (i = 0; i < qt5_num_outputs; i++) {
QemuConsole *con = qemu_console_lookup_by_index(i);
+#ifdef CONFIG_OPENGL
qt5_console[i].dcl.ops = display_opengl ? &dcl_gl_ops : &dcl_ops;
+#else
+ qt5_console[i].dcl.ops = &dcl_ops;
+#endif
qt5_console[i].dcl.con = con;
register_displaychangelistener(&qt5_console[i].dcl);
qt5_console[i].idx = i;
+#ifdef CONFIG_OPENGL
qt5_console[i].gen = 0;
qt5_console[i].updated = false;
qt5_console[i].gls = NULL;
qt5_console[i].ctx = qt5_gl_create_context_internal(3, 3);
qt5_console[i].is_scanout = false;
qt5_console[i].scanout_fbs[0] = 0;
+#endif
}
if (full_screen) {