ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator Screen Width and Height Problem
person icon
gazzauk
Registered User
Quote
2026-04-15 19:45:05

Could anyone explain why ccbGetScreenWidth() and ccbGetScreenHeight() return completely differnet values to the window/resolution publish settings ??

I have my window/resolution set to 800x600 but the ccbGetScreen functions return 1000x750.

Is there a built in function without having to use magic numbers to get the exact screen width and height ?

I'm try to use ccbRenderToTexture but the exact screen size is required when resizing my window.

Thanks.

person icon
Guest2
Guest
Quote
2026-04-16 23:01:06

Your Windows system may be using a high DPI scaling setting.

- Navigate to Settings - System - Display - Scale and Layout
- Check if the scaling value is above 100% – this could be the cause of the problem.

By enabling the high DPI scaling (setting it to 125%), I was able to reproduce the effect you described with a minimal scene setup.

If you want to keep your global DPI scaling setting, you can adjust the settings for each application individually.
Like this:
- Right-click on CopperCube.exe (or your game exe)
- Properties
- Compatibility-tab
- Click on "Change high DPI settings"
- Under "Program DPI" - set "Use this setting to fix scaling problems..."
- Under "High DPI scaling override" - set "Override high DPI scaling behavior" to "Application"

Tested under Windows 10.

Hopefully this works for you.

person icon
gazzauk
Registered User
Quote
2026-04-16 23:30:34

Genius! yup, that was the problem. I'm was using 125% for my display scaling.

When I think of it, makes sense now, if I multiply the resolution setting by 125% I can get the resolution that coppercube thinks my display is.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |