[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk
Subject:    Re: GtkGLArea with GtkOffscreenWindow
From:       Rob Conde <rob.conde () ai-solutions ! com>
Date:       2018-10-04 18:36:30
Message-ID: BN7PR08MB4756715A5651F41DFBF9006DC8EA0 () BN7PR08MB4756 ! namprd08 ! prod ! outlook ! com
[Download RAW message or body]

Replying to myself:


Talked to Emmanuele on IRC...the gist is:


  *   no, this won't work
  *   GtkOffscreenWindow shouldn't be used in general
  *   The desired effect can be achieved by using a GtkWindow, not showing it, and \
explicitly mapping the widget


Rob



________________________________
From: gtk-list <gtk-list-bounces@gnome.org> on behalf of Rob Conde \
                <rob.conde@ai-solutions.com>
Sent: Thursday, October 4, 2018 8:17:59 AM
To: gtk-list@gnome.org
Subject: GtkGLArea with GtkOffscreenWindow


Hello,

   Consider the following program:


int main()
{
gtk_init(nullptr,nullptr);

auto window = gtk_offscreen_window_new();
auto gl_area = gtk_gl_area_new();

gtk_container_add(GTK_CONTAINER(window),gl_area);

gtk_widget_realize(gl_area);

gtk_widget_show_all(window);

auto glContext = gtk_gl_area_get_context(GTK_GL_AREA(gl_area));

std::cout << "Context is " << glContext << std::endl;

gtk_main();
}


The glContext is null. Can GtkGLArea work with GtkOffscreenWindow?


Thanks,

Rob Conde


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} \
--></style> </head>
<body dir="ltr">
<div id="divtagdefaultwrapper" \
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" \
dir="ltr"> <p style="margin-top:0;margin-bottom:0">Replying to myself:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Talked to Emmanuele on IRC...the gist is:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<ul style="margin-bottom: 0px; margin-top: 0px;">
<li><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, &quot;Apple \
Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, NotoColorEmoji, &quot;Segoe UI \
Symbol&quot;, &quot;Android Emoji&quot;, EmojiSymbols; font-size: 16px;">no, this \
won't work</span><br> </li><li><span style="font-family: Calibri, Helvetica, \
sans-serif, EmojiFont, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, \
NotoColorEmoji, &quot;Segoe UI Symbol&quot;, &quot;Android Emoji&quot;, EmojiSymbols; \
font-size: 16px;">GtkOffscreenWindow shouldn't be used in \
general</span></li><li><span style="font-family: Calibri, Helvetica, sans-serif, \
EmojiFont, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, NotoColorEmoji, \
&quot;Segoe UI Symbol&quot;, &quot;Android Emoji&quot;, EmojiSymbols; font-size: \
16px;">The desired effect can be achieved by using a GtkWindow, not  showing it, and \
explicitly mapping the widget</span></li></ul> <br>
<p></p>
<p style="margin-top:0;margin-bottom:0">Rob</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>From:</b> gtk-list \
&lt;gtk-list-bounces@gnome.org&gt; on behalf of Rob Conde \
&lt;rob.conde@ai-solutions.com&gt;<br> <b>Sent:</b> Thursday, October 4, 2018 8:17:59 \
AM<br> <b>To:</b> gtk-list@gnome.org<br>
<b>Subject:</b> GtkGLArea with GtkOffscreenWindow</font>
<div>&nbsp;</div>
</div>
<meta content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none">
<!--
p
	{margin-top:0;
	margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; \
font-family:Calibri,Helvetica,sans-serif"> <p style="margin-top:0; \
margin-bottom:0">Hello,</p> <p style="margin-top:0; margin-bottom:0">&nbsp; \
&nbsp;Consider the following program:</p> <p style="margin-top:0; \
margin-bottom:0"><br> </p>
<p style="margin-top:0; margin-bottom:0"></p>
<div>int main()</div>
<div>{</div>
<div><span style="white-space:pre"></span>gtk_init(nullptr,nullptr);</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>auto window = \
gtk_offscreen_window_new();</div> <div><span style="white-space:pre"></span>auto \
gl_area = gtk_gl_area_new();</div> <div><br>
</div>
<div><span style="white-space:pre"></span>gtk_container_add(GTK_CONTAINER(window),gl_area);</div>
 <div><br>
</div>
<div><span style="white-space:pre"></span>gtk_widget_realize(gl_area);</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>gtk_widget_show_all(window);</div>
<div><br>
</div>
<div><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,&quot;Apple \
Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI \
Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols; font-size:16px; \
white-space:pre"></span>auto glContext = \
gtk_gl_area_get_context(GTK_GL_AREA(gl_area));</div> <div><br>
</div>
<div><span style="white-space:pre"></span>std::cout &lt;&lt; &quot;Context is &quot; \
&lt;&lt; glContext &lt;&lt; std::endl;</div> <div><br>
</div>
<div><span style="white-space:pre"></span>gtk_main();</div>
<div>}</div>
&nbsp;&nbsp;
<p></p>
<p style="margin-top:0; margin-bottom:0">The glContext is null. Can GtkGLArea work \
with GtkOffscreenWindow?</p> <p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks,</p>
<p style="margin-top:0; margin-bottom:0">Rob Conde</p>
</div>
</div>
</body>
</html>



_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list

--===============7296990125643282617==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic