Back home Graphics using Open GL RapidQ can only directly support OpenGL 1.1 - 1.3 specification. Support for ARB extensions is provided by via FreeBasic DLL (see below). At right I use an include file (QGL.inc) to help generate the graphics on a QForm. The 3D box with a texture map that rotates in fog. Also the GUI allows you to see 2D and a gluSphere object . It shows how you can draw to several Windows 'device contexts' like a QCanvas and a QBitMap. There are many tutorials on how to use OpenGL, The easiest way to learn is just play with some simple examples and then you will get the idea. RapidQ Source code: GL include files: Download OpenGL programs (2.2M) |
|
Here
is RapidQ2 and a FreeBasic DLL to run OpenGL shader
language. The FB DLL sets up the OpenGL ARB extensions. The pixels
of the rendered image placed into an RQ QbitmapEx. The program
will let you record an AVI movie of the rendering at 60 Hz frame
rate. Drag and drop glsl and texture files and it will auto
reload. The GL shader code comes from ShaderToy. Check it out for some really incredible 3D raytracing /raymarching rendering. Thanks to DJ Peters for sharing the OpenGL ARB code This zip includes the source code, examples, textures, and binary builds if you are too lazy to compile yourself. GLSL_Demo.zip |
|
Open
GL particle generator Open GL allows alphablending for producing 'particles.' In this example, a little blur spot is painted all over (like sprites) the screen, but they have semi-transparent portions. The particles move to produce a rocket ship like fire blast. Read the code to see how key presses make the particles change. RapidQ Source code: Download OpenGL programs (2.2M) |
|
MD2
Quake 3D model animation, and animation set. This is a port of the FreeBasic MD2 viewer. This version loads quicker, views the entire animation, but renders kind of slow MDviewer This version takes a long time to load BUT, you can render the part of the whole animation fast (> 30 frames/second) by storing the OpenGL commands in a display list. The speed difference is amazing. If you know what you are doing you can make a total replication of the QD3DScreen component in RapidQ using OpenGL, including QD3DanimationSet MD_animation Download OpenGL programs (2.2M) |