Historical forum-msg-id-133854-edit, Revision 3

Original date:2019-05-15 13:20:28 Edited by: irv Subject: Re: Phix While Loop Inside pGUI Main Loop

I've spent the morning searching the web, and it appears that the best approach to doing this would be by wrapping GLFW3:


OpenGL itself is awfully complex, and there are several Euphoria wrappers for openGL in the archives, if someone wants to use (modify?) those. At any rate, EuGTK just allows you to create a GLArea and obtain an openGL "context". The setup should be simple, see below. As is, this opens a window with a blank black area for drawing. The hard part is writing the openGL code, and about this, like Sergeant Schultz, "I Know Nothing. Nothing!".

include GtkEngine.e 
    win = create(GtkWindow,"size=300x300;border=10;$destroy=Quit"), 
    gla = create(GtkGLArea), 
    glx = get(gla,"context"), 
    clk = create(GIdle,"DoStuff") -- calls DoStuff repeatedly, as fast as possible; 
    connect(gla,"render","Render") -- do whenever needed; 
global function DoStuff() 
-- you compute the moves here, 
-- (and, presumably, call openGL draw function) 
return 1 
end function 
global function Render(atom area, atom context) 
-- here's where the fun starts (And I Get Lost Totally!) 
return 1 
end function 
Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu