Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
Get Screen Size?
Print
Pages: [
1
]
Author
Topic: Get Screen Size? (Read 19710 times)
0 Members and 1 Guest are viewing this topic.
Anthony11
Newbie
Posts: 38
Get Screen Size?
«
on:
July 12, 2015, 01:37:28 am »
sf::VideoMode::getDesktopMode().width
sf::VideoMode::getDesktopMode().height
Doesn't work for some reason (called before the window is created)
Logged
kitteh-warrior
Guest
Re: Get Screen Size?
«
Reply #1 on:
July 12, 2015, 01:51:22 am »
http://en.sfml-dev.org/forums/index.php?topic=5559.0
Edit
: It works for me with the following code:
#include <SFML/Window.hpp>
#include <iostream>
int
main
(
)
{
std
::
cout
<<
sf
::
VideoMode
::
getDesktopMode
(
)
.
width
<<
", "
<<
sf
::
VideoMode
::
getDesktopMode
(
)
.
height
;
}
It outputs my correct resolution. I am running Windows 8.1 Pro, with AMD Radeon R4 graphics.
«
Last Edit: July 12, 2015, 01:54:28 am by kitteh-warrior
»
Logged
Anthony11
Newbie
Posts: 38
Re: Get Screen Size?
«
Reply #2 on:
July 12, 2015, 02:19:44 am »
sorry, my bad, it appears to be working for me as well, i guess i screwed up something with the lua code
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
Get Screen Size?