PDA

View Full Version : Opengl viewer Demo



Charles Pegge
12-07-2008, 11:33
At last!

The latest Asmosphere contains an Opengl Demo, as well as the HelloWin.

I've used this one before - it really put Asmosphere through its paces and resulted in a few more minor adjustments to the assembler.

http://community.thinbasic.com/index.php?topic=1845.0

ErosOlmi
12-07-2008, 11:54
OMG :o
this is something NASA should have a look!
Asmosphere code inside "Test_Opengl2.tbasic" script is very neat and a must to learn a lot on OS inside.

Thanks a lot Charles!

Charles Pegge
12-07-2008, 14:07
The original of this piece comes with Freebasic using GLFW. I translated it some time ago into pure Opengl for Freebasic and PB, when Patrice Terrier found that GLFW does not perform smoothly under Vista. I took the Freebasic version of this and converted most of it into inline ASM, I then took chunks of this and converted it to Asmosphere. This rather lengthy route enabled almost continuous testing during the translation process to catch errors as soon as they occur. But there were certain points where this kind of testing was not possible and these took exponentially longer to resolve. The lesson I draw from this is to write testable code wherever possible - the other stuff is very expensive :)

I found a few bugs were getting through the traps so it was useful to find out where this was happening and plug the gaps. So it was a good exercise for Asmosphere.

José Roca
12-07-2008, 16:37
Patrice Terrier found that GLFW does not perform smoothly under Vista.


I have read that it flickers. Better to use SDK.

Petr Schreiber
12-07-2008, 19:10
Very impressive Charles!,

I remember similar demo for GLUT, but it had window refresh problems. This has no problems at all.
Very good!


Petr

kryton9
16-07-2008, 00:11
Charles how in the world did you ever figure all of this out? I might as well have walked into an alien space ship and looked at a code printout from the off world programmer and not be anymore amazed!!

Charles Pegge
16-07-2008, 10:18
Well I am a bottom-up coder and find that taking very small steps works well for me. My first program was 1 byte long: ret. then after accomplishing this without causing a GPF I got bolder and tried:

nop
ret

and it just built up from there.:) Once you have a few proven building blocks it grows exponentially.

kryton9
16-07-2008, 11:14
Hehehehe thanks for the tips, now only if my mind worked like yours!