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.

Dark GDK / dbScreenWidth

Author
Message
lpb
16
Years of Service
User Offline
Joined: 30th Jan 2008
Location:
Posted: 30th Jan 2008 13:17
The function dbScreenWidth always returns 640, regardless of a change when the user maximizes/changes the window size. Can I obtain the real window size with this or another function?

Example:

#include "DarkGDK.h"
#include <stdio.h>

void DarkGDK (void)
{
dbSyncOn ();
dbSyncRate (60);
while (LoopGDK ())
{
char message [100];
dbClear(0,0,0);
sprintf (message, "Width: %d", dbScreenWidth());
dbText (10, 10, message);
dbSync ();
}
}
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 30th Jan 2008 16:50
lbp,

dbScreenWidth() will return the width of the DX surface (ie: the DisplayMode), not the actual size of the window.

I do not know if is there a method to get the Window dimension.

Thiago
Virtual X
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location:
Posted: 30th Jan 2008 17:46
If you mean the 'desktop' resolution then

GetSystemMetrics(SM_CXSCREEN)
GetSystemMetrics(SM_CYSCREEN)

should do the trick!
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 30th Jan 2008 18:47
@Virtual X:

I thinks he means the 'window' width.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 1st Feb 2008 22:33
Would somthing like this do ya



thanks chunks..
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 2nd Feb 2008 02:46
I think that's exactly what he needed, chunks chunks.
Let's wait for his position.
lpb
16
Years of Service
User Offline
Joined: 30th Jan 2008
Location:
Posted: 5th Feb 2008 01:17
Thank you very mutch , that shows the window size.

¿There is any possibility to avoid the scaling of the fonts and the scene when the user changes the window size?

Login to post a reply

Server time is: 2024-11-20 01:38:59
Your offset time is: 2024-11-20 01:38:59