[wxGLCanvas] GL commands don't work

ABE Hiroshi hiroshi at arlivre.ddo.jp
Wed Jul 4 00:24:12 PDT 2007


Thank you Stulov and Carsten,

The way I took seems NOT to be a good way. This could be a chance to  
change the design. However, it might be possible to share a  
wxGLContext with threads even in my original software design...

Anyway first of all I'll try wglMakeCurrent-wise and see it then I'll  
think further.

Thank you again, they are very helpful to me.


On 2007/07/04, at 14:34, Stulov Dmitry wrote:

> You need REALLY use all gl commands at one thread. Commands from over
> thread mast be sended by evets or message system to main.
[snip]

On 2007/07/04, at 15:50, CarstenFuchs at t-online.de wrote:

> Hi ABE Hiroshi,
>
> I don't know much about threads, but Google provides some links  
> that lead to useful background information:
> 1) http://support.microsoft.com/?scid=kb%3Ben-us%3B128122&x=10&y=17
> 2) http://msdn2.microsoft.com/en-us/library/ms537558.aspx
>
> Quote from 2): "The wglMakeCurrent function makes a specified  
> OpenGL rendering context the calling thread's current rendering  
> context."
>
> That means that with wxWidgets, you probably have a good chance to  
> achieve what you want by just making the wxGLCanvas/wxGLContext  
> current again in the current thread before you call any OpenGL  
> related function in it.
>
> Doing so should work both with wxWidgets 2.6.x and previous, as  
> well as (and even better) with wxWidgets 2.8.x and later (the  
> latter have slightly changed wxGL*::SetCurrent() policy), please  
> see the documentation of wxGLCanvas and wxGLContext for details.
>
>


ABE Hiroshi
  from Tokorozawa, JAPAN





More information about the wx-users mailing list