Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

OpenGL screen saver

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenGL screen saver

    Here is an OpenGL screen saver. On my screen it looks best
    in 1280x1024. Use the up and down arrow-keys.

    Based on the NeHe-tutorial(http://nehe.gamedev.net/) and code from this forum (Semen and Borje).

    Enjoy!
    Peter

    Code:
    #compile exe "scrncube.scr"
    #dim all
    #register none
     
    #include "win32api.inc"
    #include "gl.inc"
    #include "glu.inc"
    #include "glaux.inc"
    #include "glwgl.inc"
     
    '%SX = 640
    '%SY = 480
     
    %SX = 800
    %SY = 600
     
    '%SX = 1024
    '%SY = 768
     
    global hRC as long                             ' Permanent Rendering Context
    global hDC as long                             ' Private GDI Device Context
    global hWnd as long                            ' Holds Our Window Handle
    global hInstance as long                       ' Holds The Instance Of The Application
    global ghParent as long
     
    global keys() as long                          ' Array Used For The Keyboard Routine
    global active as long                          ' Window Active Flag Set To TRUE By Default
    global fullscreen as long                      ' Fullscreen Flag Set To Fullscreen Mode By Default
     
    global xrot as single                          ' X Rotation
    global yrot as single                          ' Y Rotation
    global zrot as single                          ' Z Rotation 
     
    global gz as single   
    global speed as single
     
    global texture as long                         ' Storage For One Texture
     
    global zClassName as asciiz*64
     
    declare sub DoChangePassword()
    declare sub SetupProc(byval hwnd as long)
    declare function ScreenToFile (FileBmp As String) As Long
    declare function Exist(byval Dir as string) as long
    declare sub free(byval adr as dword)
     
    $TempFile = "temp.bmp"
     
    function LoadBMP(byval Filename as string) as long  ' Loads A Bitmap Image
        if Exist(Filename) then function = auxDIBImageLoad(byval strptr(Filename))
    end function
     
    function LoadGLTextures() as long           ' Load Bitmaps And Convert To Textures
     
        local pir as AUX_RGBImageRec pointer
     
        ' Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit
        pir = LoadBMP($TempFile)
        if pir = 0 then exit function
     
        glGenTextures 1, texture             ' Create The Texture
     
        ' Texture Generation Using Data From The Bitmap
        glBindTexture %GL_TEXTURE_2D, texture
     
        glTexParameteri %GL_TEXTURE_2D,%GL_TEXTURE_MIN_FILTER,%GL_LINEAR_MIPMAP_LINEAR
        glTexParameteri %GL_TEXTURE_2D,%GL_TEXTURE_MAG_FILTER,%GL_LINEAR
        gluBuild2DMipmaps %GL_TEXTURE_2D, 3, @pir.sizeX, @pir.sizeY, %GL_RGB, %GL_UNSIGNED_BYTE, @[email protected]
     
        if @pir.ndata then free @pir.ndata
     
        function = 1
     
    end function
     
    %N = 500
     
    function DrawGLScene() as long                  ' Here's Where We Do All The Drawing
     
        local s as single : s = 1
     
        static count as long
     
        glClear %GL_COLOR_BUFFER_BIT or %GL_DEPTH_BUFFER_BIT    ' Clear The Screen And The Depth Buffer
        glLoadIdentity
     
        glTranslatef 0, 0, -1.3 + (count/%N)*(1.3-2.2) + gz
     
        glRotatef xrot,1,0,0                         ' Rotate On The X Axis
        glRotatef yrot,0,1,0                         ' Rotate On The Y Axis
        glRotatef zrot,0,0,1                         ' Rotate On The Z Axis
     
        glBindTexture %GL_TEXTURE_2D, texture     ' Select Our Texture
     
        glBegin %GL_QUADS
            ' Front Face
            glTexCoord2f 0, 0: glVertex3f -s, -s,  s  ' Bottom Left Of The Texture and Quad
            glTexCoord2f s, 0: glVertex3f  s, -s,  s  ' Bottom Right Of The Texture and Quad
            glTexCoord2f s, s: glVertex3f  s,  s,  s  ' Top Right Of The Texture and Quad
            glTexCoord2f 0, s: glVertex3f -s,  s,  s  ' Top Left Of The Texture and Quad
            ' Back Face
            glTexCoord2f s, 0: glVertex3f -s, -s, -s  ' Bottom Right Of The Texture and Quad
            glTexCoord2f s, s: glVertex3f -s,  s, -s  ' Top Right Of The Texture and Quad
            glTexCoord2f 0, s: glVertex3f  s,  s, -s  ' Top Left Of The Texture and Quad
            glTexCoord2f 0, 0: glVertex3f  s, -s, -s  ' Bottom Left Of The Texture and Quad
            ' Top Face
            glTexCoord2f 0, s: glVertex3f -s,  s, -s  ' Top Left Of The Texture and Quad
            glTexCoord2f 0, 0: glVertex3f -s,  s,  s  ' Bottom Left Of The Texture and Quad
            glTexCoord2f s, 0: glVertex3f  s,  s,  s  ' Bottom Right Of The Texture and Quad
            glTexCoord2f s, s: glVertex3f  s,  s, -s  ' Top Right Of The Texture and Quad
            ' Bottom Face
            glTexCoord2f s, s: glVertex3f -s, -s, -s  ' Top Right Of The Texture and Quad
            glTexCoord2f 0, s: glVertex3f  s, -s, -s  ' Top Left Of The Texture and Quad
            glTexCoord2f 0, 0: glVertex3f  s, -s,  s  ' Bottom Left Of The Texture and Quad
            glTexCoord2f s, 0: glVertex3f -s, -s,  s  ' Bottom Right Of The Texture and Quad
            ' Right face
            glTexCoord2f s, 0: glVertex3f  s, -s, -s  ' Bottom Right Of The Texture and Quad
            glTexCoord2f s, s: glVertex3f  s,  s, -s  ' Top Right Of The Texture and Quad
            glTexCoord2f 0, s: glVertex3f  s,  s,  s  ' Top Left Of The Texture and Quad
            glTexCoord2f 0, 0: glVertex3f  s, -s,  s  ' Bottom Left Of The Texture and Quad
            ' Left Face
            glTexCoord2f 0, 0: glVertex3f -s, -s, -s  ' Bottom Left Of The Texture and Quad
            glTexCoord2f s, 0: glVertex3f -s, -s,  s  ' Bottom Right Of The Texture and Quad
            glTexCoord2f s, s: glVertex3f -s,  s,  s  ' Top Right Of The Texture and Quad
            glTexCoord2f 0, s: glVertex3f -s,  s, -s  ' Top Left Of The Texture and Quad
        glEnd
     
        if count < %N then
            incr count
        end if
     
        xrot = xrot + speed*0.3                             ' X Axis Rotation
        yrot = yrot + speed*0.2                             ' Y Axis Rotation
        zrot = zrot + speed*0.4                             ' Z Axis Rotation
     
        function = 1                                ' Everything Went OK
     
    end function
     
    sub ReSizeGLScene(byval nwidth as long, byval nheight as long)      'Resize And Initialize The GL Window
     
        if nheight = 0 then nheight = 1             'Prevent A Divide By Zero By
     
        glViewport 0, 0, nwidth, nheight            ' Reset The Current Viewport
     
        glMatrixMode %GL_PROJECTION                 ' Select The Projection Matrix
        glLoadIdentity                              ' Reset The Projection Matrix
     
        ' Calculate The Aspect Ratio Of The Window
        gluPerspective 45, nwidth / nheight, 0.1,100.0
     
        glMatrixMode %GL_MODELVIEW                  ' Select The Modelview Matrix
        glLoadIdentity                              ' Reset The Modelview Matrix
     
    end sub
     
    function InitGL() as long                       ' All Setup For OpenGL Goes Here
     
        if LoadGLTextures() = 0 then exit function  ' Jump To Texture Loading Routine ( NEW )
        glEnable %GL_TEXTURE_2D                     ' Enable Texture Mapping ( NEW )
     
        glShadeModel %GL_SMOOTH
        glClearColor 0.6, 0.7, 0.8, 0
        glClearDepth 1
        glEnable %GL_DEPTH_TEST
        glDepthFunc %GL_LEQUAL
     
        glHint %GL_PERSPECTIVE_CORRECTION_HINT, %GL_NICEST
        glHint %GL_POINT_SMOOTH_HINT, %GL_NICEST
        glHint %GL_LINE_SMOOTH_HINT, %GL_NICEST
     
        function = 1
     
    end function
     
    sub KillGLWindow()                              ' Properly Kill The Window
     
        if fullscreen then
            ChangeDisplaySettings byval %NULL, 0    ' If So Switch Back To The Desktop
            ShowCursor %TRUE
        end if
     
        if hRC then
            if wglMakeCurrent(byval %NULL, byval %NULL) = 0 then
                msgbox "Release Of DC And RC Failed.", %MB_OK or %MB_ICONINFORMATION, "SHUTDOWN ERROR"
            end if
     
            if wglDeleteContext(hRC) = 0 then
                msgbox "Release Rendering Context Failed.", %MB_OK or %MB_ICONINFORMATION, "SHUTDOWN ERROR"
            end if
     
            hRC = 0
         
        end if
     
        if hDC and (ReleaseDC(hWnd,hDC) = 0) then
            msgbox "Release Device Context Failed.", %MB_OK or %MB_ICONINFORMATION, "SHUTDOWN ERROR"
            hDC = 0
        end if
     
    
        if hWnd and (DestroyWindow(hWnd) = 0) then
            msgbox "Could Not Release hWnd.", %MB_OK or %MB_ICONINFORMATION, "SHUTDOWN ERROR"
            hWnd = 0
        end if
     
        if UnregisterClass(zClassName, hInstance) = 0 then
            msgbox "Could Not Unregister Class.", %MB_OK or %MB_ICONINFORMATION, "SHUTDOWN ERROR"
            hInstance = 0
        end if
     
        kill $TempFile
     
    end sub
     
    function WndProc(byval hWnd as long, byval uMsg as long, byval wParam as long, byval lParam as long) as long
     
        select case uMsg
            case %WM_CREATE
                if fullscreen then
                    SetCursor %NULL        
                end if
                exit function
         
            case %WM_SYSCOMMAND
                if wParam = %SC_CLOSE or wParam = %SC_SCREENSAVE then exit function
      
            case %WM_ACTIVATE
                if HIWRD(wParam) = 0 then             ' Check Minimization State
                    active = %TRUE
                else
                    active = %FALSE
                end if
                exit function
     
            case %WM_SYSCOMMAND
                select case wParam
                    case %SC_SCREENSAVE', %SC_MONITORPOWER  ' Screensaver Trying To Start? Monitor Trying To Enter Powersave?
                        exit function
                end select
                exit function
     
            case %WM_CLOSE
                PostQuitMessage 0
                exit function
     
            case %WM_KEYDOWN
                keys(wParam) = %TRUE
                exit function
     
            case %WM_KEYUP
                keys(wParam) = %FALSE
                exit function
     
            case %WM_SIZE                             ' Resize The OpenGL Window
                ReSizeGLScene LOWRD(lParam), HIWRD(lParam)       ' LoWord=Width, HiWord=Height
                exit function
     
        end select
     
        function = DefWindowProc(hWnd,uMsg,wParam,lParam)
     
    end function
     
    function CreateGLWindow(byval title as string, byval nwidth as long, byval nheight as long, byval bits as long, byval fullscreenflag as long) as long
     
        local PixelFormat as long                    ' Holds The Results After Searching For A Match
        local wc as WNDCLASS
     
        local dwExStyle as long
        local dwStyle as long
     
        local WindowRect as RECT
        WindowRect.nleft  = 0
        WindowRect.nright = nwidth
        WindowRect.ntop   = 0
        WindowRect.nbottom= nheight
     
        fullscreen = fullscreenflag
     
        zClassName = "OpenGL"
        hInstance        = GetModuleHandle(BYVAL %NULL)
    '    wc.style         = %CS_HREDRAW or %CS_VREDRAW or %CS_OWNDC ' Redraw On Move, And Own DC For Window
        wc.lpfnWndProc   = codeptr(WndProc)
        wc.cbClsExtra    = 0
        wc.cbWndExtra    = 0
        wc.hInstance     = hInstance
    '    wc.hIcon         = LoadIcon(%NULL, byval %IDI_WINLOGO)
    '    wc.hCursor       = LoadCursor(%NULL, byval %IDC_ARROW)
        wc.hbrBackground = %NULL
        wc.lpszMenuName  = %NULL
        wc.lpszClassName = varptr(zClassName)
     
        if RegisterClass(wc) = 0 then
            msgbox "Failed To Register The Window Class.", %MB_OK or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        if fullscreen then
     
            local dmScreenSettings as DEVMODE                       ' Device Mode
     
            dmScreenSettings.dmSize       = sizeof(dmScreenSettings)
            dmScreenSettings.dmPelsWidth  = nwidth
            dmScreenSettings.dmPelsHeight = nheight
            dmScreenSettings.dmBitsPerPel = bits                    ' Selected Bits Per Pixel
            dmScreenSettings.dmFields     = %DM_BITSPERPEL or %DM_PELSWIDTH or %DM_PELSHEIGHT
     
            ' Try To Set Selected Mode And Get Results.  NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
            if ChangeDisplaySettings(dmScreenSettings, %CDS_FULLSCREEN) <> 0 then    '%DISP_CHANGE_SUCCESSFUL
                ' If The Mode Fails, Offer Two Options.  Quit Or Run In A Window.
                if msgbox("The Requested Fullscreen Mode Is Not Supported By" + $cr + "Your Video Card. Use Windowed Mode Instead?", %MB_YESNO or %MB_ICONEXCLAMATION, "") = %IDYES then
                    fullscreen = %FALSE
                else
                    ' Pop Up A Message Box Letting User Know The Program Is Closing.
                    msgbox "Program Will Now Close.", %MB_OK or %MB_ICONSTOP, "ERROR"
                    exit function
                end if
            end if
        end if
     
        if fullscreen then                                           ' Are We Still In Fullscreen Mode?
            dwExStyle = %WS_EX_APPWINDOW
            dwStyle   = %WS_POPUP
            ShowCursor %FALSE
        else
            dwExStyle = 0                     '%WS_EX_APPWINDOW or %WS_EX_WINDOWEDGE
            dwStyle   = %WS_CHILD             '%WS_OVERLAPPEDWINDOW
        end if
     
        AdjustWindowRectEx WindowRect, dwStyle, %FALSE, dwExStyle    ' Adjust Window To True Requested Size
     
        hWnd = CreateWindowEx(dwExStyle, _
                        zClassName, _
                        byval strptr(title), _
                        %WS_CLIPSIBLINGS or %WS_CLIPCHILDREN or  _
                        dwStyle, _
                        0, 0, _
                        WindowRect.nright-WindowRect.nleft, _
                        WindowRect.nbottom-WindowRect.ntop, _
                        ghParent, _
                        byval %NULL, _
                        hInstance, _
                        byval %NULL)
     
        if hWnd = 0 then
            KillGLWindow
            msgbox "Window Creation Error.", %MB_OK or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        static pfd as PIXELFORMATDESCRIPTOR
     
        pfd.nSize = Len(PIXELFORMATDESCRIPTOR)
        pfd.nVersion = 1
        pfd.dwFlags = %PFD_DRAW_TO_WINDOW or %PFD_SUPPORT_OPENGL or %PFD_DOUBLEBUFFER
        pfd.iPixelType = %PFD_TYPE_RGBA
        pfd.cColorBits = bits
        pfd.cRedBits = 0
        pfd.cRedShift = 0
        pfd.cGreenBits = 0
        pfd.cGreenShift = 0
        pfd.cBlueBits = 0
        pfd.cBlueShift = 0
        pfd.cAlphaBits = 0
        pfd.cAlphaShift = 0
        pfd.cAccumBits = 0
        pfd.cAccumRedBits = 0
        pfd.cAccumGreenBits = 0
        pfd.cAccumBlueBits = 0
        pfd.cAccumAlphaBits = 0
        pfd.cDepthBits = 16
        pfd.cStencilBits = 0
        pfd.cAuxBuffers = 0
        pfd.iLayerType = %PFD_MAIN_PLANE
        pfd.bReserved = 0
        pfd.dwLayerMask = 0
        pfd.dwVisibleMask = 0
        pfd.dwDamageMask = 0
      
        hDC=GetDC(hWnd)
        if hDC = 0 then
            KillGLWindow
            msgbox "Can't Create a GL Device Context.", %MB_OK  or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        PixelFormat = ChoosePixelFormat(hDC, pfd)
        if PixelFormat = 0 then
            KillGLWindow
            msgbox "Can't Find A Suitable PixelFormat.", %MB_OK  or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
    
        if SetPixelFormat(hDC, PixelFormat, pfd) = 0 then
            KillGLWindow
            msgbox "Can't Set The PixelFormat.", %MB_OK or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        hRC = wglCreateContext(hDC)
        if hRC = 0 then
            KillGLWindow
            msgbox "Can't Create a GL Rendering Context.", %MB_OK or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        if wglMakeCurrent(hDC,hRC) = 0 then                          ' Try To Activate The Rendering Context
            KillGLWindow
            msgbox "Can't Activate The GL Rendering Context.", %MB_OK or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        ShowWindow hWnd, %SW_SHOW
        SetForegroundWindow hWnd                                     ' Slightly Higher Priority
        SetFocus hWnd
        ReSizeGLScene nwidth, nheight
     
    
        if InitGL = 0 then
            KillGLWindow
            msgbox "Initialization Failed.", %MB_OK or %MB_ICONEXCLAMATION, "ERROR"
            exit function
        end if
     
        function = 1
     
    end function
     
    function pbmain
     
        local msg as tagMSG
        local done as long : done = %FALSE                            ' Bool Variable To Exit Loop
        local r as RECT
     
        ' Initialize
        redim keys(256)
        active     = %TRUE
        fullscreen = %TRUE
        speed = 0.4
      
        if instr(command$, ANY "aA") then         'Change Password
            ghParent = val(trim$(mid$(command$, 4))) 'Get hWnd for pw dialog
            DoChangePassword
            function = 0: exit function
         
        elseif instr(command$, ANY "pP") then     'Preview window
            fullscreen  = %FALSE
            ghParent = VAL(TRIM$(MID$(command$, 4)))
     
        elseif instr(command$, ANY "cC") then     'Setup dialog       
            setupProc VAL(TRIM$(MID$(command$, 4)))
            FUNCTION = 0: EXIT FUNCTION
         
        elseif instr(command$, ANY "sS") then     'Full screen saver
            ghParent = %HWND_DESKTOP
        else
            exit function
        end if
       
        ScreenToFile $TempFile
     
        ' Create Our OpenGL Window
        if fullscreen then
            if CreateGLWindow("",%SX,%SY,32,fullscreen) = 0 then
                exit function
            end if
        else
            GetWindowRect ghParent, r
            if CreateGLWindow("",r.nRight - r.nLeft,r.nBottom - r.nTop,32,fullscreen) = 0 then
                exit function
            end if
        end if
     
        while done = 0
     
            if PeekMessage(msg,%NULL,0,0,%PM_REMOVE) then             ' Is There A Message Waiting?
     
                if msg.message = %WM_QUIT then                        ' Have We Received A Quit Message?
                    done = %TRUE                                      ' If So done=TRUE
                else                                                  ' If Not, Deal With Window Messages
                    TranslateMessage msg                              ' Translate The Message
                    DispatchMessage msg                               ' Dispatch The Message
                end if
            else                                                      ' If There Are No Messages
                ' Draw The Scene.  Watch For ESC Key And Quit Messages From DrawGLScene()
                if active then                                        ' Program Active?
     
                    if keys(%VK_ESCAPE) then                          ' Was ESC Pressed?
                        done = %TRUE                                  ' ESC Signalled A Quit
                    elseif keys(%VK_SPACE) then 
                        done = %TRUE                                  ' ESC Signalled A Quit
     
                    else                                              ' Not Time To Quit, Update Screen
                        DrawGLScene                                   ' Draw The Scene
                        SwapBuffers hDC                               ' Swap Buffers (Double Buffering)
     
                        if keys(%VK_UP) then gz = gz + 0.02
                        if keys(%VK_DOWN) then gz = gz - 0.02               
     
                    end if
                end if
     
                if keys(%VK_F1) then                                  ' Is F1 Being Pressed?
                    keys(%VK_F1) = %FALSE                             ' If So Make Key FALSE
                    KillGLWindow                                      ' Kill Our Current Window
                    if fullscreen then
                        fullscreen = %FALSE
                    else
                        fullscreen = %TRUE
                    end if
     
                    ' Recreate Our OpenGL Window
                    if CreateGLWindow("",%SX,%SY,32,fullscreen) = 0 then
                        exit function                                ' Quit If Window Was Not Created
                    end if
                end if
            end if
        wend
     
        ' Shutdown
        KillGLWindow                                                 ' Kill The Window
        function = msg.wParam                                        ' Exit The Program
     
    end function
     
    sub DoChangePassword()
        msgbox "Not implemented yet",,"ChangePassword"
    end sub
     
    
    sub SetupProc(byval hwnd as long)
        msgbox "Not implemented yet",,"Setup"
    end sub
     
    Function ScreenToFile (FileBmp As String) As Long
     
       Local f As Long, hDC As Long, hMemDC As Long
       Local hMemBmp As Long, bm As BITMAP, bmi As BITMAPINFO
       Local lpBITMAPFILEHEADER As BITMAPFILEHEADER, lpBITMAPINFOHEADER As BITMAPINFOHEADER
        
       hDC = GetDC(0): hMemDC = CreateCompatibleDC (hDC)
        
       bmi.bmiHeader.biSize = SizeOf(bmi.bmiHeader)
       bmi.bmiHeader.biWidth = GetSystemMetrics(%SM_CYSCREEN)
       bmi.bmiHeader.biHeight = GetSystemMetrics(%SM_CYSCREEN)
       bmi.bmiHeader.biPlanes = 1
       bmi.bmiHeader.biBitCount = 24
       bmi.bmiHeader.biCompression = %BI_RGB
       hMemBmp = CreateDIBSection(hMemDC, bmi, %DIB_RGB_COLORS, 0, 0, 0)
     
       GlobalLock hMemBmp
       SelectObject hMemDC, hMemBmp
       GetObject hMemBmp, SizeOf(bm), bm
       StretchBlt hMemDC, 0, 0, GetSystemMetrics(%SM_CYSCREEN), GetSystemMetrics(%SM_CYSCREEN), hDC, 0, 0, GetSystemMetrics(%SM_CYSCREEN), GetSystemMetrics(%SM_CYSCREEN), %SRCCOPY
        
       lpBITMAPFILEHEADER.bfType = Cvi("BM")
       lpBITMAPFILEHEADER.bfSize = Len(lpBITMAPFILEHEADER) + Len(lpBITMAPINFOHEADER) + _
          bm.bmWidthBytes * bm.bmHeight
       lpBITMAPFILEHEADER.bfOffBits = 54
       lpBITMAPINFOHEADER.biSize = 40
       lpBITMAPINFOHEADER.biWidth = bm.bmWidth
       lpBITMAPINFOHEADER.biHeight = bm.bmHeight
       lpBITMAPINFOHEADER.biPlanes = 1
       lpBITMAPINFOHEADER.biBitCount = 24
       lpBITMAPINFOHEADER.biSizeImage = 54& + bm.bmWidthBytes * bm.bmHeight
     
       
       f = FreeFile: Open FileBmp For Output As #f
       Print #f, lpBITMAPFILEHEADER lpBITMAPINFOHEADER _
           Peek$(bm.bmBits, bm.bmWidthBytes * bm.bmHeight);: Close #f
     
       ReleaseDC 0, hDC: DeleteDC hMemDC: GlobalUnlock hMemBmp: DeleteObject hMemBmp
     
    End Function
     
    function Exist(byval Dir as string) as long
        local wfd as WIN32_FIND_DATA
        function = not (FindFirstFile(Dir & chr$(0), wfd) = %INVALID_HANDLE_VALUE)
    end function
     
    sub free(byval adr as dword)
        GlobalFree adr
    end sub
    ------------------
    [email protected]



    [This message has been edited by Peter P Stephensen (edited February 04, 2002).]
    [email protected]
    www.dreammodel.dk
Working...
X