Authentication-Results: mail-b.sr.ht; dkim=pass header.d=protonmail.ch header.i=@protonmail.ch Received: from mail4.protonmail.ch (mail4.protonmail.ch [185.70.40.27]) by mail-b.sr.ht (Postfix) with ESMTPS id A45C7FF0EC for <~eliasnaur/gio@lists.sr.ht>; Sun, 17 Jan 2021 08:50:48 +0000 (UTC) Date: Sun, 17 Jan 2021 08:50:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=protonmail; t=1610873447; bh=WkuF8twuAu8Z33zbToSBkW86Xc15a1xb7xv+lr9ORNY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=WzXIaxQ0r5pYHk0WMWhPd8aMwSuZpe8ooM+7PlRFLfpGTZop8jsb/7UCX7otNZ/rx eNv4643sfUdquE/Vt9FcAFkqvLXb59qrMrHW9iwbFNaiBwhCNdr0N6KNYi4YL3+gVP /FSHyG+Hb2fXGo7m0tW/PzXMbBF0bclsvdXvXTkY= To: Zhao Wang From: Loki Verloren Cc: ~eliasnaur/gio@lists.sr.ht Reply-To: Loki Verloren Subject: Re: Injecting custom frame update to the flow? Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch It should be possible to take the pixels the other code is generating and p= ut them in an image op and update the window, does the other GL library have a head= less functionality? I assume the game environment captures events of interest al= so to the proposed Gio GUI you want to frame/overlay on it. If you can avoid the two things drawing into the same box there might be so= me way to make the box for the GL paint directly as it normally does and Gio just ren= der nothing in the same place. There might be synchronisation issues with this also, bu= t it probably would only make some screen garbage/flicker etc. idk. just thinking out lou= d. I have done a little work with headless rendering. I was initially going to= go for a more traditional offscreen private bitmap, using the headless context, to m= ake a scrolling view, but found I was able to skirt around doing so much blitting by running the = widgets to generate dimensions, as with dimensions computing how to render the view. T= hat's how my scrollbar widget works. It's the best scrollbar implementation to date for Gio, maybe looking at wh= at I did will give you some ideas? https://github.com/p9c/pod/blob/master/pkg/gui/list.go Sent with ProtonMail Secure Email. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Sunday, January 17th, 2021 at 08:33, Zhao Wang wr= ote: > Hi guys, > > I am trying to use gio to build a multi window chat client to have > > main chat UI in one > > window and run OpenGL ES game in another window which I hope to use Gio > > Window as well as the event loop and frame updating mechanism. > > The game has its own "drawFrame" method which calls standard OpenGL ES AP= Is. > > And does not use gio widgets yet (might need to add some later). > > I am wondering how I can inject the game's drawFrame into Gio window's fr= ame > > update loop. > > I spent some time digging into the code, it looks to me current frame > > drawing happens > > in gio/gpu/GPU.Frame() method. So seems not possible without API changes. > > Is this true? If so, any advice on how to do this? > > Thanks in advance for your help. > > - Zhao Wang