All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v3] console: drop epoxy/gl.h include dependency
Date: Mon, 20 Mar 2017 12:24:53 +0100	[thread overview]
Message-ID: <1490009093-28083-1-git-send-email-kraxel@redhat.com> (raw)

Use "unsigned int" instead of GLenum and GLuint, so we don't depend on
these types from opengl headers.  Drop all CONFIG_OPENGL #ifdefs from
console.h

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h | 14 +++-----------
 include/ui/sdl2.h    |  4 ++++
 ui/sdl2-gl.c         |  2 +-
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index d759338..2f4aae2 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -9,10 +9,6 @@
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 
-#ifdef CONFIG_OPENGL
-# include <epoxy/gl.h>
-#endif
-
 /* keyboard/mouse support */
 
 #define MOUSE_EVENT_LBUTTON 0x01
@@ -136,11 +132,9 @@ struct DisplaySurface {
     pixman_format_code_t format;
     pixman_image_t *image;
     uint8_t flags;
-#ifdef CONFIG_OPENGL
-    GLenum glformat;
-    GLenum gltype;
-    GLuint texture;
-#endif
+    unsigned int glformat;
+    unsigned int gltype;
+    unsigned int texture;
 };
 
 typedef struct QemuUIInfo {
@@ -410,7 +404,6 @@ DisplaySurface *qemu_console_surface(QemuConsole *con);
 
 /* console-gl.c */
 typedef struct ConsoleGLState ConsoleGLState;
-#ifdef CONFIG_OPENGL
 ConsoleGLState *console_gl_init_context(void);
 void console_gl_fini_context(ConsoleGLState *gls);
 bool console_gl_check_format(DisplayChangeListener *dcl,
@@ -427,7 +420,6 @@ void surface_gl_destroy_texture(ConsoleGLState *gls,
 void surface_gl_setup_viewport(ConsoleGLState *gls,
                                DisplaySurface *surface,
                                int ww, int wh);
-#endif
 
 /* sdl.c */
 #ifdef CONFIG_SDL
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
index aaf226c..af86dfe 100644
--- a/include/ui/sdl2.h
+++ b/include/ui/sdl2.h
@@ -7,6 +7,10 @@
 #include <SDL.h>
 #include <SDL_syswm.h>
 
+#ifdef CONFIG_OPENGL
+# include <SDL_opengl.h>
+#endif
+
 struct sdl2_console {
     DisplayChangeListener dcl;
     DisplaySurface *surface;
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 1cd77e2..5bccdc9 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -29,10 +29,10 @@
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
-#include "ui/sdl2.h"
 #include "sysemu/sysemu.h"
 
 #include <epoxy/gl.h>
+#include "ui/sdl2.h"
 
 static void sdl2_set_scanout_mode(struct sdl2_console *scon, bool scanout)
 {
-- 
1.8.3.1

             reply	other threads:[~2017-03-20 11:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 11:24 Gerd Hoffmann [this message]
2017-03-20 12:08 ` [Qemu-devel] [PATCH v3] console: drop epoxy/gl.h include dependency Peter Maydell
2017-03-20 14:02   ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490009093-28083-1-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.