Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Initial Window Size and Title (AGK Tier 2)

Author
Message
Grizzlius_Maximus
6
Years of Service
User Offline
Joined: 16th Oct 2017
Location:
Posted: 24th Apr 2020 19:09
When I run my game, the game window size starts of as default (1024,768) with AppGameKit written as the window title before changing to what I have set it to. I set the window size and title inside app::Begin as shown below



This happens even when there is nothing running in the loop except Sync(). I am using Visual Studio 2017 with windows_2017_64 template.

I want the game window size and title to be set immediately upon startup. Is this a bug or am I doing something wrong?

The author of this post has marked a post as an answer.

Go to answer

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 24th Apr 2020 20:26
This post has been marked by the post author as the answer.
Look in the Template.h file that is part of the standrd project. the default values are:

#define DEVICE_WIDTH 1024
#define DEVICE_HEIGHT 768
#define DEVICE_POS_X 32
#define DEVICE_POS_Y 32
#define FULLSCREEN false

Set those to whatever you want them to be.

For the title, have a look in Core.cpp at line 791 (approx) where the window is created

HWND hWnd = CreateWindowW(L"OPENGLWINDOW", L"AGK", dwStyle, x, y, WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top, NULL, NULL, hInstance, NULL);

Change the L"AGK" to whatever you want it to be.

You should not then have to do any window size setting or title setting in the app
Grizzlius_Maximus
6
Years of Service
User Offline
Joined: 16th Oct 2017
Location:
Posted: 24th Apr 2020 22:56
This worked exactly the way I wanted. Thanks!

Login to post a reply

Server time is: 2024-04-19 06:35:01
Your offset time is: 2024-04-19 06:35:01