Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Allow the Graphics Context to be accessed at all times #131

Open
GoogleCodeExporter opened this issue May 19, 2015 · 6 comments
Open

Comments

@GoogleCodeExporter
Copy link

Currently, the graphics context is only accessible during component::do_draw(). 


This context contains such important data as the canvas, the current 
io_service, current strand, and so on.  These are very useful during routines 
such as animation, but are inaccessible during other times, leading to 
complicated code.  It could also be used to access user settings such as 
terminal capabilities, preferred colours, etc.

Potential Solution #1: store a context per object.  This would work but would 
require that every object store a pointer to the context (expensive in terms of 
memory), and would make every constructor exceedingly noisy.

Potential Solution #2: store a context object at a globally accessible 
location.  Care would be taken to ensure that the context object is correct for 
the current UI being handled.

Problem: several threads may be competing for the globally accessible context 
object.

Potential Solution #2b: store context objects for each thread in a 
boost::thread_specific_ptr<>.

This seems to tick all the boxes.  When a thread performs actions on a UI, it 
ensures that the current context is set in the thread_specific_ptr<>.  If 
another thread is doing the same thing on another UI, then this ensures that 
there is no contention.

Original issue reported on code.google.com by [email protected] on 18 Jul 2013 at 12:57

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 31 Jul 2013 at 9:14

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 23 Aug 2013 at 7:07

  • Added labels: Priority-Medium
  • Removed labels: Priority-Undetermined

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 23 Aug 2013 at 7:18

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 30 Aug 2013 at 7:55

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 5 Sep 2013 at 12:01

  • Added labels: Milestone-Release1.6
  • Removed labels: Milestone-Release1.4

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 7 Aug 2014 at 12:49

  • Added labels: Milestone-Release1.4
  • Removed labels: Milestone-Release1.6

@KazDragon KazDragon added this to the Milestone-Release1.4 milestone Jul 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants