PDA

View Full Version : GamingFX problem



matthew
02-05-2008, 20:49
Hey Petr, I just downloaded the GamingFX Example off this (http://psch.thinbasic.com/articles_gamingfx_TombRaiderAnniversary.html) page of your website again.

When I try the RiverStream Example, thinBasic crashes whenever I press the number '2' key.

Any ideas why? :-\

Petr Schreiber
03-05-2008, 06:31
Hi Matthew,

many apologies, I think it might be because of internal changes in latest TBGL & lazy example coding on my side.
I think the problem was:


dim ModelVertexcount as number = 2600'tbgl_m15GetModelVertexcount(1)


I changed it back to:


dim ModelVertexcount as number = tbgl_m15GetModelVertexcount(1)


and it should work now?
I must admit I did not get any crash even with "bad" version, so please let me know!

IF it will be ok THEN
I will update the file on my web
ELSE
I think you have found a bug I cannot refuse to fix :)
ENDIF

I am sorry I originally uploaded there such a suspicious version of code, it had to be by accident or during some testing :-[


Petr

matthew
03-05-2008, 06:58
I've just downloaded the new version & it's working perfectly. :)

Petr Schreiber
03-05-2008, 07:06
Great!,

to explain better where was problem - the original code was shifting UV coordinates even for vertices which were not present in model ( 1 TO 2600, model has 2592 ).

In latest TBGL, if you specify


tbgl_m15InitModelBuffers 1, 2600


... and the loaded model has less vertices, only the true number of vertices is stored.

This leads to better memory efficency. tbgl_m15InitModelBuffers now works more like suggestion about maximum theoretical dimension loaded model will have. In future versions of TBGL, this statement might be completely removed to make programmers life easier :)


Thanks for the report and tests, I will upload the corrected version now


Petr