Re: glXChooseVisual does not handle GLX_RGBA correctly

2007-05-16 Thread Larry Hall (Cygwin X)
Geoff Levner wrote:
 Larry Hall (Cygwin X) wrote:
 Geoff Levner wrote:
 
 I have an OpenGL-based application executing on a Sun, but displaying
 on a PC running Windows XP and an X server. The app requires a
 TrueColor visual, so when it calls glXChooseVisual, it passes
 GLX_RGBA in the attribute list. This works fine with another X server
 (Exceed), but when using Cygwin/X, glXChooseVisual fails to return a
 visual.
 
 Running xdpyinfo would seem to indicate that the server has *only* 
 TrueColor visuals (see the output below). And in fact if I remove 
 GLX_RGBA from the attribute list, glXChooseVisual does return one of 
 those visuals. If I ask for information about the visual with 
 glXGetConfig, it responds that color buffers store color indices 
 (GLX_RGBA is false), yet the application works correctly.
 
 Anybody have a clue what is going on here?
 
 
 
 Looks to me like you're app is looking for 32 bits while Cygwin-X is 
 only providing 24 bits.  Unless you know you absolutely need 
 transparency, I think you'll find everything works fine with the
 visuals you can get. Just ask for GLX_RGB instead.
 
 
 That sounds reasonable, but GLX_RGB is not defined, and I can't find any 
 reference to it in the GLX 1.4 specifications. According to the 
 documentation, GLX_RGBA just means you want TrueColor or DirectColor 
 visuals; it says nothing about alpha. And we do not ask for any alpha 
 bits...


Yup, you're right.  I was thinking of something else.

Perhaps it's just your combination of attributes.  You might check that.
The combination below has worked for me before, albeit from a Linux
machine to Cygwin/X:

int visual_attributes[] =
{
GLX_DOUBLEBUFFER,
GLX_RGBA,
GLX_RED_SIZE,  1,
GLX_GREEN_SIZE,1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE,1,
GLX_STENCIL_SIZE,  1,
GLX_ACCUM_RED_SIZE,1,
GLX_ACCUM_GREEN_SIZE,  1,
GLX_ACCUM_BLUE_SIZE,   1,
None
};




-- 
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



glXChooseVisual does not handle GLX_RGBA correctly

2007-05-14 Thread Geoff Levner
I have an OpenGL-based application executing on a Sun, but displaying on 
a PC running Windows XP and an X server. The app requires a TrueColor 
visual, so when it calls glXChooseVisual, it passes GLX_RGBA in the 
attribute list. This works fine with another X server (Exceed), but when 
using Cygwin/X, glXChooseVisual fails to return a visual.


Running xdpyinfo would seem to indicate that the server has *only* 
TrueColor visuals (see the output below). And in fact if I remove 
GLX_RGBA from the attribute list, glXChooseVisual does return one of 
those visuals. If I ask for information about the visual with 
glXGetConfig, it responds that color buffers store color indices 
(GLX_RGBA is false), yet the application works correctly.


Anybody have a clue what is going on here?

Thanks,
Geoff

Output from xdpyinfo:

 number of visuals:4
 default visual id:  0x22
 visual:
   visual id:0x22
   class:TrueColor
   depth:24 planes
   available colormap entries:256 per subfield
   red, green, blue masks:0xff, 0xff00, 0xff
   significant bits in color specification:8 bits
 visual:
   visual id:0x23
   class:TrueColor
   depth:24 planes
   available colormap entries:256 per subfield
   red, green, blue masks:0xff, 0xff00, 0xff
   significant bits in color specification:8 bits
 visual:
   visual id:0x24
   class:TrueColor
   depth:24 planes
   available colormap entries:256 per subfield
   red, green, blue masks:0xff, 0xff00, 0xff
   significant bits in color specification:8 bits
 visual:
   visual id:0x25
   class:TrueColor
   depth:24 planes
   available colormap entries:256 per subfield
   red, green, blue masks:0xff, 0xff00, 0xff
   significant bits in color specification:8 bits


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: glXChooseVisual does not handle GLX_RGBA correctly

2007-05-14 Thread Larry Hall (Cygwin X)
Geoff Levner wrote:
 I have an OpenGL-based application executing on a Sun, but displaying on
 a PC running Windows XP and an X server. The app requires a TrueColor
 visual, so when it calls glXChooseVisual, it passes GLX_RGBA in the
 attribute list. This works fine with another X server (Exceed), but when
 using Cygwin/X, glXChooseVisual fails to return a visual.
 
 Running xdpyinfo would seem to indicate that the server has *only*
 TrueColor visuals (see the output below). And in fact if I remove
 GLX_RGBA from the attribute list, glXChooseVisual does return one of
 those visuals. If I ask for information about the visual with
 glXGetConfig, it responds that color buffers store color indices
 (GLX_RGBA is false), yet the application works correctly.
 
 Anybody have a clue what is going on here?


Looks to me like you're app is looking for 32 bits while Cygwin-X is
only providing 24 bits.  Unless you know you absolutely need transparency,
I think you'll find everything works fine with the visuals you can get.
Just ask for GLX_RGB instead.

-- 
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/