Best place to put wxGLContext

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Daniel Dekkers
Experienced Solver
Experienced Solver
Posts: 79
Joined: Wed Aug 15, 2012 8:04 am

Best place to put wxGLContext

Post by Daniel Dekkers »

Hi,

I see different methods used in examples and in forums.
Is the proper "2014 way" to place a single instance on application level where a canvas asks for it when needed.
Or is it best to have an instance in every canvas you might have?

Thanks,
Daniel Dekkers
Manolo
Can't get richer than this
Can't get richer than this
Posts: 828
Joined: Mon Apr 30, 2012 11:07 pm

Re: Best place to put wxGLContext

Post by Manolo »

It depends on how many window-parameters (colors, buffer depth, etc.) and model data are common to all canvas.
If two canvas differ only in the camera, I would share the context because it saves resources. If they have different models, I prefer to create a context for each window.
Post Reply