NCBI C++ Toolkit Cross Reference

  C++/include/gui/opengl/glrender.hpp


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
#ifndef GUI_OPENGL___GL_RENDER_MANAGER__HPP #define GUI_OPENGL___GL_RENDER_MANAGER__HPP /* $Id: glrender.hpp 35534 2016-05-18 14:56:27Z falkrb $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * Authors: Bob Falk * * File Description: * */ #include <gui/opengl.h> #include <gui/gui.hpp> #include <gui/opengl/globject.hpp> #include <gui/opengl/glmodel2d.hpp> #include <gui/opengl/glvbonode.hpp> #include <gui/opengl/glstate.hpp> #include <gui/opengl/gltexturefont.hpp> #include <gui/opengl/glbitmapfont.hpp> #include <gui/opengl/gltypes.hpp> #include <gui/utils/rgba_color.hpp> #include <gui/utils/matrix4.hpp> #include <gui/utils/vect2.hpp> #include <gui/utils/vect3.hpp> #include <gui/utils/vect4.hpp> /** @addtogroup GUI_OPENGL * * @{ */ BEGIN_NCBI_SCOPE ////////////////////////////////////////////////////////////////////////////// /// CGlRender /// /// Purpose: /// /// The purpose of CGlRender and related classes (CGlRenderNode, CGlVboNode, /// CGlVboGeom, CGlState etc) is to provide a flexible rendering /// interface supporting both PDF output and different versions of OpenGL: /// 1. Support standard OpenGL rendering with minimal changes to existing code /// 2. Support rendering to PDF files without adding PDF-specific code /// 3. Run on platforms that only support OpenGL 1.1 /// 4. Run on OpenGL platforms which may not backward compatible to OpenGL 1.1 /// (e.g. OpenGL ES or OpenGL 3.2+) without changing user code (work would /// be needed though to add a new target to the API) /// /// Usage: /// CGlRender mimics to the extent possible the OpenGL 1.1 API. /// Functions are provided for both state-setting, e.g. LineWidth(float) /// and rendering e.g. Begin(), Vertex3f(), End(). Not every /// OpenGl function is supported, particularly those which are /// infrequently used or have alternatives. For example, the short and /// integer versions of the glVertex*() commands, e.g. glVertex2i(int x, int y) /// and glVertex2s(short x, short y), are not supported since you can use /// the floating point or double versions instead. /// /// There is always a current singleton instance of CGlRender available /// for rendering. The singleton, which may be an instance of CGlRenderPdf /// or the current OpenGL version, is managed by CGlResMgr, which is itself /// a singleton. The current instance can always be accessed by the function: /// /// CGlRender& GetGl(); // declared in this file, CGlRender.hpp /// /// To make it easy to convert code and to make code that looks like /// OpenGL 1.1, we usually use it in this manner: /// /// CGlRender& gl = GetGl(); /// /// gl.Enable(GL_BLEND); /// gl.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /// /// gl.Begin(GL_TRIANGLES); /// gl.Color3f(1.0f, 0.0f, 0.0f); /// gl.Vertex3f(1.0f, 1.0f, 0.0f); /// … /// gl.End(); /// /// Since all standard OpenGL functions have the name format gl[A-Z]*, e.g. /// glVertex3f(), all member functions of CGlRender that implement these have /// the same name minus the “gl”. This way, to convert to CGlRender, /// get the current CGlRender object with GetGl(), and then add a “.” after /// “gl” in all the OpenGL calls in the function. /// /// Unlike OpenGL, the CGlRender interface also supports text output, using /// the CGlTextureFont class. If you want to support PDF output, you should /// use this interface rather than using CGlTextureFont directly. The format /// for writing text has a begin/end style similar to OpenGL: /// /// gl.BeginText(&m_Font, m_TextColor); /// gl.WriteText(x1, y1, “I’m Text!”, rotate_degrees); /// gl.EndText(); /// /// When possible, it’s more efficient to put multiple WriteText() commands /// between BeginText() and EndText() since it reduces state-setting. /// /// The final important point in using the API is setup – if you are rendering /// to PDF you have to set a CGlRenderPdf object as the current rendering /// singleton, and if rendering to OpenGL a CGlRender11/20/Debug object /// has to be current. Making sure the OpenGL CGlRender object is current /// can be done like this: /// /// CRef<CGlRender> mgr = CGlResMgr::Instance().GetRenderer(CGlResMgr::Instance().GetApiLevel()); /// if (mgr.IsNull()) { /// LOG_POST(Error << "CGlRender object not available."); /// return; /// } /// CGlResMgr::Instance().SetCurrentRenderer(mgr); /// /// For PDF rendering, no additional work needs to be done after setting a /// CGlRenderPdf object as the current rendering singleton. There are /// however a few PDF only rendering states defined in IGlState (and /// inherited by CGlRender). These will not affect OpenGL output, /// but can make PDFs look nicer, e.g. rounding corners where edges join. /// And there are significant OpenGL features not supported by PDF, /// including texture mapping and any 3D operations that require a depth /// buffer. /// /// Design: /// /// IGlState /// ^ ^ /// | |__________ /// | | /// | CGlState----(blend mode, current color, polygon mode etc. etc) /// | /// | /// CGlRender -------m_RenderNode (CGlRenderNode does rendering, may be more than 1) /// ^ ^ ^ ^ -------m_State (CGlState used by render nodes - IGlState calls forwarded here) /// | | | | /// | | | |__________ /// | | | | /// | | | CGlRenderPdf (uses CPdf to write buffers to pdf file) /// | | |_____________ /// | | | /// | | CGlRenderDebug (uses only OpenGL 1.1 immediate mode for debugging) /// | |_______________ /// | | /// | CGlRender11 (uses OpenGL 1.1 with vertex arrays) /// | /// CGlRender20 (OpenGL with vertex buffers) /// /// Known Issues: /// /// The CGlRender objects, like the CFtglFontManager manager, retain memory in /// buffers (or textures) owned by OpenGL. Because these are singletons, /// they will hang around until the program ends. So if at any point during /// the program you destroy the OpenGL context, you should also call the Clear() /// function on these objects to prevent them from hanging on to stale OpenGL /// memory. /// /// The other thing to watch out for with the new library is the glPushAttrib() /// and glPopAttrib() may no longer work in a consistent manner. Because /// state is saved in the m_State object, options may be reset after glPopAttrib(). /// The best approach for using this library is to remove calls to glPushAttrib /// and glPopAttrib. These functions are in any case deprecated in newer versions /// of OpenGL (and they are not replaced with anything similar). /// class NCBI_GUIOPENGL_EXPORT CGlRender : public IGlState, public CGlObject { public: CGlRender(); virtual ~CGlRender() {} /// Clear/delete any graphics/OpenGL memory. Call this if you delete /// the current OpenGL context virtual void Clear(); virtual void Render(CGlPane& pane, CGlModel2D* model) {} /// Overridden in subclasses to return the supported rendering target virtual ERenderTarget GetApi() { return eApiUndefined; } /// Start rendering. "mode" may be one of: /// GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_FAN, /// GL_TRIANGLE_STRIP or GL_QUADS. 'state' replaces current state object virtual void Begin(GLenum mode, const CGlState& state); /// Start rendering - use state in existing 'state' object. virtual void Begin(GLenum mode); /// Finish rendering (create buffer and send to renderer) virtual void End(); /// For shaders. Only works with OpenGL 2.0+ virtual void UseProgram(GLuint program) {} /// @name Polygon rendering interface /// @{ /// Explicit support not currently available for: /// GLbyte, GlShort and GLint calls, e.g. glVertex2i(int x, int y); /// Vertices with homgeneous coords, e.g. /// glVertex4f(float x, float y, float z, float w); /// 3&4-dimensional texture coords, e.g. glTexCoord4f /// Generic attributes and mulitple texture coords per vertex /// Vertices virtual void Vertex2f(GLfloat x, GLfloat y); virtual void Vertex2fv(const GLfloat* v); virtual void Vertex3f(GLfloat x, GLfloat y, GLfloat z); virtual void Vertex3fv(const GLfloat* v); virtual void Vertex2d(GLdouble x, GLdouble y); virtual void Vertex2dv(const GLdouble* v); virtual void Vertex3d(GLdouble x, GLdouble y, GLdouble z); virtual void Vertex3dv(const GLdouble* v); /// Rect() functions also do Begin() and End() (as in OpenGL) virtual void Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); virtual void Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); virtual void RectC(const TVPRect& rc); virtual void RectC(const TModelRect& rc); /// Colors (also defined in IGlState since they can be set either before /// or inside of Begin()/End(). Other state must be set before. virtual void Color3f(GLfloat r, GLfloat g, GLfloat b); virtual void Color3fv(const GLfloat* v); virtual void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); virtual void Color4fv(const GLfloat* v); virtual void Color3d(GLdouble r, GLdouble g, GLdouble b); virtual void Color3dv(const GLdouble* v); virtual void Color4d(GLdouble r, GLdouble g, GLdouble b, GLdouble a); virtual void Color4dv(const GLdouble* v); virtual void ColorC(const CRgbaColor& color); /// Texture coords virtual void TexCoord2f(GLfloat s, GLfloat t); virtual void TexCoord2fv(const GLfloat* v); virtual void TexCoord2d(GLdouble s, GLdouble t); virtual void TexCoord2dv(const GLdouble* v); /// Normals virtual void Normal3f(GLfloat x, GLfloat y, GLfloat z); virtual void Normal3fv(const GLfloat* v); virtual void Normal3d(GLdouble x, GLdouble y, GLdouble z); virtual void Normal3dv(const GLdouble* v); /// @} /// @name Text interface /// @{ /// Text is drawn is pixel coordinates. Its position is /// transformed by the current ModelView matrix. The color and alpha for /// text are set in BeginText() and can be changed with SetTextColor(). /// Other OpenGL state should not affect text (since BeginText sets /// appropriate state) /// Set OpenGL state needed for writing text (call before DrawText) virtual void BeginText(const CGlTextureFont* font, const CRgbaColor& color); /// Same as above, but get color from m_RenderNode.m_State virtual void BeginText(const CGlTextureFont* font); /// Pops matrices and attributes after writing text virtual void EndText(); /// Update text color and alpha void SetTextColor(const CRgbaColor& color) { m_TextColor = color; } CRgbaColor GetTextColor() const { return m_TextColor; } /// Write text at specified model coords virtual void WriteText(TModelUnit x, TModelUnit y, const char* text, TModelUnit rotate_degrees = 0.0); /// Write text at specified model coords inside box defined by /// (x,y,width,height) with specified alignment, truncation and rotation virtual void WriteText(TModelUnit x, TModelUnit y, TModelUnit width, TModelUnit height, const char* text, CGlTextureFont::TAlign align = CGlTextureFont::eAlign_Center, CGlTextureFont::ETruncate trunc = CGlTextureFont::eTruncate_Ellipsis, TModelUnit rotate_degrees = 0.0f); /// Calls the standard font metric functions except for pdf in which case /// it first replaces any bitmap fonts with texture fnots virtual TModelUnit GetMetric(const CGlTextureFont* font, IGlFont::EMetric metric, const char* text = NULL, int len = -1) const; virtual TModelUnit TextWidth(const CGlTextureFont* font, const char* text) const; virtual TModelUnit TextHeight(const CGlTextureFont* font) const; virtual TModelUnit GetFontDescender(const CGlTextureFont* font) const; virtual TModelUnit GetAdvance(const CGlTextureFont* font, char c) const; virtual TModelUnit GetMaxWidth(const CGlTextureFont* font, int max_num) const; /// @} /// @name Viewports, matrices and transformations /// @{ virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height); virtual void GetViewport(GLint *params); virtual void MatrixMode(GLenum mode); virtual void PushMatrix(); virtual void PopMatrix(); virtual void LoadIdentity(); virtual void LoadMatrixf(const GLfloat *m); virtual void LoadMatrixd(const GLdouble* m); virtual void MultMatrixf(const GLfloat* m); virtual void MultMatrixd(const GLdouble* m); virtual void Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); virtual void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); virtual void Scaled(GLdouble x, GLdouble y, GLdouble z); virtual void Scalef(GLfloat x, GLfloat y, GLfloat z); virtual void Translated(GLdouble x, GLdouble y, GLdouble z); virtual void Translatef(GLfloat x, GLfloat y, GLfloat z); virtual void Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal); virtual void Perspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); /// @} /// @name IGlState interface implementation /// @{ /// /// These commands just forward their parameters to the render managers /// CGlState object m_State. State can also be updated (replaced) via /// Begin(GLenum mode, const CGlState& state); /// virtual void PushAttrib(GLbitfield mask); virtual void PopAttrib(); virtual void Enable(GLenum glstate); virtual void Disable(GLenum glstate); virtual void SetTexture(CGlTexture* tex); virtual void SetShader(CRef<CGlShader> shader); virtual void LineWidth(GLfloat w); virtual void PointSize(GLfloat s); virtual void ShadeModel(GLenum mode); virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height); /// Color{3,4}{f,d}{v} commands are defined above.... virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); virtual void PolygonMode(GLenum face, GLenum mode); virtual void LineStipple(GLint factor, GLushort pattern); virtual void PolygonStipple(GLubyte* mask); virtual void BlendFunc(GLenum sfactor, GLenum dfactor); virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); virtual void BlendColor(const CRgbaColor& c); virtual void ScaleInvarient(bool b, CVect2<TModelUnit> scale = CVect2<TModelUnit>(TModelUnit(1), TModelUnit(1))); virtual void ScaleFactor(const CVect2<TModelUnit>& scale); virtual void LineJoinStyle(ELineJoinStyle s); virtual void LineCapStyle(ELineCapStyle c); virtual void PdfShadeStyle(EPdfShadeStyle s); /// @} /// Allow caller to access state directly CRef<CGlState> GetState() { return m_State; } protected: void x_SyncAttribs(vector<CRgbaColor>& colors); void x_SyncAttribs(vector<CVect3<float> >& vecs); void x_SyncAttribs(vector<CVect2<float> >& vecs); // Render m_RenderNode using appropriate functionality virtual void x_RenderBuffer(CGlVboNode* node) {} vector<CVect3<float> > m_VertexBuffer; vector<CRgbaColor> m_ColorBuffer; vector<CVect3<float> > m_NormalBuffer; vector<CVect2<float> > m_TexCoord2DBuffer1; /// vertex buffer node for rendering all Begin()/End() renders CGlVboNode m_RenderNode; /// for rendering quads (singular) pre-create a buffer CGlVboNode m_QuadRenderNode; /// state used by all nodes CRef<CGlState> m_State; /// current modelview matrix and matrix mode CMatrix4<float> m_ModelView; GLenum m_MatrixMode; /// rendering mode from Begin() GLenum m_CurrentMode; /// state pushed/poped by PushAttrib/PopAttrib and the corresponding bitmask vector<pair<GLbitfield,CGlState> > m_PushedState; /// text parameters const CGlTextureFont* m_CurrentFont; /// color and alpha for text only (other GL options do not apply to text) CRgbaColor m_TextColor; /// current projection set by Viewport() GLint m_Viewport[4]; }; /////////////////////////////////////////////////////////////////////////////// /// convenience function for getting current render manager /// NCBI_GUIOPENGL_EXPORT CGlRender& GetGl(); /////////////////////////////////////////////////////////////////////////////// /// CGlRender20 /// /// This is the renderer that should be (automatically) created if the OpenGL /// level is 2.0 or above. It uses vertex buffers rather than vertex arrays /// for rendering. class NCBI_GUIOPENGL_EXPORT CGlRender20 : public CGlRender { public: CGlRender20() {} virtual ~CGlRender20() {} /// Set OpenGL shader program. Other subclasses will not implement this. virtual void UseProgram(GLuint program); virtual void Render(CGlPane& pane, CGlModel2D* model); virtual ERenderTarget GetApi() { return eOpenGL20; } protected: virtual void x_RenderBuffer(CGlVboNode* node); }; /////////////////////////////////////////////////////////////////////////////// /// CGlRender11 /// /// This is the renderer that should be (automatically) created if the OpenGL /// level below 2.0. It uses vertex arrays for rendering. Note that this /// does not use the immediate mode commands glBegin(), glEnd(). By using /// vertex arrays, the code for CGlRender11 and CGlRender20 can be almost /// identical. class NCBI_GUIOPENGL_EXPORT CGlRender11 : public CGlRender { public: CGlRender11() {} virtual ~CGlRender11() {} virtual void Render(CGlPane& pane, CGlModel2D* model); virtual ERenderTarget GetApi() { return eOpenGL11; } protected: virtual void x_RenderBuffer(CGlVboNode* node); }; /////////////////////////////////////////////////////////////////////////////// /// CGlRenderDebug /// /// Create this renderer and install it if you think the other ones are not /// giving the correct result. This renderer simply passes all commands /// directly through to their corresponding OpenGL command of the same name, /// when applicable. (so obviously not for the text functions) class NCBI_GUIOPENGL_EXPORT CGlRenderDebug : public CGlRender { public: CGlRenderDebug() {} virtual ~CGlRenderDebug() {} /// Start rendering. "mode" may be one of: /// GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_FAN, /// GL_TRIANGLE_STRIP or GL_QUADS. 'state' replaces current state object virtual void Begin(GLenum mode, const CGlState& state); /// Start rendering - use state in existing 'state' object. virtual void Begin(GLenum mode); /// Finish rendering (create buffer and send to renderer) virtual void End(); /// /// Polygon rendering interface - render similar to matching OpenGL calls /// /// Explicit support not currently available for: /// GLbyte, GlShort and GLint calls, e.g. glVertex2i(int x, int y); /// Vertices with homgeneous coords, e.g. /// glVertex4f(float x, float y, float z, float w); /// 3&4-dimensional texture coords, e.g. glTexCoord4f /// Generic attributes and mulitple texture coords per vertex /// virtual void Vertex3f(GLfloat x, GLfloat y, GLfloat z); virtual void Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); virtual void RectC(const TModelRect& rc); virtual void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); virtual void TexCoord2f(GLfloat s, GLfloat t); virtual void Normal3f(GLfloat x, GLfloat y, GLfloat z); /// /// Text interface /// /// Text is drawn is pixel coordinates. Its position is /// transformed by the current ModelView matrix. The color and alpha for /// text are set in BeginText() and can be changed with SetTextColor(). /// Other OpenGL state should not affect text (since BeginText sets /// appropriate state) /// /// Set OpenGL state needed for writing text (call before DrawText) virtual void BeginText(const CGlTextureFont* font, const CRgbaColor& color); /// Same as above, but get color from m_RenderNode.m_State virtual void BeginText(const CGlTextureFont* font); virtual void EndText(); /// Update text color and alpha void SetTextColor(const CRgbaColor& color) { m_TextColor = color; } CRgbaColor GetTextColor() const { return m_TextColor; } /// Write text at specified model coords virtual void WriteText(TModelUnit x, TModelUnit y, const char* text, TModelUnit rotate_degrees = 0.0); /// Write text at specified model coords inside box defined by /// (x,y,width,height) with specified alignment, truncation and rotation virtual void WriteText(TModelUnit x, TModelUnit y, TModelUnit width, TModelUnit height, const char* text, CGlTextureFont::TAlign align = CGlTextureFont::eAlign_Center, CGlTextureFont::ETruncate trunc = CGlTextureFont::eTruncate_Ellipsis, TModelUnit rotate_degrees = 0.0f); /// Overridden in subclasses to return the supported rendering target virtual ERenderTarget GetApi() { return eRenderDebug; } /// /// Rendering state interface /// /// These commands just forward their parameters to the render managers /// CGlState object. State can also be updated (replaced) via /// Begin(GLenum mode, const CGlState& state); /// virtual void PushAttrib(GLbitfield mask); virtual void PopAttrib(); virtual void Enable(GLenum glstate); virtual void Disable(GLenum glstate); virtual void LineWidth(GLfloat w); virtual void PointSize(GLfloat s); virtual void ShadeModel(GLenum mode); virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height); /// Color{3,4}{f,d}{v} commands are defined above.... virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); virtual void PolygonMode(GLenum face, GLenum mode); virtual void LineStipple(GLint factor, GLushort pattern); virtual void PolygonStipple(GLubyte* mask); virtual void BlendFunc(GLenum sfactor, GLenum dfactor); virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); virtual void BlendColor(const CRgbaColor& c); virtual void ScaleInvarient(bool b, CVect2<TModelUnit> scale = CVect2<TModelUnit>(TModelUnit(1), TModelUnit(1))); virtual void ScaleFactor(const CVect2<TModelUnit>& scale); virtual void LineJoinStyle(ELineJoinStyle s); virtual void LineCapStyle(ELineCapStyle c); virtual void PdfShadeStyle(EPdfShadeStyle s); protected: CGlBitmapFont m_BitmapFont; }; END_NCBI_SCOPE /* @} */ #endif // GUI_OPENGL___GL_RENDER_MANAGER__HPP

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.