Skip to content

Misc issues #5

@fafalone

Description

@fafalone

I'm looking to test this in VB6/tB and a number of issues are coming up. I'm not sure if all of these are wrong so bear with me:

  1. End Property and End Sub missing in interface classes (IBufferIndex, I...) - This is accepted while in the IDE but VB6/tB cannot compile to binary.

  2. VBGLContext.cls: Public Sub SetTimerFunc(ByVal Pointer As LongPtr): Call glutTimerFunc(Pointer): End Sub

Your prototype expects 3 arguments in glutTimerProc, none of which are marked Optional. The function pointer is the 2nd argument.

  1. VBGLContext.cls
Public Function GetCullFace() As Long
    CullFace = p_CullFace
End Function
Public Function GetFrontFace() As Long
    FrontFace = p_FrontFace
End Function

in keeping with the similar functions this appears it should be a return? GetCullFace = and GetFrontFace =

  1. VBGLContext.cls
Public Sub ClearColor(Optional ByVal r As Single = 0, Optional ByVal g As Single = 0, Optional ByVal b As Single = 0, Optional ByVal a As Single = 1)
    Call glClearColor(r, g, b, a)
End Sub

Public Sub ClearColorArr(ByRef Arr() As Single)
    Dim Size As Long
    Size = USize(Arr)
    Select Case Size
        Case 0: Call glClearColor(Arr(0))
        Case 1: Call glClearColor(Arr(0), Arr(1))
        Case 2: Call glClearColor(Arr(0), Arr(1), Arr(2))
        Case 3: Call glClearColor(Arr(0), Arr(1), Arr(2), Arr(3))
    End Select
End Sub

It appears ClearColorArr should be calling ClearColor rather than glClearColor directly, since its arguments are not optional.

  1. VBDualGrid.cls
Public Function CreateFromFile(ByVal FilePath As String) As VBGLDualGrid
    Dim Manager As VBGLTextureManager
    Set Manager = VBGLTextureManager.Create(VBGLTextureMergerGrid.Create(False))
    Manager.Flip = True
    Call Manager.LoadFromFileArr(FolderPath, _
                                TilesPerSprite, _
                                VBGLTextureManagerHelperSetUp.VBGLTextureManagerHelperSetUpGrid, _
                                TypeTypeString)
    Dim Texture As VBGLTexture
    Set Texture = Manager.CreateTexture(TextureFactory(Manager), "DualGrid", Empty)

    Set CreateFromFolder = Create(Texture)
End Function

It appears to need FilePath instead of FolderPath in Call Manager... and the return should be CreateFromFile, and .LoadFromFileArr expects 5 arguments.

  1. VBDualGrid.cls -> Update uses a commented out var and also has a call with incorrect arg count.

  2. VBGLUniforms.cls - SetVecI converts a Long array to a Single array then tries to use that with glUniform1iv etc which expect Long (GLint)

  3. VBGLShaderWorkflow.cls - VBGLIShaderElement_GetVariableAll calls VBGLIShaderElement_GetVariableCall without the argument it expects

  4. VBGLSubTexture.cls - CreateFromPattern sets CreateFromArray like it's the function name for a return value

  5. VBGLTextureManagerHelper.cls - In AddName, p_NamesName is an unrecognized symbol and VBGLAdd expects 2 args

  6. VBGLWindow.cls - In GetWindowHwnd, glutGetWindowHwnd is undefined (presumably should be glutGetWindow)

PS- It's done a little differently, using delegates/aliases that preserve original types, but it may be easier than doing it from C if you want the declares for the EXT functions: https://github.com/fafalone/WinDevLib/blob/main/Export/Sources/wdGL.twin#L6299

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions