87 |
}); |
}); |
88 |
return p; |
return p; |
89 |
} |
} |
90 |
|
|
91 |
|
static public GLRen.FixedPaperQuad selectionFixedPaperQuad() { |
92 |
|
return selectionFixedPaperQuad(null); |
93 |
|
} |
94 |
|
static public GLRen.FixedPaperQuad selectionFixedPaperQuad(Color color) { |
95 |
|
return GLRen.createFixedPaperQuad(selectionPaper(color), 0, 0, 1, 1, 0, 1, 1, 10, null, 1); |
96 |
|
} |
97 |
|
|
98 |
|
static public Paper selectionPaper() { |
99 |
|
return selectionPaper(null); |
100 |
|
} |
101 |
|
/** Create a paper that is able to show a "selection". |
102 |
|
*/ |
103 |
|
static public Paper selectionPaper(Color color) { |
104 |
|
if(color == null) color = new Color(.6f, .5f, .7f); |
105 |
|
Paper selectPaper = new Paper(); |
106 |
|
selectPaper.setNPasses(1); |
107 |
|
Paper.Pass pas = selectPaper.getPass(0); |
108 |
|
pas.setSetupcode( |
109 |
|
"PushAttrib CURRENT_BIT ENABLE_BIT COLOR_BUFFER_BIT\n"+ |
110 |
|
"Disable TEXTURE_2D\n"+ |
111 |
|
"Disable DEPTH_TEST\n"+ |
112 |
|
"Disable STENCIL_TEST\n"+ |
113 |
|
"Color "+ColorUtil.colorGLString(color)+"\n"+ |
114 |
|
"Enable BLEND\n"+ |
115 |
|
"BlendFunc ONE ONE_MINUS_SRC_COLOR\n" |
116 |
|
); |
117 |
|
pas.setTeardowncode(" PopAttrib\n"); |
118 |
|
return selectPaper; |
119 |
|
} |
120 |
|
|
121 |
} |
} |