Re: FreeGlut Example Not Working

new topic     » goto parent     » topic index » view thread      » older message » newer message
Icy_Viking said...

Thanks for the tips. I tried a more simple idea, but it still isn't working.

atom y = routine_id("Render") 
 
call_proc(y,{}) 
 
glutDisplayFunc(y) 

That needs to be call_back() not call_proc(). They have very similar names but very different purposes. And you need to pass the result of call_back() (not the result of routine_id()) to glutDisplayFunc.

integer Render_id = routine_id( "Render" ) 
 
atom Render_cb = call_back( Render_id ) 
 
glutDisplayFunc( Render_cb ) 

A few notes about the Euphoria internals:

  • routine_id() returns an integer that counts from one, which is the index to an internal routine list that then contains another index to somewhere in the internal symbol table.

  • call_func() and call_proc() take that index value from routine_id() and simply make normal internal routine call to the value at that index in the routine list, the same way you would if you called the routine directly by name.

  • call_back() takes an index value from routine_id() and sets up a small C function in memory and returns an atom that contains the new memory address. You then take that memory address value and give it to some external system so that the system can make a call back into your Euphoria application from the outside.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu