Hi Kent,
in TBGL_GBufferCreate you specify if buffer is 2D or 3D. Then the TBGL_GBufferDefineFromArray presumes 2f or 3f accordingly. I parse just pointer to whatever is passed there, so type does not matter.
Petr
Petr, I was wondering how you handled different parameter values, like vec2f or vec3f and rgb or rgba in TBGL_GBufferDefineFromArray
without function overloading?
Thanks for any tips.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Hi Kent,
in TBGL_GBufferCreate you specify if buffer is 2D or 3D. Then the TBGL_GBufferDefineFromArray presumes 2f or 3f accordingly. I parse just pointer to whatever is passed there, so type does not matter.
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
In pure thinBASIC, you can go polymorphic with passing parameter as UDT this way:
uses "TBGL", "Console" dim arr2d(3) as tbgl_tVector2f dim arr3d(3) as tbgl_tVector3f TellMeWhatItIs(arr2d) TellMeWhatItIs(arr3d) waitkey function TellMeWhatItIs(byref x() as any) select case sizeOf(x(1)) case sizeOf(tbgl_tVector2f) printl "It is 2D!" case sizeOf(tbgl_tVector3f) printl "It is 3D!" case else printl "I am dazed and confused" end select end function
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Thanks Petr.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks