Using GLLines in TUpdatingMesh

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Using GLLines in TUpdatingMesh

Phua Khai Fong

I have a problem using the mode GLLines in a subclass of TUpdatingMesh. There is an error when I use it and the debugger shows the error in the below method :-

primCount: indexCount forMode: mode

    mode == GLTriangles ifTrue: [^ indexCount // 3].
    mode == GLQuads ifTrue: [^ indexCount // 4].
    mode == GLPoints ifTrue: [^ indexCount].
    mode == GLTriangleStrip ifTrue: [^ indexCount - 2].
    mode == GLTriangleFan ifTrue: [^ indexCount - 2].
    mode == GLLineStrip ifTrue: [^ indexCount - 1].
    "It's easy to add additional modes if necessary."
    self error: 'Unexpected mode'.
    ^ 0

The above method belongs to the OpenGL. I can add in another line :-

mode == GLLines ifTrue: [^indexCount // 2].

With the above line added, it works fine. My question is what can I do to have the mode permanently there if I publish my work using the Monticello package?