Mercurial > hg > octave-nkf
comparison src/gl-render.cc @ 14838:1abb7c083171
Make sure opengl_renderer::toolkit is defined.
* src/gl-render.cc (opengl_renderer::draw (const graphics_object&, bool)):
Define toolkit if not already done.
(opengl_renderer::draw_figure, opengl_renderer::draw_uipanel): Remove toolkit
definition.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Wed, 04 Jul 2012 15:53:18 +0100 |
parents | 72c96de7a403 |
children | 460a3c6d8bf1 |
comparison
equal
deleted
inserted
replaced
14837:c55493bb7363 | 14838:1abb7c083171 |
---|---|
549 { | 549 { |
550 if (! go.valid_object ()) | 550 if (! go.valid_object ()) |
551 return; | 551 return; |
552 | 552 |
553 const base_properties& props = go.get_properties (); | 553 const base_properties& props = go.get_properties (); |
554 | |
555 if (! toolkit) | |
556 toolkit = props.get_toolkit (); | |
554 | 557 |
555 if (go.isa ("figure")) | 558 if (go.isa ("figure")) |
556 draw_figure (dynamic_cast<const figure::properties&> (props)); | 559 draw_figure (dynamic_cast<const figure::properties&> (props)); |
557 else if (go.isa ("axes")) | 560 else if (go.isa ("axes")) |
558 draw_axes (dynamic_cast<const axes::properties&> (props)); | 561 draw_axes (dynamic_cast<const axes::properties&> (props)); |
585 } | 588 } |
586 | 589 |
587 void | 590 void |
588 opengl_renderer::draw_figure (const figure::properties& props) | 591 opengl_renderer::draw_figure (const figure::properties& props) |
589 { | 592 { |
590 toolkit = props.get_toolkit (); | |
591 | |
592 // Initialize OpenGL context | 593 // Initialize OpenGL context |
593 | 594 |
594 init_gl_context (props.is___enhanced__ (), props.get_color_rgb ()); | 595 init_gl_context (props.is___enhanced__ (), props.get_color_rgb ()); |
595 | 596 |
596 // Draw children | 597 // Draw children |
603 const graphics_object& go) | 604 const graphics_object& go) |
604 { | 605 { |
605 graphics_object fig = go.get_ancestor ("figure"); | 606 graphics_object fig = go.get_ancestor ("figure"); |
606 const figure::properties& figProps = | 607 const figure::properties& figProps = |
607 dynamic_cast<const figure::properties&> (fig.get_properties ()); | 608 dynamic_cast<const figure::properties&> (fig.get_properties ()); |
608 | |
609 toolkit = figProps.get_toolkit (); | |
610 | 609 |
611 // Initialize OpenGL context | 610 // Initialize OpenGL context |
612 | 611 |
613 init_gl_context (figProps.is___enhanced__ (), | 612 init_gl_context (figProps.is___enhanced__ (), |
614 props.get_backgroundcolor_rgb ()); | 613 props.get_backgroundcolor_rgb ()); |