Skip to content

Commit b323b53

Browse files
committed
Add setWindowOrigin command
1 parent 96f0611 commit b323b53

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/engine/sys/sdl_glimp.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,3 +2992,23 @@ void GLimp_LogComment( const char *comment )
29922992
strlen( buf ), buf );
29932993
}
29942994
}
2995+
2996+
class SetWindowOriginCmd : public Cmd::StaticCmd
2997+
{
2998+
public:
2999+
SetWindowOriginCmd() : StaticCmd("setWindowOrigin", Cmd::CLIENT, "move the window") {}
3000+
3001+
void Run( const Cmd::Args &args ) const
3002+
{
3003+
int x, y;
3004+
if ( args.Argc() != 3
3005+
|| !Str::ParseInt( x, args.Argv( 1 ) ) || !Str::ParseInt( y, args.Argv( 2 ) ) )
3006+
{
3007+
Print( "Usage: setWindowOrigin <x> <y>" );
3008+
return;
3009+
}
3010+
3011+
SDL_SetWindowPosition( window, x, y );
3012+
}
3013+
};
3014+
static SetWindowOriginCmd setWindowOriginCmdRegistration;

0 commit comments

Comments
 (0)