C++ and TGB
by robyone13 · in Torque Game Builder · 01/28/2010 (6:12 am) · 8 replies
Hello everyone.
I'd like to know how to add a simple C++ program (edge detection) to a TGB simple game.
I got all the resource files in my TGB folder but I don't know how to properly use them. Do I have to add the .cpp file in there?
I got no ideas.
Thank you
I'd like to know how to add a simple C++ program (edge detection) to a TGB simple game.
I got all the resource files in my TGB folder but I don't know how to properly use them. Do I have to add the .cpp file in there?
I got no ideas.
Thank you
About the author
#2
What if I used for the C++ program an addictional library with a lot of .h and .cpp? Do I have to add everything?
My program gives back a matrix of 0 and 255 that gives the edge detection for every pixel. How can I use this matrix in TGB
Thanks
01/28/2010 (7:09 am)
Thanks for the answer.What if I used for the C++ program an addictional library with a lot of .h and .cpp? Do I have to add everything?
My program gives back a matrix of 0 and 255 that gives the edge detection for every pixel. How can I use this matrix in TGB
Thanks
#3
As for using the matrix... take a look at math/mMatrix.h and mMatrix.cc. That is where the MatrixF class is defined that is used in TGB and should be a great place for you to start reading up on how to use your matrixes within the engine, as you will need to convert the matrix from your code into the mMatrix format for the TGB engine to recognize it.
01/28/2010 (7:24 am)
You'll have to add all of the files to build the functionality into the engine. Either that, or integrate the code that is in those files into the appropriate places within the TGB engine.As for using the matrix... take a look at math/mMatrix.h and mMatrix.cc. That is where the MatrixF class is defined that is used in TGB and should be a great place for you to start reading up on how to use your matrixes within the engine, as you will need to convert the matrix from your code into the mMatrix format for the TGB engine to recognize it.
#4
01/28/2010 (7:45 am)
robyone13, your user profile info doesn't show a license for TGB pro. If you want to make C++ code changes (add C++ resources for example), you'll need to buy that pro version.
#5
Anyway, since the matrix is stored in a .txt file, I think I'm gonna read directly the .txt file without the need of mixing together the C++ and the TGB.
This will surely be much more easier!!
Thank you!
01/28/2010 (7:55 am)
It doesn't show anything since I haven't wrote anything in my user profile.Anyway, since the matrix is stored in a .txt file, I think I'm gonna read directly the .txt file without the need of mixing together the C++ and the TGB.
This will surely be much more easier!!
Thank you!
#6
01/28/2010 (8:39 am)
Quote:It doesn't show anything since I haven't wrote anything in my user profile.It doesn't show anything because you didn't buy any GG products - at least not with this account I guess.
#7
Bye bye
01/28/2010 (10:24 am)
Everything I have comes from my university in Italy, My lab bought book and stuff, I haven't bought anything BY MYSELF!!Bye bye
#8
01/28/2010 (11:25 am)
Please login with your student account that has access to the engine.
Associate Dave Calabrese
Cerulean Games