Thread: [Openrm-users] Initializing OpenRM
Brought to you by:
wbethel
|
From: Luke C. <lu...@ba...> - 2010-04-12 18:59:02
|
Hi Wes, I have a question regarding the steps necessary to initialize OpenRM in win32 using RM_PIPE_NOPLATFORM, specifically Page 367 "Overview of RM Initialization", step 3. I'm trying to figure out why everything works without me having to set the OpenGL context using rmPipeSetContext. These are the steps my code performs; #1 - Initialize OpenRM #2 - Create a new pipe #3 - Use the SDL library to create a new window. Internally SDL performs wglCreateContext, and wglMakeCurrent. I do not assign the OpenGL context to the pipe. #4 - Use rmPipeSetWindow to assign the window handle and dimensions to the pipe. #5 - Use rmPipeMakeCurrent to make the OpenGL context current. If in #3 above I don't assign the OpenGL context to the pipe using rmPipeSetContext, then everything works. If in #3 above I assign a null pointer as theOpenGL context to the pipe using rmPipeSetContext, then everything works. If in #3 above I assign hwnd as the OpenGL context to the pipe using rmPipeSetContext, then everything works. If in #3 above I assign hglrc as the OpenGL context to the pipe using rmPipeSetContext, then I experience intermittent crashes. I'm a little confused as to why this is. So it seems that it is not necessary to use rmPipeSetContext with RM_PIPE_NOPLATFORM, is this correct? - Luke |
|
From: Luke C. <lu...@ba...> - 2010-04-12 18:57:00
|
Hi Wes, I have a question regarding the steps necessary to initialize OpenRM in win32 using RM_PIPE_NOPLATFORM, specifically Page 367 "Overview of RM Initialization", step 3. I'm trying to figure out why everything works without me having to set the OpenGL context using rmPipeSetContext. These are the steps my code performs; #1 - Initialize OpenRM #2 - Create a new pipe #3 - Use the SDL library to create a new window. Internally SDL performs wglCreateContext, and wglMakeCurrent. I do not assign the OpenGL context to the pipe. #4 - Use rmPipeSetWindow to assign the window handle and dimensions to the pipe. #5 - Use rmPipeMakeCurrent to make the OpenGL context current. If in #3 above I don't assign the OpenGL context to the pipe using rmPipeSetContext, then everything works. If in #3 above I assign a null pointer as theOpenGL context to the pipe using rmPipeSetContext, then everything works. If in #3 above I assign hwnd as the OpenGL context to the pipe using rmPipeSetContext, then everything works. If in #3 above I assign hglrc as the OpenGL context to the pipe using rmPipeSetContext, then I experience intermittent crashes (I'm a little confused as to why this is.) So it seems that it is not necessary to use rmPipeSetContext with RM_PIPE_NOPLATFORM, is this correct? - Luke |
|
From: Wes B. <ewb...@r3...> - 2010-04-12 21:46:45
|
Hi, This business of initializing OpenRM under Windows with 3rd party libraries is one of those boundary cases that I never really had the opportunity to test. Some guesses/answers below... Luke Crook wrote: > Hi Wes, > > I have a question regarding the steps necessary to initialize OpenRM > in win32 using RM_PIPE_NOPLATFORM, specifically Page 367 "Overview of > RM Initialization", step 3. > > I'm trying to figure out why everything works without me having to set > the OpenGL context using rmPipeSetContext. > > These are the steps my code performs; > > #1 - Initialize OpenRM > #2 - Create a new pipe > #3 - Use the SDL library to create a new window. Internally SDL > performs wglCreateContext, and wglMakeCurrent. I do not assign the > OpenGL context to the pipe. > #4 - Use rmPipeSetWindow to assign the window handle and dimensions to the pipe. > #5 - Use rmPipeMakeCurrent to make the OpenGL context current. > > If in #3 above I don't assign the OpenGL context to the pipe using > rmPipeSetContext, then everything works. This one is probably the most "stable" approach if you're not doing anything really advanced with multithreading. The idea is that SDL sets the context and that OpenRM just chugs along issuing OpenGL comments later on that are processed by the "current context." Anything else would require some deeper understanding of what SDL is doing. I'm not familiar with it, so can't even hazard a guess. > If in #3 above I assign a null pointer as theOpenGL context to the > pipe using rmPipeSetContext, then everything works. > If in #3 above I assign hwnd as the OpenGL context to the pipe using > rmPipeSetContext, then everything works. I have no idea why this one works :) Doesn't seem like it should work at all. > If in #3 above I assign hglrc as the OpenGL context to the pipe using > rmPipeSetContext, then I experience intermittent crashes. I'm a little > confused as to why this is. I'm wondering if there's a bug or some doc confusion with SDL...like maybe the window (hwnd) and OpenGL context are reversed somehow? > > So it seems that it is not necessary to use rmPipeSetContext with > RM_PIPE_NOPLATFORM, is this correct? Without knowing anything else, like what your app is doing later, can't say for sure. If you're doing just vanilla single-threaded, single-window and single-context stuff (using any of the OpenRM nodes/primitives) it seems like you're probably OK. HTH, wes |
|
From: Luke C. <lu...@ba...> - 2010-04-12 20:45:27
|
On Mon, Apr 12, 2010 at 1:37 PM, Wes Bethel <ewb...@r3...> wrote: > Luke Crook wrote: >> >> So it seems that it is not necessary to use rmPipeSetContext with >> RM_PIPE_NOPLATFORM, is this correct? > > Without knowing anything else, like what your app is doing later, can't say for sure. If you're doing just vanilla single-threaded, single-window and single-context stuff (using any of the OpenRM nodes/primitives) it seems like you're probably OK. Yes to the above as I am only replicating the OpenRM examples at the moment. I'll make a note to come back to this if I start seeing weird behaviour later. Thanks, - Luke |
|
From: Luke C. <lu...@ba...> - 2010-04-13 20:28:17
|
On Mon, Apr 12, 2010 at 1:37 PM, Wes Bethel <ewb...@r3...> wrote: > > Hi, > > This business of initializing OpenRM under Windows with 3rd party libraries is one of those boundary cases that I never really had the opportunity to test. Some guesses/answers below... I'm still investigating. This time I used RM_PIPE_WGL which forces OpenRM to create the OpenGL context. >> If in #3 above I assign hglrc as the OpenGL context to the pipe using >> rmPipeSetContext, then I experience intermittent crashes. I'm a little >> confused as to why this is. > > I'm wondering if there's a bug or some doc confusion with SDL...like maybe the window (hwnd) and OpenGL context are reversed somehow? > When using RM_PIPE_WGL, rmPipeSetContext has to be called or the window remains blank. However, rmPipeSetContext has to be called using hwnd. (I pass the result of CreateWindow to rmPipeSetContext). I fact, calling rmPipeSetContext using hwnd and not hglrc makes sense as I'm not sure how to get hold of hglrc when OpenRM creates the OpenGL context internally using RM_PIPE_WGL. - Luke |
|
From: Luke C. <lu...@ba...> - 2010-04-14 00:53:02
|
On Tue, Apr 13, 2010 at 12:59 PM, Luke Crook <lu...@ba...> wrote: > On Mon, Apr 12, 2010 at 1:37 PM, Wes Bethel <ewb...@r3...> wrote: >> >> Hi, >> >> This business of initializing OpenRM under Windows with 3rd party libraries is one of those boundary cases that I never really had the opportunity to test. Some guesses/answers below... > > I'm still investigating. This time I used RM_PIPE_WGL which forces > OpenRM to create the OpenGL context. > >>> If in #3 above I assign hglrc as the OpenGL context to the pipe using >>> rmPipeSetContext, then I experience intermittent crashes. I'm a little >>> confused as to why this is. >> >> I'm wondering if there's a bug or some doc confusion with SDL...like maybe the window (hwnd) and OpenGL context are reversed somehow? >> > > When using RM_PIPE_WGL, rmPipeSetContext has to be called or the > window remains blank. > > However, rmPipeSetContext has to be called using hwnd. (I pass the > result of CreateWindow to rmPipeSetContext). > > I fact, calling rmPipeSetContext using hwnd and not hglrc makes sense > as I'm not sure how to get hold of hglrc when OpenRM creates the > OpenGL context internally using RM_PIPE_WGL. Sorry, scratch the above. When using RM_PIPE_WGL (without using rmauxCreateW32Window) it seems that I have to call rmPipeCreateContext to have OpenRM create the OpenGL context. Is this correct? After calling rmPipeCreateContext, do I still have to call rmPipeSetContext ? - Luke |
|
From: Wes B. <ewb...@r3...> - 2010-04-14 04:11:44
|
Hi Luke, Unfortunately, I'm on travel right now and don't have ready access to either the code or the manual...will take a look when I'm back in CA and follow up in a couple of days. tx, wes Luke Crook wrote: > On Tue, Apr 13, 2010 at 12:59 PM, Luke Crook <lu...@ba...> wrote: >> On Mon, Apr 12, 2010 at 1:37 PM, Wes Bethel <ewb...@r3...> wrote: >>> Hi, >>> >>> This business of initializing OpenRM under Windows with 3rd party libraries is one of those boundary cases that I never really had the opportunity to test. Some guesses/answers below... >> I'm still investigating. This time I used RM_PIPE_WGL which forces >> OpenRM to create the OpenGL context. >> >>>> If in #3 above I assign hglrc as the OpenGL context to the pipe using >>>> rmPipeSetContext, then I experience intermittent crashes. I'm a little >>>> confused as to why this is. >>> I'm wondering if there's a bug or some doc confusion with SDL...like maybe the window (hwnd) and OpenGL context are reversed somehow? >>> >> When using RM_PIPE_WGL, rmPipeSetContext has to be called or the >> window remains blank. >> >> However, rmPipeSetContext has to be called using hwnd. (I pass the >> result of CreateWindow to rmPipeSetContext). >> >> I fact, calling rmPipeSetContext using hwnd and not hglrc makes sense >> as I'm not sure how to get hold of hglrc when OpenRM creates the >> OpenGL context internally using RM_PIPE_WGL. > > Sorry, scratch the above. > > When using RM_PIPE_WGL (without using rmauxCreateW32Window) it seems > that I have to call rmPipeCreateContext to have OpenRM create the > OpenGL context. Is this correct? > > After calling rmPipeCreateContext, do I still have to call rmPipeSetContext ? > > - Luke > > -- Wes Bethel -- R3vis Corporation -- voice (415) 806-6531 -- www.r3vis.com |
|
From: Luke C. <lu...@ba...> - 2010-04-16 23:22:30
|
Hi Wes, I have figured out the correct initialization steps for; :RM_PIPE_NO_PLATFORM using win32 OS calls, :RM_PIPE_WGL using win32 OS calls, and :RM_PIPE_NO_PLATFORM using the SDL library. :RM_PIPE_NO_PLATFORM using win32 OS calls; #a - rmInit (mandatory) #b - Initialize rmPipe using rmPipeNew (mandatory) #1 - CreateWindow (mandatory) #2 - SetPixelFormat (mandatory) #3 - wglCreateContext (mandatory) #4 - wglMakeCurrent (mandatory) #5 - rmPipeSetContext (optional) #6 - rmPipeSetWindow or rmPipeSetWindowSize (mandatory) #7 - rmPipeMakeCurrent (mandatory) :RM_PIPE_WGL using win32 OS calls; #a - rmInit (mandatory) #b - Initialize rmPipe using rmPipeNew etc. (mandatory) #1 - CreateWindow (mandatory) #2 - SetPixelFormat (mandatory) #3 - rmPipeSetWindow or rmPipeSetWindowSize (mandatory) #4 - rmPipeCreateContext (mandatory) #5 - rmPipeMakeCurrent (mandatory) :RM_PIPE_WGL using the SDL library; #a - rmInit (mandatory) #b - Initialize rmPipe using rmPipeNew etc. (mandatory) #1 - SDL_SetVideoMode (Creates the window & OpenGL Context) (mandatory) #2 - rmPipeSetContext (optional) #3 - rmPipeSetWindow or rmPipeSetWindowSize (mandatory) #4 - rmPipeMakeCurrent (mandatory) |
|
From: Wes B. <ewb...@r3...> - 2010-04-17 13:14:19
|
Thanks, Luke, for experimenting and following up. I'll make sure this information is propagated to the manual (and code docs) during the next round of revisions. wes Luke Crook wrote: > Hi Wes, > > I have figured out the correct initialization steps for; > :RM_PIPE_NO_PLATFORM using win32 OS calls, :RM_PIPE_WGL using win32 OS > calls, and :RM_PIPE_NO_PLATFORM using the SDL library. > > :RM_PIPE_NO_PLATFORM using win32 OS calls; > #a - rmInit (mandatory) > #b - Initialize rmPipe using rmPipeNew (mandatory) > #1 - CreateWindow (mandatory) > #2 - SetPixelFormat (mandatory) > #3 - wglCreateContext (mandatory) > #4 - wglMakeCurrent (mandatory) > #5 - rmPipeSetContext (optional) > #6 - rmPipeSetWindow or rmPipeSetWindowSize (mandatory) > #7 - rmPipeMakeCurrent (mandatory) > > :RM_PIPE_WGL using win32 OS calls; > #a - rmInit (mandatory) > #b - Initialize rmPipe using rmPipeNew etc. (mandatory) > #1 - CreateWindow (mandatory) > #2 - SetPixelFormat (mandatory) > #3 - rmPipeSetWindow or rmPipeSetWindowSize (mandatory) > #4 - rmPipeCreateContext (mandatory) > #5 - rmPipeMakeCurrent (mandatory) > > :RM_PIPE_WGL using the SDL library; > #a - rmInit (mandatory) > #b - Initialize rmPipe using rmPipeNew etc. (mandatory) > #1 - SDL_SetVideoMode (Creates the window & OpenGL Context) (mandatory) > #2 - rmPipeSetContext (optional) > #3 - rmPipeSetWindow or rmPipeSetWindowSize (mandatory) > #4 - rmPipeMakeCurrent (mandatory) > -- Wes Bethel -- R3vis Corporation -- voice (415) 806-6531 -- www.r3vis.com |