get width and height of screen

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
nevarim
Gnoll
Posts: 655
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
Contact:

get width and height of screen

Post by nevarim » Mon Nov 01, 2010 5:40 pm

hi all

how can i get height and width of screen resolution ?

thanks

Nevarim
0 x
i'm a noob until proven otherwise :D
used in my project ;) and thanks to everyone :D
Ogre 3d
Mygui
Skyx
Hydrax
MOC
CCS

User avatar
alexdbkim
Greenskin
Posts: 130
Joined: Sat Oct 18, 2008 7:50 am
Location: Sydney, Australia / Seoul, Korea
Contact:

Re: get width and height of screen

Post by alexdbkim » Tue Nov 02, 2010 1:17 am

nevarim wrote:hi all

how can i get height and width of screen resolution ?

thanks

Nevarim
Hi Nevarim,

your question is little bit vague. =) Are you want to know the screen resolution of your monitor? or your application? If it was your application then I guess you are referring to the viewport of your application.

http://www.ogre3d.org/docs/api/html/cla ... wport.html

There are a number of useful methods in the class allow you to get the viewport size values.

Regards,
Alex Kim
0 x
Alexander Dong Back Kim - ê¹€ë

haltendehand
Halfling
Posts: 98
Joined: Wed Jun 16, 2010 11:44 pm
Location: Freiburg, Germany
Contact:

Re: get width and height of screen

Post by haltendehand » Tue Nov 02, 2010 1:28 am

The vertical resolution of your application window is returned by the function getActualHeight in the Ogre::Viewport class.
The horizontal resolution of your application window is returned by the function getActualWidth in the Ogre::Viewport class.
0 x

User avatar
nevarim
Gnoll
Posts: 655
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
Contact:

Re: get width and height of screen

Post by nevarim » Tue Nov 02, 2010 12:39 pm

is this :D thanks
0 x
i'm a noob until proven otherwise :D
used in my project ;) and thanks to everyone :D
Ogre 3d
Mygui
Skyx
Hydrax
MOC
CCS

swuth
Bronze Sponsor
Bronze Sponsor
Posts: 53
Joined: Wed Mar 25, 2015 10:01 pm

Re: get width and height of screen

Post by swuth » Tue Jun 16, 2015 7:15 pm

I find that this doesnt work when using 1280x1024.

The width is correct but for some bizarre reason the height is returned as 993..... anyone else experiencing this?
0 x

Post Reply