looking for conversions tge 1.5.1-->tgea 1.8.1
by Mike Rowley · in Torque Game Engine Advanced · 05/02/2009 (10:53 am) · 8 replies
Attempting to keep the conversion thread clean, I'll post this question here.
I'm looking to convert the following code from tge to tgea. Does anyone know the conversions?
If anyone has the answers, I can add them to the other thread so people have 1 place to look for the conversions.
Thanks.
I'm looking to convert the following code from tge to tgea. Does anyone know the conversions?
Point3F box;
box = (mObjBox.min + mObjBox.max) * 0.5;
glTranslatef(box.x,box.y,box.z);
box = (mObjBox.max - mObjBox.min) * 0.5;
glScalef(box.x,box.y,box.z);
wireCube(Point3F(1,1,1),Point3F(0,0,0));
I know this one, but can't find it at the moment:
dglMultMatrix(&mat);If anyone has the answers, I can add them to the other thread so people have 1 place to look for the conversions.
Thanks.
#2
05/02/2009 (1:03 pm)
Cleaver deepscratch, you get a cookie!
#3
cookie++
05/02/2009 (1:20 pm)
I have 1.7.1 installed. I never thought of doing a search thru it's code. Thankyou. :-) cookie++
#5
Using the advice above, (thankyou sooooo much) I have found most of the conversions needed. (again, thankyou.) but the closest thing I can find for
The rest I have no clue.
05/16/2009 (5:15 pm)
Well, I'm back. I have searched for the past 3 days for the following:dglDrawText(mProfile->mFont, offset, buf); dglDrawBitmap(mTextureHandle, renderPos); dglDrawBitmapRotated(mTextureHandle, renderPos, angle);
Using the advice above, (thankyou sooooo much) I have found most of the conversions needed. (again, thankyou.) but the closest thing I can find for
dglDrawText(mProfile->mFont, offset, buf);in 1.7.1 is
object->setTextLine(dAtoi(argv[2]), argv[3], setColor ? &color : NULL);Would I be right to make it:
object->setTextLine(mProfile->mFont, offset, buf);??
The rest I have no clue.
#6
"dglDrawBitmap(mTextureHandle, renderPos);"
try
"GFX->getDrawUtil()->drawBitmap(texture, rect);"
05/17/2009 (10:38 am)
for"dglDrawBitmap(mTextureHandle, renderPos);"
try
"GFX->getDrawUtil()->drawBitmap(texture, rect);"
#7
For the rotated bitmap, I'm trying
GFX->getDrawUtil()->drawBitmapRotated(texture, rect, angle);" // **** trying this to see if it works.
I don't know why I asked about:
dglDrawText(mProfile->mFont, offset, buf);
I already had it converted.
GFX->getDrawUtil()->drawText(mProfile->mFont, offset, buf);
Well, at least that should take care of 2 more files. :-)
Thankyou for your help.
05/17/2009 (11:02 am)
Thankyou. :-)For the rotated bitmap, I'm trying
GFX->getDrawUtil()->drawBitmapRotated(texture, rect, angle);" // **** trying this to see if it works.
I don't know why I asked about:
dglDrawText(mProfile->mFont, offset, buf);
I already had it converted.
GFX->getDrawUtil()->drawText(mProfile->mFont, offset, buf);
Well, at least that should take care of 2 more files. :-)
Thankyou for your help.
#8
05/17/2009 (11:22 am)
8o)
Torque Owner deepscratch
DeepScratchStudios
if you have 1.8.1, then you have 1.7.1.
so
download 1.7.1, and open the engine with VC, and type those lines into the search box, you'll find most, if not all of them in one or other file, commented out, with the new gfx equivilent right underneath.
thats what I do when I begin any port from tge to tgea, and I've done a lot of porting.
heres a few conversions that I found by using that technique
glDisable(GL_LIGHTING); = GFX->setLightingEnable(false);
glDisable(GL_DEPTH_TEST); = GFX->setZWriteEnable(false);
glPushMatrix(); = GFX->pushWorldMatrix();
dglMultMatrix(&getRenderTransform()); = GFX->multWorld(getRenderTransform());
glColor3f(1, 0, 0); = PrimBuild::color3f(1, 0, 0);
glLineWidth(2.f); = PrimBuild::begin(GFXLineList, 2);
glBegin(GL_POINTS); = GFX->setVertexBuffer( mDots );/PrimBuild::begin( GFXPointList, mDots->mNumVerts);
glVertex3fv = PrimBuild::vertex3fv
glEnable(GL_LIGHTING); = GFX->setLightingEnable(true);
glEnable(GL_DEPTH_TEST); = GFX->setZWriteEnable(true);
glMatrixMode(GL_PROJECTION); = MatrixF projection = GFX->getProjectionMatrix();
dglGetViewport(&viewport); = MatrixF view = GFX->getViewMatrix();
dglMultMatrix(&getTransform()); = GFX->multWorld(getTransform());
glTexCoord2f = PrimBuild::texCoord2f
good luck