1
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: June 30, 2022, 12:57:38 pm »That seems rather odd. Do you get any Desktop Modes at least?
I get:
3024x1964 - 32 bpp
by running sf::VideoMode::getDesktopMode() (which is the correct resolution of my screen).
I'm running a minimal example:
#include <vector>
#include <iostream>
#include <SFML/Window.hpp>
int main()
{
// Display the list of all the video modes available for fullscreen
std::vector<sf::VideoMode> modes = sf::VideoMode::getFullscreenModes();
for (std::size_t i = 0; i < modes.size(); ++i)
{
sf::VideoMode mode = modes[i];
std::cout << "Mode #" << i << ": "
<< mode.width << "x" << mode.height << " - "
<< mode.bitsPerPixel << " bpp" << std::endl;
}
sf::VideoMode defaultMode = sf::VideoMode::getDesktopMode();
std::cout << defaultMode.width << "x" << defaultMode.height << " - "
<< defaultMode.bitsPerPixel << " bpp" << std::endl;
sf::Window window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}
#include <iostream>
#include <SFML/Window.hpp>
int main()
{
// Display the list of all the video modes available for fullscreen
std::vector<sf::VideoMode> modes = sf::VideoMode::getFullscreenModes();
for (std::size_t i = 0; i < modes.size(); ++i)
{
sf::VideoMode mode = modes[i];
std::cout << "Mode #" << i << ": "
<< mode.width << "x" << mode.height << " - "
<< mode.bitsPerPixel << " bpp" << std::endl;
}
sf::VideoMode defaultMode = sf::VideoMode::getDesktopMode();
std::cout << defaultMode.width << "x" << defaultMode.height << " - "
<< defaultMode.bitsPerPixel << " bpp" << std::endl;
sf::Window window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}
I'm able to run any window by creating a specific VideoMode, the only thing that doesn't work is fullscreen.