Recent Posts

Pages: [1] 2 3 ... 10
1
GLBasic - en / Re: GLBasic pointer question
« Last post by nabz32 on Yesterday at 08:53 pm »
I tried to create a class in inline, which compiles without errors,

I can create an object of it in INLINE,
and also create a DGArray of the class type.

But when I try to use DIMPUSH() on the DGArray in INLINE, I get countless errors suddenly.

Here is the Global INLINE Code:
Code: GLBasic [Select]
INLINE
        class SEdgeC{
                private:
                        DGInt x;
                        DGInt y;
                        SEdgeC* nextEdge;
                public:
                        SEdgeC( DGInt xN , DGInt yN );
                        SEdgeC* getNextEdge();
                        void addNewEdge(DGInt x , DGInt y );
                        void deleteAll();
        };
        SEdgeC::SEdgeC( DGInt xN , DGInt yN ){
                x = xN;
                y = yN;
                nextEdge = NULL;               
        }
        SEdgeC* SEdgeC::getNextEdge(){
                return nextEdge;
        }
        void SEdgeC::deleteAll(){
                if( nextEdge != NULL ){
                        nextEdge->deleteAll(); 
                }
                delete this;           
        }
        void SEdgeC::addNewEdge( DGInt xN , DGInt yN ){
                if( nextEdge != NULL ){
                        nextEdge->addNewEdge( xN , yN ); // add nextEdge to my nextEdge, if I allready have one
                } else nextEdge = new SEdgeC( xN , yN );        // if not then finally create the new edge
        }
        DGArray<SEdgeC> Sectors;
ENDINLINE
 

and the local INLINE code I used in my main function:
Code: GLBasic [Select]
INLINE
SEdgeC start( 0 , 0 );
start.addNewEdge( 0 , 0 );
ENDINLINE
 

this is all working, but when I call
Code: GLBasic [Select]
INLINE
DIMPUSH(Sectors,start);
ENDINLINE

I get tons of weird errors, telling me that every statement in the INLINE class is faulty.
2
GLBasic - en / Re: GLBasic pointer question
« Last post by nabz32 on 2017-Jul-24 »
thanks Schranz0r,

pretty good news for me  :good:

A small example would be greatly appreciated
3
GLBasic - en / Re: GLBasic pointer question
« Last post by Schranz0r on 2017-Jul-24 »
You can use INLINE and put a List into a DGArray, return the Index of it and u can use it in types without having problems.

Fun-Fact:
I've managed to put a wrapper of a c++ Class into a GLBasic Type... it was a try and it works perfectly :)
You can try to wrapp the Linked List into a GLB-TYpe.

I can try to send you an example later today.
4
Announcements / Re: Burguer stuff
« Last post by nabz32 on 2017-Jul-23 »
Very nice,

great work erico :good:
5
GLBasic - en / GLBasic pointer question
« Last post by nabz32 on 2017-Jul-23 »
Hello again,

only a small question, is it possible to build a linked list
in glbasic, something like:

Code: GLBasic [Select]
TYPE element

*element // store the next element in the list..

ENDTYPE
 

And then check if this Pointer is NULL?

Or is ist possible to access a c class inside the GLBasic code, without using EXTERN "C" all the time?
Having the abillity to write a linked list in GLBasic would be awesome.

6
Announcements / Re: Burguer stuff
« Last post by erico on 2017-Jul-22 »
Id love to have the ninja brocolli but it is just not working out :( strive on)
7
Math / Re: Bezier curves / Splines - through points
« Last post by Ian Price on 2017-Jul-21 »
That might come in very handy at some point. Cheers Gernot. Nice to see you about BTW :)
8
Announcements / Re: Burguer stuff
« Last post by Ian Price on 2017-Jul-21 »
Looks like a lot of fun :)
9
Math / Bezier curves / Splines - through points
« Last post by Kitty Hello on 2017-Jul-21 »
With Hemlos' lib you can interpolate spline curves, if you know the control points. http://www.glbasic.com/forum/index.php?topic=3839.msg28012#msg28012
I continued this and will generate the control points for a polygonal line, so the curve touches all your input points in order.

See the example - just click points with your mouse, the spline will be generated interactively.

It's very useful to generate racing tracks or curves for cars that follow a route.
10
I think not too long ago I read a very similar problem on the forum, will try to find out and let you know.
Pages: [1] 2 3 ... 10