Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2011-07-13 |
2 | // Created by: Sergey ZERCHANINOV | |
a174a3c5 | 3 | // Copyright (c) 2011-2013 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
d5f74e42 | 7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
11 | // distribution for complete text of the license and disclaimer of any warranty. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
b311480e | 15 | |
2166f0fa | 16 | #include <OpenGl_AspectText.hxx> |
30f0ad28 | 17 | #include <OpenGl_GlCore11.hxx> |
a174a3c5 | 18 | #include <OpenGl_GraphicDriver.hxx> |
30f0ad28 | 19 | #include <OpenGl_ShaderManager.hxx> |
20 | #include <OpenGl_ShaderProgram.hxx> | |
21 | #include <OpenGl_ShaderStates.hxx> | |
22 | #include <OpenGl_Text.hxx> | |
bf75be98 | 23 | #include <OpenGl_Workspace.hxx> |
ce01ec26 | 24 | #include <OpenGl_View.hxx> |
2166f0fa | 25 | |
a174a3c5 | 26 | #include <Font_FontMgr.hxx> |
d2eddacc | 27 | #include <Font_FTFont.hxx> |
825aa485 | 28 | #include <Graphic3d_TransformUtils.hxx> |
a174a3c5 | 29 | #include <TCollection_HAsciiString.hxx> |
30 | ||
a174a3c5 | 31 | #ifdef HAVE_GL2PS |
32 | #include <gl2ps.h> | |
33 | #endif | |
34 | ||
35 | namespace | |
2166f0fa | 36 | { |
c827ea3a | 37 | static const GLdouble THE_IDENTITY_MATRIX[16] = |
a174a3c5 | 38 | { |
c827ea3a | 39 | 1.0, 0.0, 0.0, 0.0, |
40 | 0.0, 1.0, 0.0, 0.0, | |
41 | 0.0, 0.0, 1.0, 0.0, | |
42 | 0.0, 0.0, 0.0, 1.0 | |
a174a3c5 | 43 | }; |
44 | ||
45 | #ifdef HAVE_GL2PS | |
46 | static char const* TheFamily[] = {"Helvetica", "Courier", "Times"}; | |
47 | static char const* TheItalic[] = {"Oblique", "Oblique", "Italic"}; | |
48 | static char const* TheBase[] = {"", "", "-Roman"}; | |
49 | ||
50 | //! Convert font name used for rendering to some "good" font names | |
51 | //! that produce good vector text. | |
52 | static void getGL2PSFontName (const char* theSrcFont, | |
53 | char* thePsFont) | |
54 | { | |
55 | if (strstr (theSrcFont, "Symbol")) | |
56 | { | |
57 | sprintf (thePsFont, "%s", "Symbol"); | |
58 | return; | |
59 | } | |
60 | else if (strstr (theSrcFont, "ZapfDingbats")) | |
61 | { | |
62 | sprintf (thePsFont, "%s", "WingDings"); | |
63 | return; | |
64 | } | |
2166f0fa | 65 | |
a174a3c5 | 66 | int aFontId = 0; |
67 | bool isBold = false; | |
68 | bool isItalic = false; | |
69 | if (strstr (theSrcFont, "Courier")) | |
70 | { | |
71 | aFontId = 1; | |
72 | } | |
73 | else if (strstr (theSrcFont, "Times")) | |
74 | { | |
75 | aFontId = 2; | |
76 | } | |
2166f0fa | 77 | |
a174a3c5 | 78 | if (strstr (theSrcFont, "Bold")) |
79 | { | |
80 | isBold = true; | |
81 | } | |
82 | if (strstr (theSrcFont, "Italic") | |
83 | || strstr (theSrcFont, "Oblique")) | |
84 | { | |
85 | isItalic = true; | |
86 | } | |
2166f0fa | 87 | |
a174a3c5 | 88 | if (isBold) |
89 | { | |
a174a3c5 | 90 | if (isItalic) |
91 | { | |
8b224a09 | 92 | sprintf (thePsFont, "%s-Bold%s", TheFamily[aFontId], TheItalic[aFontId]); |
93 | } | |
94 | else | |
95 | { | |
96 | sprintf (thePsFont, "%s-Bold", TheFamily[aFontId]); | |
a174a3c5 | 97 | } |
98 | } | |
99 | else if (isItalic) | |
100 | { | |
101 | sprintf (thePsFont, "%s-%s", TheFamily[aFontId], TheItalic[aFontId]); | |
102 | } | |
103 | else | |
104 | { | |
105 | sprintf (thePsFont, "%s%s", TheFamily[aFontId], TheBase[aFontId]); | |
106 | } | |
107 | } | |
2166f0fa | 108 | |
a174a3c5 | 109 | static void exportText (const NCollection_String& theText, |
110 | const Standard_Boolean theIs2d, | |
111 | const OpenGl_AspectText& theAspect, | |
112 | const Standard_Integer theHeight) | |
113 | { | |
2166f0fa | 114 | |
a174a3c5 | 115 | char aPsFont[64]; |
116 | getGL2PSFontName (theAspect.FontName().ToCString(), aPsFont); | |
2166f0fa | 117 | |
ca3c13d1 | 118 | #if !defined(GL_ES_VERSION_2_0) |
a174a3c5 | 119 | if (theIs2d) |
120 | { | |
121 | glRasterPos2f (0.0f, 0.0f); | |
122 | } | |
123 | else | |
124 | { | |
125 | glRasterPos3f (0.0f, 0.0f, 0.0f); | |
126 | } | |
127 | ||
128 | GLubyte aZero = 0; | |
129 | glBitmap (1, 1, 0, 0, 0, 0, &aZero); | |
ca3c13d1 | 130 | #endif |
a174a3c5 | 131 | |
132 | // Standard GL2PS's alignment isn't used, because it doesn't work correctly | |
133 | // for all formats, therefore alignment is calculated manually relative | |
134 | // to the bottom-left corner, which corresponds to the GL2PS_TEXT_BL value | |
105aae76 | 135 | gl2psTextOpt (theText.ToCString(), aPsFont, (GLshort)theHeight, GL2PS_TEXT_BL, theAspect.Angle()); |
a174a3c5 | 136 | } |
137 | #endif | |
138 | ||
68858c7d | 139 | } // anonymous namespace |
a174a3c5 | 140 | |
141 | // ======================================================================= | |
142 | // function : OpenGl_Text | |
143 | // purpose : | |
144 | // ======================================================================= | |
145 | OpenGl_Text::OpenGl_Text() | |
146 | : myWinX (0.0f), | |
147 | myWinY (0.0f), | |
148 | myWinZ (0.0f), | |
149 | myScaleHeight (1.0f), | |
150 | myPoint (0.0f, 0.0f, 0.0f), | |
ce01ec26 | 151 | myIs2d (false), |
152 | myHasPlane (false) | |
a174a3c5 | 153 | { |
154 | myParams.Height = 10; | |
155 | myParams.HAlign = Graphic3d_HTA_LEFT; | |
156 | myParams.VAlign = Graphic3d_VTA_BOTTOM; | |
2166f0fa SK |
157 | } |
158 | ||
a174a3c5 | 159 | // ======================================================================= |
160 | // function : OpenGl_Text | |
161 | // purpose : | |
162 | // ======================================================================= | |
b64d84be | 163 | OpenGl_Text::OpenGl_Text (const Standard_Utf8Char* theText, |
164 | const OpenGl_Vec3& thePoint, | |
165 | const OpenGl_TextParam& theParams) | |
a174a3c5 | 166 | : myWinX (0.0f), |
167 | myWinY (0.0f), | |
168 | myWinZ (0.0f), | |
169 | myScaleHeight (1.0f), | |
170 | myExportHeight (1.0f), | |
171 | myParams (theParams), | |
b64d84be | 172 | myString (theText), |
a174a3c5 | 173 | myPoint (thePoint), |
ce01ec26 | 174 | myIs2d (false), |
175 | myHasPlane (false) | |
a174a3c5 | 176 | { |
177 | // | |
178 | } | |
2166f0fa | 179 | |
ce01ec26 | 180 | // ======================================================================= |
181 | // function : OpenGl_Text | |
182 | // purpose : | |
183 | // ======================================================================= | |
184 | OpenGl_Text::OpenGl_Text (const Standard_Utf8Char* theText, | |
185 | const gp_Ax2& theOrientation, | |
186 | const OpenGl_TextParam& theParams) | |
187 | : myWinX (0.0), | |
188 | myWinY (0.0), | |
189 | myWinZ (0.0), | |
190 | myScaleHeight (1.0), | |
191 | myExportHeight (1.0), | |
192 | myParams (theParams), | |
193 | myString (theText), | |
194 | myIs2d (false), | |
195 | myOrientation (theOrientation), | |
196 | myHasPlane (true) | |
197 | { | |
198 | const gp_Pnt& aPoint = theOrientation.Location(); | |
199 | myPoint = OpenGl_Vec3 (static_cast<Standard_ShortReal> (aPoint.X()), | |
200 | static_cast<Standard_ShortReal> (aPoint.Y()), | |
201 | static_cast<Standard_ShortReal> (aPoint.Z())); | |
202 | } | |
203 | ||
a174a3c5 | 204 | // ======================================================================= |
205 | // function : SetPosition | |
206 | // purpose : | |
207 | // ======================================================================= | |
208 | void OpenGl_Text::SetPosition (const OpenGl_Vec3& thePoint) | |
2166f0fa | 209 | { |
a174a3c5 | 210 | myPoint = thePoint; |
2166f0fa SK |
211 | } |
212 | ||
a174a3c5 | 213 | // ======================================================================= |
214 | // function : SetFontSize | |
215 | // purpose : | |
216 | // ======================================================================= | |
217 | void OpenGl_Text::SetFontSize (const Handle(OpenGl_Context)& theCtx, | |
218 | const Standard_Integer theFontSize) | |
219 | { | |
220 | if (myParams.Height != theFontSize) | |
221 | { | |
10b9c7df | 222 | Release (theCtx.operator->()); |
a174a3c5 | 223 | } |
224 | myParams.Height = theFontSize; | |
225 | } | |
226 | ||
227 | // ======================================================================= | |
228 | // function : Init | |
229 | // purpose : | |
230 | // ======================================================================= | |
231 | void OpenGl_Text::Init (const Handle(OpenGl_Context)& theCtx, | |
232 | const Standard_Utf8Char* theText, | |
233 | const OpenGl_Vec3& thePoint) | |
234 | { | |
10b9c7df | 235 | releaseVbos (theCtx.operator->()); |
a174a3c5 | 236 | myIs2d = false; |
237 | myPoint = thePoint; | |
238 | myString.FromUnicode (theText); | |
239 | } | |
240 | ||
241 | // ======================================================================= | |
242 | // function : Init | |
243 | // purpose : | |
244 | // ======================================================================= | |
245 | void OpenGl_Text::Init (const Handle(OpenGl_Context)& theCtx, | |
246 | const Standard_Utf8Char* theText, | |
247 | const OpenGl_Vec3& thePoint, | |
248 | const OpenGl_TextParam& theParams) | |
249 | { | |
250 | if (myParams.Height != theParams.Height) | |
251 | { | |
10b9c7df | 252 | Release (theCtx.operator->()); |
a174a3c5 | 253 | } |
254 | else | |
255 | { | |
10b9c7df | 256 | releaseVbos (theCtx.operator->()); |
a174a3c5 | 257 | } |
258 | myIs2d = false; | |
259 | myParams = theParams; | |
260 | myPoint = thePoint; | |
261 | myString.FromUnicode (theText); | |
262 | } | |
2166f0fa | 263 | |
a174a3c5 | 264 | // ======================================================================= |
265 | // function : Init | |
266 | // purpose : | |
267 | // ======================================================================= | |
268 | void OpenGl_Text::Init (const Handle(OpenGl_Context)& theCtx, | |
269 | const TCollection_ExtendedString& theText, | |
270 | const OpenGl_Vec2& thePoint, | |
271 | const OpenGl_TextParam& theParams) | |
2166f0fa | 272 | { |
a174a3c5 | 273 | if (myParams.Height != theParams.Height) |
274 | { | |
10b9c7df | 275 | Release (theCtx.operator->()); |
a174a3c5 | 276 | } |
277 | else | |
278 | { | |
10b9c7df | 279 | releaseVbos (theCtx.operator->()); |
a174a3c5 | 280 | } |
281 | myIs2d = true; | |
282 | myParams = theParams; | |
283 | myPoint.xy() = thePoint; | |
284 | myPoint.z() = 0.0f; | |
285 | myString.FromUnicode ((Standard_Utf16Char* )theText.ToExtString()); | |
286 | } | |
287 | ||
288 | // ======================================================================= | |
289 | // function : ~OpenGl_Text | |
290 | // purpose : | |
291 | // ======================================================================= | |
292 | OpenGl_Text::~OpenGl_Text() | |
293 | { | |
294 | // | |
295 | } | |
296 | ||
297 | // ======================================================================= | |
298 | // function : releaseVbos | |
299 | // purpose : | |
300 | // ======================================================================= | |
10b9c7df | 301 | void OpenGl_Text::releaseVbos (OpenGl_Context* theCtx) |
a174a3c5 | 302 | { |
303 | for (Standard_Integer anIter = 0; anIter < myVertsVbo.Length(); ++anIter) | |
304 | { | |
305 | Handle(OpenGl_VertexBuffer)& aVerts = myVertsVbo.ChangeValue (anIter); | |
306 | Handle(OpenGl_VertexBuffer)& aTCrds = myTCrdsVbo.ChangeValue (anIter); | |
307 | ||
10b9c7df | 308 | if (theCtx) |
a174a3c5 | 309 | { |
310 | theCtx->DelayedRelease (aVerts); | |
311 | theCtx->DelayedRelease (aTCrds); | |
312 | } | |
313 | aVerts.Nullify(); | |
314 | aTCrds.Nullify(); | |
315 | } | |
316 | myTextures.Clear(); | |
317 | myVertsVbo.Clear(); | |
318 | myTCrdsVbo.Clear(); | |
a174a3c5 | 319 | } |
320 | ||
321 | // ======================================================================= | |
322 | // function : Release | |
323 | // purpose : | |
324 | // ======================================================================= | |
10b9c7df | 325 | void OpenGl_Text::Release (OpenGl_Context* theCtx) |
a174a3c5 | 326 | { |
327 | releaseVbos (theCtx); | |
328 | if (!myFont.IsNull()) | |
329 | { | |
330 | Handle(OpenGl_Context) aCtx = theCtx; | |
331 | const TCollection_AsciiString aKey = myFont->ResourceKey(); | |
332 | myFont.Nullify(); | |
c04c30b3 | 333 | if (! aCtx.IsNull()) |
10b9c7df | 334 | aCtx->ReleaseResource (aKey, Standard_True); |
a174a3c5 | 335 | } |
336 | } | |
337 | ||
338 | // ======================================================================= | |
339 | // function : StringSize | |
340 | // purpose : | |
341 | // ======================================================================= | |
342 | void OpenGl_Text::StringSize (const Handle(OpenGl_Context)& theCtx, | |
343 | const NCollection_String& theText, | |
344 | const OpenGl_AspectText& theTextAspect, | |
345 | const OpenGl_TextParam& theParams, | |
4b1c8733 | 346 | const unsigned int theResolution, |
a174a3c5 | 347 | Standard_ShortReal& theWidth, |
348 | Standard_ShortReal& theAscent, | |
349 | Standard_ShortReal& theDescent) | |
350 | { | |
351 | theWidth = 0.0f; | |
352 | theAscent = 0.0f; | |
353 | theDescent = 0.0f; | |
4b1c8733 | 354 | const TCollection_AsciiString aFontKey = FontKey (theTextAspect, theParams.Height, theResolution); |
355 | Handle(OpenGl_Font) aFont = FindFont (theCtx, theTextAspect, theParams.Height, theResolution, aFontKey); | |
a174a3c5 | 356 | if (aFont.IsNull() || !aFont->IsValid()) |
357 | { | |
2166f0fa | 358 | return; |
a174a3c5 | 359 | } |
360 | ||
361 | theAscent = aFont->Ascender(); | |
362 | theDescent = aFont->Descender(); | |
363 | ||
364 | GLfloat aWidth = 0.0f; | |
365 | for (NCollection_Utf8Iter anIter = theText.Iterator(); *anIter != 0;) | |
366 | { | |
367 | const Standard_Utf32Char aCharThis = *anIter; | |
368 | const Standard_Utf32Char aCharNext = *++anIter; | |
369 | ||
370 | if (aCharThis == '\x0D' // CR (carriage return) | |
371 | || aCharThis == '\a' // BEL (alarm) | |
372 | || aCharThis == '\f' // FF (form feed) NP (new page) | |
373 | || aCharThis == '\b' // BS (backspace) | |
374 | || aCharThis == '\v') // VT (vertical tab) | |
375 | { | |
376 | continue; // skip unsupported carriage control codes | |
377 | } | |
378 | else if (aCharThis == '\x0A') // LF (line feed, new line) | |
379 | { | |
380 | theWidth = Max (theWidth, aWidth); | |
381 | aWidth = 0.0f; | |
382 | continue; | |
383 | } | |
384 | else if (aCharThis == ' ') | |
385 | { | |
d2eddacc | 386 | aWidth += aFont->FTFont()->AdvanceX (aCharThis, aCharNext); |
a174a3c5 | 387 | continue; |
388 | } | |
389 | else if (aCharThis == '\t') | |
390 | { | |
d2eddacc | 391 | aWidth += aFont->FTFont()->AdvanceX (' ', aCharNext) * 8.0f; |
a174a3c5 | 392 | continue; |
393 | } | |
394 | ||
d2eddacc | 395 | aWidth += aFont->FTFont()->AdvanceX (aCharThis, aCharNext); |
a174a3c5 | 396 | } |
397 | theWidth = Max (theWidth, aWidth); | |
398 | ||
399 | Handle(OpenGl_Context) aCtx = theCtx; | |
400 | aFont.Nullify(); | |
401 | aCtx->ReleaseResource (aFontKey, Standard_True); | |
402 | } | |
403 | ||
404 | // ======================================================================= | |
405 | // function : Render | |
406 | // purpose : | |
407 | // ======================================================================= | |
408 | void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const | |
409 | { | |
25ef750e | 410 | const OpenGl_AspectText* aTextAspect = theWorkspace->AspectText (Standard_True); |
411 | const Handle(OpenGl_Texture) aPrevTexture = theWorkspace->DisableTexture(); | |
412 | const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext(); | |
30f0ad28 | 413 | |
b990e557 | 414 | // Bind custom shader program or generate default version |
4e1523ef | 415 | if (aCtx->core20fwd != NULL) |
30f0ad28 | 416 | { |
b990e557 | 417 | aCtx->ShaderManager()->BindProgram ( |
418 | aTextAspect, aTextAspect->ShaderProgramRes (aCtx)); | |
30f0ad28 | 419 | } |
420 | ||
c357e426 | 421 | myOrientationMatrix = theWorkspace->View()->Camera()->OrientationMatrix(); |
ce01ec26 | 422 | myProjMatrix.Convert (aCtx->ProjectionState.Current()); |
423 | ||
a174a3c5 | 424 | // use highlight color or colors from aspect |
425 | if (theWorkspace->NamedStatus & OPENGL_NS_HIGHLIGHT) | |
426 | { | |
427 | render (theWorkspace->PrinterContext(), | |
30f0ad28 | 428 | aCtx, |
a174a3c5 | 429 | *aTextAspect, |
430 | *theWorkspace->HighlightColor, | |
4b1c8733 | 431 | *theWorkspace->HighlightColor, |
432 | theWorkspace->View()->RenderingParams().Resolution); | |
a174a3c5 | 433 | } |
434 | else | |
435 | { | |
436 | render (theWorkspace->PrinterContext(), | |
30f0ad28 | 437 | aCtx, |
a174a3c5 | 438 | *aTextAspect, |
439 | aTextAspect->Color(), | |
4b1c8733 | 440 | aTextAspect->SubtitleColor(), |
441 | theWorkspace->View()->RenderingParams().Resolution); | |
a174a3c5 | 442 | } |
2166f0fa | 443 | |
c6ad5e5f | 444 | aCtx->BindProgram (NULL); |
445 | ||
a174a3c5 | 446 | // restore aspects |
447 | if (!aPrevTexture.IsNull()) | |
448 | { | |
449 | theWorkspace->EnableTexture (aPrevTexture); | |
450 | } | |
b34efb62 | 451 | |
452 | // restore Z buffer settings | |
eae454e3 | 453 | if (theWorkspace->UseZBuffer()) |
b34efb62 | 454 | { |
455 | glEnable (GL_DEPTH_TEST); | |
456 | } | |
a174a3c5 | 457 | } |
2166f0fa | 458 | |
a174a3c5 | 459 | // ======================================================================= |
460 | // function : Render | |
461 | // purpose : | |
462 | // ======================================================================= | |
463 | void OpenGl_Text::Render (const Handle(OpenGl_PrinterContext)& thePrintCtx, | |
464 | const Handle(OpenGl_Context)& theCtx, | |
4b1c8733 | 465 | const OpenGl_AspectText& theTextAspect, |
466 | const unsigned int theResolution) const | |
a174a3c5 | 467 | { |
4b1c8733 | 468 | render (thePrintCtx, theCtx, theTextAspect, theTextAspect.Color(), theTextAspect.SubtitleColor(), theResolution); |
a174a3c5 | 469 | } |
2166f0fa | 470 | |
a174a3c5 | 471 | // ======================================================================= |
472 | // function : setupMatrix | |
473 | // purpose : | |
474 | // ======================================================================= | |
475 | void OpenGl_Text::setupMatrix (const Handle(OpenGl_PrinterContext)& thePrintCtx, | |
ca3c13d1 | 476 | const Handle(OpenGl_Context)& theCtx, |
a174a3c5 | 477 | const OpenGl_AspectText& theTextAspect, |
478 | const OpenGl_Vec3 theDVec) const | |
479 | { | |
c827ea3a | 480 | OpenGl_Mat4d aModViewMat; |
ce01ec26 | 481 | OpenGl_Mat4d aProjectMat; |
482 | ||
483 | if (myHasPlane) | |
484 | { | |
485 | aProjectMat = myProjMatrix * myOrientationMatrix; | |
486 | } | |
487 | else | |
488 | { | |
489 | aProjectMat = myProjMatrix; | |
490 | } | |
c827ea3a | 491 | |
a174a3c5 | 492 | if (myIs2d) |
bf75be98 | 493 | { |
825aa485 | 494 | Graphic3d_TransformUtils::Translate<GLdouble> (aModViewMat, myPoint.x() + theDVec.x(), myPoint.y() + theDVec.y(), 0.f); |
495 | Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, 1.f, -1.f, 1.f); | |
496 | Graphic3d_TransformUtils::Rotate<GLdouble> (aModViewMat, theTextAspect.Angle(), 0.f, 0.f, 1.f); | |
2166f0fa SK |
497 | } |
498 | else | |
499 | { | |
a174a3c5 | 500 | // align coordinates to the nearest integer |
501 | // to avoid extra interpolation issues | |
502 | GLdouble anObjX, anObjY, anObjZ; | |
825aa485 | 503 | Graphic3d_TransformUtils::UnProject<Standard_Real> (std::floor (myWinX + theDVec.x()), |
504 | std::floor (myWinY + theDVec.y()), | |
505 | myWinZ + theDVec.z(), | |
506 | OpenGl_Mat4d::Map (THE_IDENTITY_MATRIX), | |
ce01ec26 | 507 | OpenGl_Mat4d::Map (aProjectMat), |
825aa485 | 508 | myViewport, |
509 | anObjX, | |
510 | anObjY, | |
511 | anObjZ); | |
512 | ||
ce01ec26 | 513 | if (myHasPlane) |
514 | { | |
515 | const gp_Dir& aVectorDir = myOrientation.XDirection(); | |
516 | const gp_Dir& aVectorUp = myOrientation.Direction(); | |
517 | const gp_Dir& aVectorRight = myOrientation.YDirection(); | |
518 | ||
519 | aModViewMat.SetColumn (3, OpenGl_Vec3d (anObjX, anObjY, anObjZ)); | |
520 | aModViewMat.SetColumn (2, OpenGl_Vec3d (aVectorUp.X(), aVectorUp.Y(), aVectorUp.Z())); | |
521 | aModViewMat.SetColumn (1, OpenGl_Vec3d (aVectorRight.X(), aVectorRight.Y(), aVectorRight.Z())); | |
522 | aModViewMat.SetColumn (0, OpenGl_Vec3d (aVectorDir.X(), aVectorDir.Y(), aVectorDir.Z())); | |
523 | } | |
524 | else | |
525 | { | |
526 | Graphic3d_TransformUtils::Translate<GLdouble> (aModViewMat, anObjX, anObjY, anObjZ); | |
527 | Graphic3d_TransformUtils::Rotate<GLdouble> (aModViewMat, theTextAspect.Angle(), 0.0, 0.0, 1.0); | |
528 | } | |
825aa485 | 529 | |
a174a3c5 | 530 | if (!theTextAspect.IsZoomable()) |
531 | { | |
532 | #ifdef _WIN32 | |
533 | // if the context has assigned printer context, use it's parameters | |
534 | if (!thePrintCtx.IsNull()) | |
535 | { | |
536 | // get printing scaling in x and y dimensions | |
537 | GLfloat aTextScalex = 1.0f, aTextScaley = 1.0f; | |
538 | thePrintCtx->GetScale (aTextScalex, aTextScaley); | |
539 | ||
540 | // text should be scaled in all directions with same | |
541 | // factor to save its proportions, so use height (y) scaling | |
542 | // as it is better for keeping text/3d graphics proportions | |
825aa485 | 543 | Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, aTextScaley, aTextScaley, aTextScaley); |
a174a3c5 | 544 | } |
c85385c0 | 545 | #else |
546 | (void )thePrintCtx; | |
a174a3c5 | 547 | #endif |
825aa485 | 548 | Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, myScaleHeight, myScaleHeight, myScaleHeight); |
a174a3c5 | 549 | } |
550 | } | |
c827ea3a | 551 | |
552 | theCtx->WorldViewState.SetCurrent<Standard_Real> (aModViewMat); | |
553 | theCtx->ApplyWorldViewMatrix(); | |
b990e557 | 554 | |
ce01ec26 | 555 | if (!myIs2d) |
556 | { | |
557 | theCtx->ProjectionState.SetCurrent<Standard_Real> (aProjectMat); | |
558 | theCtx->ApplyProjectionMatrix(); | |
559 | } | |
560 | ||
b990e557 | 561 | if (!theCtx->ActiveProgram().IsNull()) |
562 | { | |
563 | // Upload updated state to shader program | |
564 | theCtx->ShaderManager()->PushState (theCtx->ActiveProgram()); | |
565 | } | |
a174a3c5 | 566 | } |
567 | ||
568 | // ======================================================================= | |
569 | // function : drawText | |
570 | // purpose : | |
571 | // ======================================================================= | |
35e08fe8 | 572 | |
573 | void OpenGl_Text::drawText (const Handle(OpenGl_PrinterContext)& , | |
a174a3c5 | 574 | const Handle(OpenGl_Context)& theCtx, |
35e08fe8 | 575 | #ifdef HAVE_GL2PS |
a174a3c5 | 576 | const OpenGl_AspectText& theTextAspect) const |
35e08fe8 | 577 | #else |
578 | const OpenGl_AspectText& ) const | |
579 | #endif | |
a174a3c5 | 580 | { |
581 | #ifdef HAVE_GL2PS | |
582 | if (theCtx->IsFeedback()) | |
583 | { | |
584 | // position of the text and alignment is calculated by transformation matrix | |
585 | exportText (myString, myIs2d, theTextAspect, (Standard_Integer )myExportHeight); | |
586 | return; | |
2166f0fa | 587 | } |
a174a3c5 | 588 | #endif |
2166f0fa | 589 | |
7d3e64ef | 590 | if (myVertsVbo.Length() != myTextures.Length() |
591 | || myTextures.IsEmpty()) | |
2166f0fa | 592 | { |
7d3e64ef | 593 | return; |
2166f0fa | 594 | } |
7d3e64ef | 595 | |
596 | for (Standard_Integer anIter = 0; anIter < myTextures.Length(); ++anIter) | |
a174a3c5 | 597 | { |
7d3e64ef | 598 | const GLuint aTexId = myTextures.Value (anIter); |
599 | glBindTexture (GL_TEXTURE_2D, aTexId); | |
a174a3c5 | 600 | |
7d3e64ef | 601 | const Handle(OpenGl_VertexBuffer)& aVerts = myVertsVbo.Value (anIter); |
602 | const Handle(OpenGl_VertexBuffer)& aTCrds = myTCrdsVbo.Value (anIter); | |
603 | aVerts->BindAttribute (theCtx, Graphic3d_TOA_POS); | |
604 | aTCrds->BindAttribute (theCtx, Graphic3d_TOA_UV); | |
2166f0fa | 605 | |
7d3e64ef | 606 | glDrawArrays (GL_TRIANGLES, 0, GLsizei(aVerts->GetElemsNb())); |
2166f0fa | 607 | |
b990e557 | 608 | aTCrds->UnbindAttribute (theCtx, Graphic3d_TOA_UV); |
7d3e64ef | 609 | aVerts->UnbindAttribute (theCtx, Graphic3d_TOA_POS); |
a174a3c5 | 610 | } |
7d3e64ef | 611 | glBindTexture (GL_TEXTURE_2D, 0); |
a174a3c5 | 612 | } |
2166f0fa | 613 | |
a174a3c5 | 614 | // ======================================================================= |
615 | // function : FontKey | |
616 | // purpose : | |
617 | // ======================================================================= | |
618 | TCollection_AsciiString OpenGl_Text::FontKey (const OpenGl_AspectText& theAspect, | |
4b1c8733 | 619 | const Standard_Integer theHeight, |
620 | const unsigned int theResolution) | |
a174a3c5 | 621 | { |
622 | const Font_FontAspect anAspect = (theAspect.FontAspect() != Font_FA_Undefined) ? theAspect.FontAspect() : Font_FA_Regular; | |
623 | return theAspect.FontName() | |
624 | + TCollection_AsciiString(":") + Standard_Integer(anAspect) | |
4b1c8733 | 625 | + TCollection_AsciiString(":") + Standard_Integer(theResolution) |
a174a3c5 | 626 | + TCollection_AsciiString(":") + theHeight; |
627 | } | |
628 | ||
629 | // ======================================================================= | |
630 | // function : FindFont | |
631 | // purpose : | |
632 | // ======================================================================= | |
633 | Handle(OpenGl_Font) OpenGl_Text::FindFont (const Handle(OpenGl_Context)& theCtx, | |
634 | const OpenGl_AspectText& theAspect, | |
635 | const Standard_Integer theHeight, | |
4b1c8733 | 636 | const unsigned int theResolution, |
a174a3c5 | 637 | const TCollection_AsciiString theKey) |
638 | { | |
639 | Handle(OpenGl_Font) aFont; | |
640 | if (theHeight < 2) | |
2166f0fa | 641 | { |
a174a3c5 | 642 | return aFont; // invalid parameters |
643 | } | |
2166f0fa | 644 | |
a174a3c5 | 645 | if (!theCtx->GetResource (theKey, aFont)) |
646 | { | |
647 | Handle(Font_FontMgr) aFontMgr = Font_FontMgr::GetInstance(); | |
648 | const Handle(TCollection_HAsciiString) aFontName = new TCollection_HAsciiString (theAspect.FontName()); | |
649 | const Font_FontAspect anAspect = (theAspect.FontAspect() != Font_FA_Undefined) ? theAspect.FontAspect() : Font_FA_Regular; | |
650 | Handle(Font_SystemFont) aRequestedFont = aFontMgr->FindFont (aFontName, anAspect, theHeight); | |
65360da3 | 651 | Handle(Font_FTFont) aFontFt; |
652 | if (!aRequestedFont.IsNull()) | |
2166f0fa | 653 | { |
65360da3 | 654 | aFontFt = new Font_FTFont (NULL); |
317d68c9 | 655 | |
4b1c8733 | 656 | if (aFontFt->Init (aRequestedFont->FontPath()->ToCString(), theHeight, theResolution)) |
65360da3 | 657 | { |
658 | aFont = new OpenGl_Font (aFontFt, theKey); | |
659 | if (!aFont->Init (theCtx)) | |
660 | { | |
661 | TCollection_ExtendedString aMsg; | |
662 | aMsg += "Font '"; | |
663 | aMsg += theAspect.FontName(); | |
664 | aMsg += "' - initialization of GL resources has failed!"; | |
3b523c4c | 665 | theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, aMsg); |
65360da3 | 666 | aFontFt.Nullify(); |
c6ad5e5f | 667 | aFont->Release (theCtx.operator->()); |
65360da3 | 668 | aFont = new OpenGl_Font (aFontFt, theKey); |
669 | } | |
670 | } | |
671 | else | |
672 | { | |
673 | TCollection_ExtendedString aMsg; | |
674 | aMsg += "Font '"; | |
675 | aMsg += theAspect.FontName(); | |
676 | aMsg += "' is broken or has incompatible format! File path: "; | |
677 | aMsg += aRequestedFont->FontPath()->ToCString(); | |
3b523c4c | 678 | theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, aMsg); |
65360da3 | 679 | aFontFt.Nullify(); |
680 | aFont = new OpenGl_Font (aFontFt, theKey); | |
681 | } | |
a174a3c5 | 682 | } |
65360da3 | 683 | else |
a174a3c5 | 684 | { |
65360da3 | 685 | TCollection_ExtendedString aMsg; |
686 | aMsg += "Font '"; | |
687 | aMsg += theAspect.FontName(); | |
688 | aMsg += "' is not found in the system!"; | |
3b523c4c | 689 | theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, aMsg); |
65360da3 | 690 | aFont = new OpenGl_Font (aFontFt, theKey); |
a174a3c5 | 691 | } |
a174a3c5 | 692 | |
b34efb62 | 693 | theCtx->ShareResource (theKey, aFont); |
a174a3c5 | 694 | } |
695 | return aFont; | |
696 | } | |
697 | ||
698 | // ======================================================================= | |
699 | // function : render | |
700 | // purpose : | |
701 | // ======================================================================= | |
702 | void OpenGl_Text::render (const Handle(OpenGl_PrinterContext)& thePrintCtx, | |
703 | const Handle(OpenGl_Context)& theCtx, | |
704 | const OpenGl_AspectText& theTextAspect, | |
705 | const TEL_COLOUR& theColorText, | |
4b1c8733 | 706 | const TEL_COLOUR& theColorSubs, |
707 | const unsigned int theResolution) const | |
a174a3c5 | 708 | { |
709 | if (myString.IsEmpty()) | |
710 | { | |
711 | return; | |
712 | } | |
713 | ||
4b1c8733 | 714 | // Note that using difference resolution in different Views in same Viewer |
715 | // will lead to performance regression (for example, text will be recreated every time). | |
716 | const TCollection_AsciiString aFontKey = FontKey (theTextAspect, myParams.Height, theResolution); | |
a174a3c5 | 717 | if (!myFont.IsNull() |
718 | && !myFont->ResourceKey().IsEqual (aFontKey)) | |
719 | { | |
720 | // font changed | |
10b9c7df | 721 | const_cast<OpenGl_Text* > (this)->Release (theCtx.operator->()); |
a174a3c5 | 722 | } |
723 | ||
724 | if (myFont.IsNull()) | |
725 | { | |
4b1c8733 | 726 | myFont = FindFont (theCtx, theTextAspect, myParams.Height, theResolution, aFontKey); |
65360da3 | 727 | } |
728 | if (!myFont->WasInitialized()) | |
729 | { | |
730 | return; | |
a174a3c5 | 731 | } |
732 | ||
733 | if (myTextures.IsEmpty()) | |
734 | { | |
317d68c9 | 735 | Font_TextFormatter aFormatter; |
a174a3c5 | 736 | aFormatter.SetupAlignment (myParams.HAlign, myParams.VAlign); |
737 | aFormatter.Reset(); | |
317d68c9 | 738 | |
d2eddacc | 739 | aFormatter.Append (myString, *myFont->FTFont().operator->()); |
a174a3c5 | 740 | aFormatter.Format(); |
741 | ||
317d68c9 | 742 | OpenGl_TextBuilder aBuilder; |
743 | aBuilder.Perform (aFormatter, | |
744 | theCtx, | |
745 | *myFont.operator->(), | |
746 | myTextures, | |
747 | myVertsVbo, | |
748 | myTCrdsVbo); | |
749 | ||
a174a3c5 | 750 | aFormatter.BndBox (myBndBox); |
751 | } | |
752 | ||
753 | if (myTextures.IsEmpty()) | |
754 | { | |
755 | return; | |
756 | } | |
757 | ||
758 | myExportHeight = 1.0f; | |
759 | myScaleHeight = 1.0f; | |
760 | ||
c827ea3a | 761 | theCtx->WorldViewState.Push(); |
762 | ||
c827ea3a | 763 | myModelMatrix.Convert (theCtx->WorldViewState.Current() * theCtx->ModelWorldState.Current()); |
764 | ||
a174a3c5 | 765 | if (!myIs2d) |
766 | { | |
a174a3c5 | 767 | glGetIntegerv (GL_VIEWPORT, myViewport); |
c827ea3a | 768 | |
825aa485 | 769 | Graphic3d_TransformUtils::Project<Standard_Real> (myPoint.x(), |
770 | myPoint.y(), | |
771 | myPoint.z(), | |
772 | myModelMatrix, | |
773 | myProjMatrix, | |
774 | myViewport, | |
775 | myWinX, | |
776 | myWinY, | |
777 | myWinZ); | |
a174a3c5 | 778 | |
779 | // compute scale factor for constant text height | |
780 | GLdouble x1, y1, z1; | |
825aa485 | 781 | Graphic3d_TransformUtils::UnProject<Standard_Real> (myWinX, |
782 | myWinY, | |
783 | myWinZ, | |
784 | OpenGl_Mat4d::Map (THE_IDENTITY_MATRIX), | |
785 | myProjMatrix, | |
786 | myViewport, | |
787 | x1, | |
788 | y1, | |
789 | z1); | |
a174a3c5 | 790 | |
791 | GLdouble x2, y2, z2; | |
792 | const GLdouble h = (GLdouble )myFont->FTFont()->PointSize(); | |
825aa485 | 793 | Graphic3d_TransformUtils::UnProject<Standard_Real> (myWinX, |
794 | myWinY + h, | |
795 | myWinZ, | |
796 | OpenGl_Mat4d::Map (THE_IDENTITY_MATRIX), | |
797 | myProjMatrix, | |
798 | myViewport, | |
799 | x2, | |
800 | y2, | |
801 | z2); | |
a174a3c5 | 802 | |
803 | myScaleHeight = (y2 - y1) / h; | |
804 | if (theTextAspect.IsZoomable()) | |
805 | { | |
806 | myExportHeight = (float )h; | |
807 | } | |
808 | } | |
809 | myExportHeight = (float )myFont->FTFont()->PointSize() / myExportHeight; | |
810 | ||
b990e557 | 811 | #if !defined(GL_ES_VERSION_2_0) |
65360da3 | 812 | if (theCtx->core11 != NULL) |
813 | { | |
814 | glDisable (GL_LIGHTING); | |
815 | } | |
816 | #endif | |
a174a3c5 | 817 | |
818 | // setup depth test | |
eae454e3 | 819 | if (myIs2d |
820 | || theTextAspect.StyleType() == Aspect_TOST_ANNOTATION) | |
a174a3c5 | 821 | { |
822 | glDisable (GL_DEPTH_TEST); | |
823 | } | |
824 | ||
65360da3 | 825 | if (theCtx->core15fwd != NULL) |
a174a3c5 | 826 | { |
65360da3 | 827 | theCtx->core15fwd->glActiveTexture (GL_TEXTURE0); |
a174a3c5 | 828 | } |
65360da3 | 829 | #if !defined(GL_ES_VERSION_2_0) |
a174a3c5 | 830 | // activate texture unit |
65360da3 | 831 | GLint aTexEnvParam = GL_REPLACE; |
832 | if (theCtx->core11 != NULL) | |
a174a3c5 | 833 | { |
c6ad5e5f | 834 | // setup alpha test |
835 | glAlphaFunc (GL_GEQUAL, 0.285f); | |
836 | glEnable (GL_ALPHA_TEST); | |
837 | ||
65360da3 | 838 | glDisable (GL_TEXTURE_1D); |
839 | glEnable (GL_TEXTURE_2D); | |
840 | glGetTexEnviv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &aTexEnvParam); | |
841 | if (aTexEnvParam != GL_REPLACE) | |
842 | { | |
843 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
844 | } | |
a174a3c5 | 845 | } |
65360da3 | 846 | #endif |
847 | ||
848 | // setup blending | |
849 | glEnable (GL_BLEND); | |
850 | glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | |
a174a3c5 | 851 | |
852 | // extra drawings | |
853 | switch (theTextAspect.DisplayType()) | |
854 | { | |
2166f0fa | 855 | case Aspect_TODT_BLEND: |
a174a3c5 | 856 | { |
65360da3 | 857 | #if !defined(GL_ES_VERSION_2_0) |
a174a3c5 | 858 | glEnable (GL_COLOR_LOGIC_OP); |
859 | glLogicOp (GL_XOR); | |
65360da3 | 860 | #endif |
2166f0fa | 861 | break; |
a174a3c5 | 862 | } |
2166f0fa SK |
863 | case Aspect_TODT_SUBTITLE: |
864 | { | |
65360da3 | 865 | #if !defined(GL_ES_VERSION_2_0) |
866 | if (theCtx->core11 != NULL) | |
867 | { | |
868 | theCtx->core11->glColor3fv (theColorSubs.rgb); | |
869 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (0.0f, 0.0f, 0.00001f)); | |
870 | ||
871 | glBindTexture (GL_TEXTURE_2D, 0); | |
872 | glBegin (GL_QUADS); | |
873 | glVertex2f (myBndBox.Left, myBndBox.Top); | |
874 | glVertex2f (myBndBox.Right, myBndBox.Top); | |
875 | glVertex2f (myBndBox.Right, myBndBox.Bottom); | |
876 | glVertex2f (myBndBox.Left, myBndBox.Bottom); | |
877 | glEnd(); | |
878 | } | |
879 | #endif | |
2166f0fa SK |
880 | break; |
881 | } | |
2166f0fa | 882 | case Aspect_TODT_DEKALE: |
a174a3c5 | 883 | { |
b990e557 | 884 | theCtx->SetColor4fv (*(const OpenGl_Vec4* )theColorSubs.rgb); |
a174a3c5 | 885 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, +1.0f, 0.00001f)); |
886 | drawText (thePrintCtx, theCtx, theTextAspect); | |
887 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (-1.0f, -1.0f, 0.00001f)); | |
888 | drawText (thePrintCtx, theCtx, theTextAspect); | |
889 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (-1.0f, +1.0f, 0.00001f)); | |
890 | drawText (thePrintCtx, theCtx, theTextAspect); | |
891 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, -1.0f, 0.00001f)); | |
892 | drawText (thePrintCtx, theCtx, theTextAspect); | |
893 | break; | |
894 | } | |
a6eb515f | 895 | case Aspect_TODT_DIMENSION: |
a174a3c5 | 896 | case Aspect_TODT_NORMAL: |
897 | { | |
2166f0fa SK |
898 | break; |
899 | } | |
900 | } | |
901 | ||
a174a3c5 | 902 | // main draw call |
b990e557 | 903 | theCtx->SetColor4fv (*(const OpenGl_Vec4* )theColorText.rgb); |
a174a3c5 | 904 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (0.0f, 0.0f, 0.0f)); |
905 | drawText (thePrintCtx, theCtx, theTextAspect); | |
2166f0fa | 906 | |
ce01ec26 | 907 | if (!myIs2d) |
908 | { | |
909 | theCtx->ProjectionState.SetCurrent<Standard_Real> (myProjMatrix); | |
910 | theCtx->ApplyProjectionMatrix(); | |
911 | } | |
912 | ||
65360da3 | 913 | #if !defined(GL_ES_VERSION_2_0) |
914 | if (theCtx->core11 != NULL) | |
915 | { | |
916 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, aTexEnvParam); | |
917 | } | |
918 | #endif | |
543f0db0 | 919 | |
920 | if (theTextAspect.DisplayType() == Aspect_TODT_DIMENSION) | |
921 | { | |
922 | setupMatrix (thePrintCtx, theCtx, theTextAspect, OpenGl_Vec3 (0.0f, 0.0f, 0.00001f)); | |
923 | ||
924 | glDisable (GL_BLEND); | |
543f0db0 | 925 | if (!myIs2d) |
926 | { | |
927 | glDisable (GL_DEPTH_TEST); | |
928 | } | |
65360da3 | 929 | #if !defined(GL_ES_VERSION_2_0) |
930 | if (theCtx->core11 != NULL) | |
931 | { | |
932 | glDisable (GL_TEXTURE_2D); | |
933 | glDisable (GL_ALPHA_TEST); | |
934 | } | |
935 | #endif | |
543f0db0 | 936 | glColorMask (GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); |
937 | ||
938 | glClear (GL_STENCIL_BUFFER_BIT); | |
939 | glEnable (GL_STENCIL_TEST); | |
940 | glStencilFunc (GL_ALWAYS, 1, 0xFF); | |
941 | glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE); | |
942 | ||
65360da3 | 943 | #if !defined(GL_ES_VERSION_2_0) |
944 | if (theCtx->core11 != NULL) | |
945 | { | |
946 | glBegin (GL_QUADS); | |
947 | glVertex2f (myBndBox.Left, myBndBox.Top); | |
948 | glVertex2f (myBndBox.Right, myBndBox.Top); | |
949 | glVertex2f (myBndBox.Right, myBndBox.Bottom); | |
950 | glVertex2f (myBndBox.Left, myBndBox.Bottom); | |
951 | glEnd(); | |
952 | } | |
953 | #endif | |
543f0db0 | 954 | |
955 | glStencilFunc (GL_ALWAYS, 0, 0xFF); | |
543f0db0 | 956 | |
957 | glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | |
958 | } | |
959 | ||
b34efb62 | 960 | // reset OpenGL state |
961 | glDisable (GL_BLEND); | |
b34efb62 | 962 | glDisable (GL_STENCIL_TEST); |
65360da3 | 963 | #if !defined(GL_ES_VERSION_2_0) |
c6ad5e5f | 964 | if (theCtx->core11 != NULL) |
965 | { | |
966 | glDisable (GL_ALPHA_TEST); | |
967 | } | |
b34efb62 | 968 | glDisable (GL_COLOR_LOGIC_OP); |
65360da3 | 969 | #endif |
c827ea3a | 970 | |
971 | // model view matrix was modified | |
972 | theCtx->WorldViewState.Pop(); | |
973 | theCtx->ApplyModelViewMatrix(); | |
5e27df78 | 974 | } |