From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Antonio Caggiano <quic_acaggian@quicinc.com>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH v3] ui/sdl2: OpenGL window context
Date: Mon, 12 Jun 2023 10:25:08 +0200 [thread overview]
Message-ID: <CAMxuvaxtXA73nbvuWOBdo=Ve93XJ1yhpi5i64J7YyyTa2BEHGQ@mail.gmail.com> (raw)
In-Reply-To: <20230609140752.69758-1-quic_acaggian@quicinc.com>
[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]
Hi Antonio
On Fri, Jun 9, 2023 at 4:08 PM Antonio Caggiano <quic_acaggian@quicinc.com>
wrote:
> When OpenGL is enabled, create only the OpenGL context, ignoring the SDL
> renderer as it is unused anyway.
>
> Signed-off-by: Antonio Caggiano <quic_acaggian@quicinc.com>
> ---
> v2: There is no need to specify major and minor version if the SDL
> renderer is
> not created. Also, tested on Windows.
> v3: Completely messed up the commit, now fixed.
>
> ui/sdl2.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ui/sdl2.c b/ui/sdl2.c
> index 9d703200bf..82e6ee5511 100644
> --- a/ui/sdl2.c
> +++ b/ui/sdl2.c
> @@ -113,11 +113,11 @@ void sdl2_window_create(struct sdl2_console *scon)
>
> SDL_SetHint(SDL_HINT_RENDER_DRIVER, driver);
> SDL_SetHint(SDL_HINT_RENDER_BATCHING, "1");
> - }
> - scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0);
>
> - if (scon->opengl) {
> scon->winctx = SDL_GL_CreateContext(scon->real_window);
> + } else {
> + /* The SDL renderer is only used by sdl2-2D, when OpenGL is
> disabled */
> + scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1,
> 0);
> }
> sdl_update_caption(scon);
> }
> --
> 2.40.0
>
sdl2_window_destroy() should still be updated to avoid calling Destroy
functions with NULL arguments. (we don't check the return value, but it's
being checked by SDL)
[-- Attachment #2: Type: text/html, Size: 2012 bytes --]
prev parent reply other threads:[~2023-06-12 8:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 14:07 [PATCH v3] ui/sdl2: OpenGL window context Antonio Caggiano
2023-06-12 8:25 ` Marc-André Lureau [this message]
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='CAMxuvaxtXA73nbvuWOBdo=Ve93XJ1yhpi5i64J7YyyTa2BEHGQ@mail.gmail.com' \
--to=marcandre.lureau@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quic_acaggian@quicinc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).