../images/Glax.jpg

An ActiveX control implementing
OpenGL 1.1
(with parts of glut and glaux added)

 

What does it?

The control provides a straight wrapper of the OpenGL-Api intended for use with Visual Basic.

News

If have added examples that implement the GLPaperplane example as a standard VB project
and an OCX control.

Paperplane.JPG (16351 bytes)

You can download the source code here: paperplane.zip

 

Events

The control has only to important events:

The Opengl context is set up properly, when these events are fired.
Don't call these funtion directly; if you want to redraw the control
use the function Refresh

Data Types

OpenGL Visual Basic
Glenum Long
Glboolean Byte
Glbyte Byte
Glshort Integer
Glint Long
Glsizei Long
Glubyte =Byte
Glushort =Integer
Gluint =Long
Glfloat Single
Glclampf Single
Gldouble Double
Glclampd Double
Glvoid =>Interface VoidPointer

 

Arrays

Additional Functions

Properties

special things

  1. wglMakeVoidPointer(GLenum type, v1() As Variant)
    This takes the data type along with an array of Variants with your data  as arguments
    Example:
        Dim dp as VoidPointer
        Set dp= GlaxCtl1.wglMakeVoidPointer _
            (GL_DOUBLE, myArrayofVariantdouble)

  2. MakeVoidPointerFromPointer(GLenum type, datapointer as Long, data() as Variant)
    This one is needed for callback functions returning a "naked" data pointer.
    The function converts the data pointed into an array of variants data while returning
    a VoidPointer for further use of the data.
    Example:
        Dim pData as VoidPointer
        Set pData = Form1.GLaxCtl3.MakeVoidPointerFromPointer _
            (GL_DOUBLE, datapointer, data)

  3. There is now a wrapper for auxDIBImageLoad() called DIBImageLoad() to load DIB images. The use is straightforward:
        Dim vp As VoidPointer
        Dim cx As Long, cy As Long ' image extent
        Set vp = .DIBImageLoad("your.bmp", cx, cy)
        .glPixelStorei GL_UNPACK_ALIGNMENT, 1
        .glDrawPixels cx, cy, GL_RGB, GL_UNSIGNED_BYTE, vp

known problems:

Control and an example program (Visual Basic 6):

Source only:

License Agreement:


Last change on 11/01/01 by K. M. Syring

Click Here!