I'm very new to AppGameKit so maybe I'm doing something wrong, but I'm getting different results in windowed mode compared to full screen mode. Full screen mode seems to be around 200 pixels out.
I've commented the problem in the below code. The ships slide onto the screen and slide off to the right.
In windowed mode SetWindowSize(1024, 768, 0) it works correctly. The start position is -64 (the sprite is 64 pixels in size) and the final position is 1024 (screen width).
However, in full screen mode I have to set start position to -256 and end position to 1200 - or the sprite starts around 200 pixels in and finishes 200 pixels from the screen edge.
// includes
#include "template.h"
// namespace
using namespace AGK;
app App;
void app::Begin(void)
{
agk::SetWindowTitle("Move Ship");
agk::SetWindowSize(1024, 768, 0); // fullscreen mode SetWindowSize(1024, 768, 1) gives the error
agk::SetDisplayAspect(1024 / 768);
agk::SetVirtualResolution (1024, 768);
agk::SetClearColor( 150,170,204 ); // light blue
agk::SetSyncRate(62, 1);
agk::SetVSync(1);
agk::SetScissor(0,0,0,0);
agk::LoadImage(1, "ship.png");
agk::SetSpriteOffset(1, 0, 0);
agk::CreateSprite(1, 1);
agk::CreateSprite(2, 1);
agk::CreateSprite(3, 1);
agk::SetRawMouseVisible(0);
}
int app::Loop (void)
{
float xPos = -64.0; // has to be -256 in full screen mode
do {
agk::Print(agk::ScreenFPS());
agk::SetSpritePosition(1, xPos, 152.0);
agk::SetSpritePosition(2, xPos, 352.0);
agk::SetSpritePosition(3, xPos, 552.0);
xPos += 1.0;
agk::Sync();
}
while (xPos < 1024.0); // has to be 1200 in full screen mode
return 1;
}
void app::End(void)
{
}