Child window winth GLFW3 blocking OpenGL Main application

karistouf wrote on Friday, December 19, 2014:

Hello, i have choosen GLFW3 to generate from an existing application i m developping a separate renderer

i m on windows, with Codeblocks and mingw, and i m using for my main app an old lib called OpenLayer, based on AllegroGL and allegro 4.4 gamelibrary.

My main app is quite hudge, opensource, and is used in theatre to handle lights , sound and is used professionnaly quite widely.

Openlayer is an old OpenGl wrapper for 2D usage, you can find it there:


and my software can be seen there: http://www.le-chat-noir-numerique.fr/

I m trying to get GLFW 3.0 working but i have a real problem:
creating a window is disabling refreshment of the main app. keyboard is working, but when i create a window it kills the refreshing process.

is there any trick to avoid it ?

thxs

Does anyone has any on how to allow from the same main loop the two rendering ?

dougbinks wrote on Friday, December 19, 2014:

I think it’s likely that the issue you’re seeing is that to render with opengl you need to specify the context prior to sending commands - see the manual for glfw on contexts and I think this is the Allegro documentation for similar.

karistouf wrote on Friday, December 19, 2014:

hello doug, thx for answer.

Helas this is a 5.0 feature, i m using the allegro 4.4, wich is in fact a complete different library. so it doens t exist.

what could be a solution ?

dougbinks wrote on Friday, December 19, 2014:

Then I think your solutions are one of:

  1. Write a cross platform API for context setting, and use that. See the GLFW example code - on Windows the function you need to get the context is wglGetCurrentContext and the set function is wglMakeCurrent.
  2. Upgrade to Allegro 5.0
  3. Move all windowing to GLFW.
  4. Ask on the Allegro forums (as the issue is Allegro 4.4 not being able to set the current context by the sounds).

karistouf wrote on Friday, December 19, 2014:

hum… point 2 and 3 are not possible. despite it should be a better solution
Actually TOO much work ( its a big big big app)

ok i will work around the wglGetCurrentContext :slight_smile: thanks a lot !!!

btw: all examples are in a while loop, how are you handling multiple windows with refreshment ?

dougbinks wrote on Friday, December 19, 2014:

For refreshment, use glfwSetWindowRefreshCallback to get the refresh callback, this receives the GLFWwindow pointer of the window to be refreshed and then you refresh it.

For Allegro, no idea!

karistouf wrote on Saturday, December 20, 2014:

hello Doug, is there any simple example ( i m not used to those concepts) to see how to use this structure ?

dougbinks wrote on Saturday, December 20, 2014:

I don’t think there is a multi-window example available, but if you’re struggling with the callback syntax look at the splitview example main function. Line 471 sets the callback to the function static void windowRefreshFun(GLFWwindow* window).

karistouf wrote on Saturday, December 20, 2014:

thanks a lot doug, i will keep you informed

karistouf wrote on Sunday, December 21, 2014:

Hum… i m reconsidering completly the approach. child widow of my app will be tto much ressources consumming.

so i would like to write a second app with child window with GLFW and GLEW.

My main question actually is: where can i found a sample to have a main window and a child window, to understand how to call them ?

“just” in need of a GUI, and a rendering window

dougbinks wrote on Sunday, December 21, 2014:

I do not know of any such samples, though a quick google search did find a
tutorial:
http://blog.gvnott.com/2013/05/18/tutorial-multiple-windows-with-glfw3-and-glew-mx/

On 21 December 2014 at 10:00, CHRISTOPH karistouf@users.sf.net wrote:

Hum… i m reconsidering completly the approach. child widow of my app
will be tto much ressources consumming.

so i would like to write a second app with child window with GLFW and GLEW.

My main question actually is: where can i found a sample to have a main
window and a child window, to understand how to call them ?

Child window winth GLFW3 blocking OpenGL Main application
https://sourceforge.net/p/glfw/discussion/247562/thread/e364b14a/?limit=25#4425

Sent from sourceforge.net because you indicated interest in
GLFW / Discussion / Using GLFW

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net

karistouf wrote on Sunday, December 21, 2014:

yep, but MSVC, no code blocks…

dougbinks wrote on Sunday, December 21, 2014:

The basics should remain the same - it’s all code, you just need to figure
out project settings which should be the same for a single window app.

On 21 December 2014 at 16:18, CHRISTOPH karistouf@users.sf.net wrote:

yep, but MSVC, no code blocks…

Child window winth GLFW3 blocking OpenGL Main application
https://sourceforge.net/p/glfw/discussion/247562/thread/e364b14a/?limit=25#ccfa

Sent from sourceforge.net because you indicated interest in
GLFW / Discussion / Using GLFW

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net