Game Development Community

Platform::getWindowSize() problems

by James Laker (BurNinG) · in Torque Game Engine Advanced · 08/20/2007 (8:23 am) · 0 replies

Has anyone had any problems using Platform::getWindowSize() in TGEA?

I'm using it in a guiControl (my Targetting Hud) in the onrender function. I want to use a different way to know if something is rendered offscreen, since the old method doesn't work good enough. I need it to be pretty accurate.

I'm trying to render an icon of the target at the edge of the screen when he is not in view. So I really need it to pop up when the target is out of the view using something other that the Camera FOV calculation used with some of guiControls (eg guiShapeName).

So there's the Platform::getWindowSize();! It compiles fine (using F7)... but when I try and build my solution it gives something this
Error	1	error LNK2001: unresolved external symbol "public: static class Point2I const & __cdecl Platform::getWindowSize(void)" (?getWindowSize@Platform@@SAABVPoint2I@@XZ)	guiTargetHud.obj


And here's the code.

Point2I WindowSize = Platform::getWindowSize();

S32 WindowWidth = WindowSize.x;
S32 WindowHeight = WindowSize.y;

Con::printf("Platform::getWindowSize.x = %i", WindowSize.x);
Con::printf("Platform::getWindowSize.y = %i", WindowSize.y);
Con::printf("projPnt.x						 = %f", projPnt.x);
Con::printf("projPnt.y						 = %f", projPnt.y);

if (projPnt.x < 0 || projPnt.y < 0 || projPnt.y > (F32)WindowHeight || projPnt.y > (F32)WindowWidth)

The platform is included in GuiControl which I inherit from... So can someone help me out here?

Thanx