Re: [PyOpenGL-Users] Tracking down an invalid operation
Brought to you by:
mcfletch
|
From: Ian M. <geo...@gm...> - 2011-06-03 01:40:23
|
On Thu, Jun 2, 2011 at 2:35 PM, Derakon <de...@gm...> wrote: > I should have clarified: I'm not reading the texture data out, I'm > reading the array of brightness values that was used to generate the > texture. Basically the camera sends us a bunch of bytes, then one of > our viewers reads from those bytes to generate a texture. Now I'm > adding a second viewer to read from the same set of bytes. > > As for multiple contexts, I may have mis-stated or maybe I am in fact > using multiple contexts; I'm not that boned up on OpenGL. I'd assumed > each non-overlaid camera display was its own context, since each one > has the same texture ID of 1, and I'd assume that in a single context > no two textures could have the same texture ID. Is this inaccurate? > > This app has many wxGLCanvases all over the place and I've never run > into trouble before. This window should work just like the other > canvases in the app. According to this: > > http://wiki.wxwidgets.org/WxGLCanvas#Sharing_wxGLCanvas_context > > it should be possible to share the OpenGL context across canvases, but > we aren't doing that right now. Of course none of the canvases are > trying to share resources either. > > It sounds like you're suggesting that in the middle of my viewer's > paint logic, another context is barging in and confusing OpenGL. I > take that to mean that when I make an OpenGL API call, my context > isn't implicitly passed along? But then why wouldn't my other canvases > ever get screwed up? Assuming that is the problem, theoretically I > could fix that by creating one canvas, getting its context, and then > storing that globally and using it whenever I create any other > canvases. Does that sound about right? > Not sure exactly. I just know that having one application and several contexts gets dicey quickly. Personally, I'd go with the single context, as that should fix any problems therein. It seems to me that you can minimize any problems by making one texture for each context, and then just updating that texture with the given bytes (glCopyTex[Sub]Image2D(...), though you might already be doing that. Ian |