<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 13-12-08 08:45 AM, <a class="moz-txt-link-abbreviated" href="mailto:davyaxel@free.fr">davyaxel@free.fr</a>
wrote:<br>
</div>
<blockquote
cite="mid:870735384.604692905.1386510347079.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">The other cases in which we uses eglCreateImageKHR are with arguments that fit well with EGLClientBuffer.
But EGL_KHR_gl_image is a special case in which we have to pass a texture name,
and not a pointer on a structure defining a buffer.
"If <target> is EGL_GL_TEXTURE_2D_KHR, <buffer> must be the name of a
nonzero, GL_TEXTURE_2D target texture object, cast into
the type EGLClientBuffer."
The code actually works on my pc, and the patch I proposed removes the compilation warning.
If you think of a better way to cast the texture name into EGLClientBuffer, please indicate it.
</pre>
</blockquote>
<br>
Thanks for the info. I did a bit of reading as I suspected it is a
common problem. The compiler complains because there is no guaranty
that an unsigned long is big enough to hold a pointer. This is one
recommendation I saw, but I have no personal experience with it. You
can give it a try to make sure it works, but it compiles ok.<br>
<blockquote><tt>(EGLClientBuffer)(uintptr_t)tex</tt><tt> or just<br>
</tt><tt>(uintptr_t)tex</tt><br>
</blockquote>
I checked that uintptr_t is widely used in xserver and X libraries
and we do compile all of X with C99. It's worth a try because
suppressing the warning is dangerous as you will not be notified for
other cases where it will really be a problem.<br>
<br>
If that does not work, I'd rather keep the warning to be alerted of
other places in the code. Opinions will vary on that, the maintainer
has the last word.<br>
<br>
Thanks for looking into that.<br>
</body>
</html>