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?
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?
Torque 3D Owner Ted Southard