Logo

Code Samples


Are you looking for some samples to see the TMT Pascal compiler in action? You are in the right place! We will gather interesting and useful examples written on TMT Pascal and put them here. Please feel free to check this page frequently.

Bouncing BallBouncing Ball (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by NeHe (http://nehe.gamedev.net) and Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002


This program has a ball bouncing on the surface below and squashing as it hits the bottom. The ball has Spherical Environment Mapping applied to it and the entire thing is reflected onto the surface below.

This program was based on a similar one by Andreas Gustafson.

Download

Cell ShadingCell Shading (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by NeHe (http://nehe.gamedev.net) and Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002


This demo shows you how to do basic cell shading also known as cartoon rendering. You can get the tutorial at NeHe's site.
Keys:
- 1 : Toggle outline drawing;
- 2 : Toggle outline anti-alaising (Smooth lines);
- Space : Toggle rotation;
- Up Arrow : Increase line width;
- Down Arrow : Decrease line width.

Download

Electric SpheresElectric Spheres (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn(http://www.sulaco.co.za), 2002
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This project demonstrates creating a spark/bolt of electricity. In the app I have two spheres with a constant spark between them. If one of them get close enough to a third sphere a spark is shot across to that sphere.

Keys: keypad + and - to increase and decrease the number of threads in the spark.

Download

Environment mapped metaballsEnvironment mapped metaballs (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This application uses spherical environment mapping applied to the metaballs to create metaballs that look like they are reflective liquid metal.
You can increase and decrease the quality of the metaballs by pressing + and - on the keypad.

Download

Face BlurFace Blur (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by Dario Corno (rIo) /
NeHe (http://nehe.gamedev.net) and Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

FaceBlur is a face I got from a 3DS model and added some radialblur onto it. Created an interesting effect. This demo is quite CPU and graphically intensive.

Download

FireworksFireworks (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This is a basic particle system that creates multicolored fireworks. There is also a bit of gravity which slows down the rocket on the way up and causes the particles fall down after the explosion.

Keys: Numeric keypad + and - to change the number of fireworks.

Download

Plasma TunnelPlasma Tunnel (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This is a tunnel effect where the texture coordinates keep changing based on a sine wave. Obviously the real effect is a lot more "alive".

Download

Pocket WatchPocket Watch (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2002
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This program started out as a program to show some gears and how they interact.
The final app has some transparent surfaces, spherical environment mapping, lighting and a few other features all thrown into one :)

Press 'C' to remove the watch case and 'F' to remove the watch face and then you can see the gears in action. The gears do turn a bit faster than the dials, but running them at the correct speed was boring :)

To control the object you can click and drag with your mouse.

Mouse:
Left Button : Rotate object.
Right Button : Zoom object.
Middle Button : Move object.

Keys:
W : Toggle wireframe mode
C : Show/Hide the watch case
F : Show/Hide the watch face
L : Toggle lighting

Download

Space DonutsSpace Donuts (DirectX Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally a C++ version Microsoft Corp. ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This simple game shows how to combine DirectDraw, DirectInput, and DirectSound. Although it demonstrates other DirectX components, it is primarily intended to show how to animate multiple sprites.

The following is a complete list of game commands. All numbers must be entered from the numeric keypad. Joy refers to a joystick button.
Key Command
ESC, F12 Quit
4 Turn left
6 Turn right
5 (Joy 3) Stop
8 Accelerate forward
2 Accelerate backward
7 (Joy 2) Shields
SPACEBAR (Joy 1) Fire
ENTER Start game
F1 Toggle trailing afterimage effect on/off
F5 Toggle frame rate display on/off
F7 Turn music on/off
F10 Main menu

This game demonstrates many of the features of DirectDraw. It takes advantage of hardware acceleration if it is supported by the driver. The program requires less than 1 MB of video RAM. The sound code is deliberately designed to stress the DirectSound API. It is not intended to be a demonstration of how to use DirectSound API efficiently. For example, each bullet on the screen uses a different sound buffer. Space Donuts creates over 70 sound buffers (including duplicates), and between 20 to 25 may be playing at any time.

Download

Specular SpaceShipSpecular SpaceShip (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

A program that uses specular highlighting as well as environment mapping. The spaceship had over 8000 polygons.
You can control the rotation and distance using your mouse and enable and disable lighting by pressing "L".

Download

Stencil Buffers Stencil Buffers (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

There are three examples which demonstrate some uses of the stencil buffer:
- Stencil 1: First draws a square in the stencil buffer. The a wireframe knot is drawn in that mask, so it only appears in the square. The same knot is drawn filled on the scene where the stencil mask dot not appear.
- Stencil 2: Same as above, but it renders the knot in the square area.
- Stencil 3: Same idea, but here the knot is the mask that is created in the stencil buffer and the textured square is then drawn on that mask.

Move your mouse around to move the "view window" in Stencil 1 and 2

Download

Threads Threads (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally written by
Jan Horn (http://www.sulaco.co.za), 2002
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This program uses line strips that follow your mouse cursor to create some neat line effects.

"S" toggles smooth shading and blurring effect. 1-9 adjusts the thread density. Keypad + and - changes the number of threads.

Download

Water Ripples Water Ripples (OpenGL Demo)
Language: TMT Pascal Multi-target 4.00 (Win32 target)
Originally writtenby
Jan Horn(http://www.sulaco.co.za), 2001
Ported to TMT Pascal by Vadim Bodrov, TMT development Corp., 2002

This is a demo showing the effect of water drops falling into some water.

Keys:
"H" - display the help screen;
"W" - add/remove the floating wedge;
"+/-" - increase and decreases the interval in which drops will fall;
"Space" - adds another drop to the water;
Arrow keys - rotate the scene.

Download

Copyright (c) 1995, 2005
TMT Development Corporation.

Framework Computers, Inc.
All rights reserved.

What's New   Products   Purchase   Samples   Support
FAQ   Contributions   Links   Contact Framework Computers, Inc.   Home

Copyright (c) 1995, 2008
TMT Development Corporation.

Framework Computers, Inc.
All rights reserved.