I noticed that my code was eating memory while idling in the main loop. Eventually it crashing because of the memory usage. So I commented out everything in the main loop in order to isolate the issue.
The below code is the culprit somehow.
// Includes
#include "template.h"
#include <string>
// Namespace
using namespace AGK;
using namespace std;
app App;
float screenWidth;
float screenHeight;
float mouseX;
float mouseY;
void app::Begin(void)
{
screenWidth = 1280;
screenHeight = 720;
agk::SetScreenResolution(1920, 1080);
agk::SetVirtualResolution(screenWidth, screenHeight);
agk::SetWindowSize(1920, 1080, 0);
agk::SetClearColor(0, 0, 0); // light blue
agk::SetSyncRate(60, 0);
agk::SetScissor(0, 0, 0, 0);
agk::SetWindowTitle("Cylical Redundancy Check");
for (int a = 1; a <= 40; a++)
{
agk::CreateText(a, "");
agk::SetTextSize(a, float(30));
agk::SetTextColor(a, 0, 255, 255, 255);
agk::SetTextPosition(a, float(1), float(a * 30));
agk::SetTextDepth(a, 0);
}
}
void app::Loop (void)
{
mouseX = agk::GetPointerX();
mouseY = agk::GetPointerY();
agk::SetTextString(1, ("mouseX= " + std::string(agk::Str(mouseX))).c_str());
agk::SetTextString(2, ("mouseY= " + std::string(agk::Str(mouseY))).c_str());
agk::Sync();
}
void app::End (void)
{
}
Running this with task manager open, I can see the memory usage increase for the executable. Should the memory usage be increasing? Is this normal?
home.wavecable.com/~mindsclay