goto fail;
}
- if (vigs_qt5_display()) {
+ if (vigs_qt5_enabled()) {
s->server = vigs_onscreen_server_create(memory_region_get_ram_ptr(&s->vram_bar),
memory_region_get_ram_ptr(&s->ram_bar),
&vigs_dpy_ops,
VIGS_LOG_TRACE("enter");
if (surface->ptr) {
- if (!vigs_qt5_display() && !planes_dirty) {
+ if (!vigs_qt5_enabled() && !planes_dirty) {
memcpy(display_data,
surface->ptr,
surface->stride * surface->ws_sfc->height);
VIGS_LOG_TRACE("enter");
- if (vigs_qt5_display()) {
+ if (vigs_qt5_enabled()) {
GLfloat *vert_coords;
GLfloat *tex_coords;
bool scale;
GLXFBConfig *glx_configs;
GLXFBConfig best_config = NULL;
- if (vigs_qt5_display()) {
+ if (vigs_qt5_enabled()) {
int config_attribs[] =
{
GLX_FBCONFIG_ID, 0,
gl_backend_glx->glXDestroyPbuffer(gl_backend_glx->dpy,
gl_backend_glx->read_pixels_sfc);
}
- if (!vigs_qt5_display() && gl_backend_glx->ctx) {
+ if (!vigs_qt5_enabled() && gl_backend_glx->ctx) {
gl_backend_glx->glXDestroyContext(gl_backend_glx->dpy,
gl_backend_glx->ctx);
}
VIGS_GL_GET_PROC(DeleteVertexArrays, glDeleteVertexArrays);
}
- if (vigs_qt5_display()) {
+ if (vigs_qt5_enabled()) {
gl_backend_glx->ctx =
(GLXContext)vigs_qt5_gl_context_create(gl_backend_glx->base.is_gl_2);
gl_backend_glx->glXDestroyPbuffer(gl_backend_glx->dpy,
gl_backend_glx->read_pixels_sfc);
}
- if (!vigs_qt5_display() && gl_backend_glx->ctx) {
+ if (!vigs_qt5_enabled() && gl_backend_glx->ctx) {
gl_backend_glx->glXDestroyContext(gl_backend_glx->dpy,
gl_backend_glx->ctx);
}
#include "vigs_gl_backend.h"
#include "vigs_log.h"
+#include "vigs_qt5.h"
#include <windows.h>
#include <wingdi.h>
#include <GL/gl.h>
};
const char *ext_str = NULL;
struct vigs_gl_backend_wgl *gl_backend_wgl = NULL;
+ HGLRC qt5_ctx = NULL;
vigs_win_class.cbSize = sizeof(WNDCLASSEXA);
vigs_win_class.style = 0;
DestroyWindow(tmp_win);
tmp_win = NULL;
+ if (vigs_qt5_enabled()) {
+ qt5_ctx =
+ (HGLRC)vigs_qt5_gl_context_create(gl_backend_wgl->base.is_gl_2);
+ if (!qt5_ctx) {
+ goto fail;
+ }
+ }
+
gl_backend_wgl->win = CreateWindow(VIGS_WGL_WIN_CLASS, "VIGSWin",
WS_DISABLED | WS_POPUP,
0, 0, 1, 1, NULL, NULL, 0, 0);
}
if (!vigs_gl_backend_wgl_create_context(gl_backend_wgl,
- NULL,
+ qt5_ctx,
&gl_backend_wgl->ctx)) {
goto fail;
}
extern QOpenGLContext *qt5GLContext;
extern QSurfaceFormat qt5GLFormat;
+bool vigs_qt5_enabled(void)
+{
+ return qt5App != NULL;
+}
+
void *vigs_qt5_display(void)
{
if (!qt5App) {
extern "C" {
#endif
+bool vigs_qt5_enabled(void);
+
void *vigs_qt5_display(void);
void *vigs_qt5_gl_context_create(bool is_gl2);
#include "maru_display.h"
#include "qt5_supplement.h"
+extern QemuMutex sdl_mutex;
+extern QemuCond sdl_cond;
+
//static Notifier mouse_mode_notifier;
static int qt5_num_outputs;
{
int i;
+#ifdef SDL_THREAD
+ qemu_mutex_init(&sdl_mutex);
+ qemu_cond_init(&sdl_cond);
+#endif
+
// prepare gui
qt5_prepare();
*/
if (context) {
- context->makeCurrent();
while (!terminating) {
+ context->makeCurrent();
if (qt5_graphic_hw_display()) {
context->swapBuffers();
}
+ context->doneCurrent();
}
- context->doneCurrent();
} else {
while (!terminating) {
qt5_graphic_hw_display();