Game Development Community

Drawing a line

by Steve D · in Torque Game Engine · 07/25/2007 (7:11 am) · 2 replies

If anyone can give me some help it would be appreciated!

I'm trying to draw a simple line from point A to point B

I'm using the afx mod so in afxtsctrl I have one line, the rest is stock code -


void afxTSCtrl::onRender(Point2I offset, const RectI &updateRect)
{
GameConnection* con = GameConnection::getConnectionToServer();
bool skipRender = (!con ||
(con->getWhiteOut() >= 1.f) ||
(con->getDamageFlash() >= 1.f) ||
(con->getBlackOut() >= 1.f));

if (!skipRender)
Parent::onRender(offset, updateRect);

dglSetViewport(updateRect);
dglDrawLine(366, 307, 366, 312, ColorI(0,0,255)); // MY DGL LINE

CameraQuery camq;
if (GameProcessCameraQuery(&camq))
GameRenderFilters(camq);


}

But nothing shows up at all. When I put this same line in the void afxTSCtrl::renderWorld(const RectI &updateRect) I get a blue line that shows up on my avatar's back!

I'm doing something really stupid or what?

#1
07/30/2007 (10:20 am)
My coding could be rusty, since I haven't coded in a while, but shouldn't you put the line before calling the update through dglSetViewport()?
#2
07/30/2007 (8:35 pm)
Tried that, still didn't work.