PDA

View Full Version : Intro + TBGL question



RobbeK
13-09-2013, 11:57
Hi all,
I'm new here and new to ThinBasic. Till some 15 yrs ago been working on CAD/CAM systems, mainly (visual) Lisp -> Siemens codes (x,y)+z systems.
Back in the mood, my choice was ThinBasic (also for its rich amount of units/modules).
I only started about a week using it - I have a little problem under TBGL (certainly I must be doing something wrong).
I made a simulation of orbits under Julia fractals , to get the needed speed I also used the Oxygen module.
Running this program @ fullscreen , it blanks after a few seconds and sporadically the screen comes back :-)

(and a further question : is there a way (and what is the best) to incorporate TBGL commands inside the oxygen scripts ?)

best regards Rob (sorry if stupid mistakes, I'm used to Lisp and Pascal )

ReneMiner
13-09-2013, 12:13
Hi and welcome Rob.

Here your program runs perfect - but windowed. I think the problem is the use of TBGL-Window together with UI - both are declared as App-Main-Window- probably will not occur if you'd use a canvas-control to display TBGL in UI-Window. But let's wait for Petr - I think he'll know correct solution.

Perhaps you can find in this thread (http://www.thinbasic.com/community/showthread.php?t=11955&highlight=multiple+windows) (attached to Post #8 by Petr) an example to get you started

Happy Coding!

René

Michael Hartlef
13-09-2013, 13:14
Hello Rob and welcome to the forum.

Petr Schreiber
13-09-2013, 13:32
Hi Rob,

welcome to the forum. Your code was fine, I think the possible causes of flicker could be:

calling TBGL_UseVsync in the loop - it is not necessary, enough to call it just once. Maybe it caused driver to have a little hiccups with all the immediate requests for syncing
there was 2 TBGL_ClearFrame and just one TBGL_DrawFrame
I modified your code to batch the point rendering via TBGL_BeginPoly/TBGL_EndPoly, it will be a bit faster


I modified the code slightly, and attached to this post, let me know if it helped.

Tip: You can have TBGL nested inside standard dialog.

Click File/New
Pick TBGL template directory
Pick TBGL_InDialog_BasicSkeleton or other InDialog template


Petr

ErosOlmi
13-09-2013, 15:20
Hi Rob,

what a great entrance in thinBasic community :)

Eros

RobbeK
13-09-2013, 19:49
Thank you all - Michael & René - for your "salutes", help and sharing your expertise !!

Thanks Petr, yes, works perfectly now - no hiccups any more :) -- there may be some clean-up inside the calculations too, I at first intended to use the iteration level as z-value , but as these are integers (giving only kind of level layers), I half-way switched to the orbit value.
... cycle_next ... I have a lot to catch up I see !
Thanks Eros , another reason of choice was the eval module -- some AI Lisp-like progs come in mind ;-) - ThinBasic seems a pleasurable language to learn! !
Petr, René : I'll study the links/tips you gave

best, Rob