2011-10-02 22 views
0

查看我的xdpyinfo輸出,我看到許多重複完全相同特徵的Visuals。他們爲什麼重複?爲什麼在xdpyinfo中重複XVisuals

例如,

visual: 
visual id: 0x6e 
class: TrueColor 
depth: 32 planes 
available colormap entries: 256 per subfield 
red, green, blue masks: 0xff0000, 0xff00, 0xff 
significant bits in color specification: 8 bits 

visual: 
visual id: 0x6f 
class: TrueColor 
depth: 32 planes 
available colormap entries: 256 per subfield 
red, green, blue masks: 0xff0000, 0xff00, 0xff 
significant bits in color specification: 8 bits 

0x6e和0x6f是完全一樣的。

一個相關的問題:一個視覺已經有一個深度的概念,那麼爲什麼它需要將深度和視覺都傳遞給XCreateWindow?

回答

3
  1. 這兩個視覺效果不一定完全一樣。他們可能有不同的GLX屬性。運行glxinfo -v以查看它們。
  2. 視覺的深度是最大深度。例如,我的屏幕有很多視覺效果,所有視覺效果都是深度爲24或32. X服務器支持更多深度,在我的情況下爲24,1,4,8,15,16和32.在給定深度的視覺效果您可以創建一個較小深度的窗口。上述錯誤。視覺深度是它支持的唯一深度。不能創建任何其他深度的窗口。
+0

我沒有意識到Visual的深度是「最大深度」。 – reetone

+0

@reetone這顯然是錯誤的,請參閱更新(稍後我知道)。 –