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: 675
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
x 4
Contact:

get width and height of screen

Post by nevarim »

hi all

how can i get height and width of screen resolution ?

thanks

Nevarim
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 »

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
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 »

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.
User avatar
nevarim
Gnoll
Posts: 675
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
x 4
Contact:

Re: get width and height of screen

Post by nevarim »

is this :D thanks
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 »

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?
Post Reply