Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: inconsistency on fullscreen stretching  (Read 4902 times)

0 Members and 1 Guest are viewing this topic.

shiroaisu

  • Newbie
  • *
  • Posts: 28
    • View Profile
inconsistency on fullscreen stretching
« on: June 13, 2011, 01:55:19 am »
Hi

I want my windows to stretch when i put them on full screen as oposed to just resizing themselves to the size of the screen ( I want them to stay at the same resolution ), but i cant seem to be able to do this, it seems a little random if the window will strech or not, for example:

I had a piece of code where i had
App.Create( sf::VideoMode( 800, 600 ), "Test", sf::Style::Fullscreen );

and this didnt stretched the window, the window just increased its resolution to match the screens resolution. Then i thought "maybe its because of the lack of antialiasing... doesnt make much sence but lets give it a try", and so i tried:
App.Create( sf::VideoMode( 800, 600 ), "Test", sf::Style::Fullscreen, sf::WindowSettings( 24, 8, 4 ) );

and this actualy made the window stretch, i thought that was it, but then i removed that little bit again, to make sure that that was realy it, so i got back at:
App.Create( sf::VideoMode( 800, 600 ), "Test", sf::Style::Fullscreen );

But this time it stretched too. And then i tried the:
App.Create( sf::VideoMode( 800, 600 ), "Test", sf::Style::Fullscreen, sf::WindowSettings( 24, 8, 4 ) );

on a completly diferent program and i didnt saw any changes.


Sory if this text is a mess but really, this is really confusing me :\ how can i make the window stretch ( or not ) on fullscreen??

Btw, my monitor has 1920x1080 resolution.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
inconsistency on fullscreen stretching
« Reply #1 on: June 13, 2011, 10:28:59 am »
What OS? Which version of SFML?
Laurent Gomila - SFML developer

shiroaisu

  • Newbie
  • *
  • Posts: 28
    • View Profile
inconsistency on fullscreen stretching
« Reply #2 on: June 13, 2011, 12:10:36 pm »
Quote from: "Laurent"
What OS? Which version of SFML?


OS: Win7 64
SFML: 1.6

I know now how to make it stretch by using views, but i still dont get it why it stretched in my example above :\

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
inconsistency on fullscreen stretching
« Reply #3 on: June 13, 2011, 05:46:36 pm »
I don't know, so far you're the only one to report such a bug.
Laurent Gomila - SFML developer

shiroaisu

  • Newbie
  • *
  • Posts: 28
    • View Profile
inconsistency on fullscreen stretching
« Reply #4 on: June 13, 2011, 06:21:35 pm »
Quote from: "Laurent"
I don't know, so far you're the only one to report such a bug.


hmm ok, i will make execute some more tests to give more concrete info.
Can you just please tell me how it was suposed to work?

To my understanding if we dont use views on fullscreen the window will always resize to match our resolution right?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
inconsistency on fullscreen stretching
« Reply #5 on: June 13, 2011, 06:29:23 pm »
Quote
Can you just please tell me how it was suposed to work?

How what is supposed to work?
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
inconsistency on fullscreen stretching
« Reply #6 on: June 13, 2011, 10:11:01 pm »
Quote from: "shiroaisu"
To my understanding if we dont use views on fullscreen the window will always resize to match our resolution right?


Might be me misunderstanding but I think you are looking for that the screen changes it's resolution to match the window resolution.

IE: If you have a window that is 800x600 and a screen that is 1024x768 and make the window go fullscreen, the screen will go down to that windows resolution. So everything will look bigger as there is "less" pixels to go around.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

shiroaisu

  • Newbie
  • *
  • Posts: 28
    • View Profile
inconsistency on fullscreen stretching
« Reply #7 on: June 14, 2011, 06:43:39 pm »
Quote from: "Groogy"

Might be me misunderstanding but I think you are looking for that the screen changes it's resolution to match the window resolution.


Exacly.

sory i wasnt too clear Laurent, i meant to ask how the fullscreen worked, if it normaly stretches to fit the screen or if it gives the window the screens resolution.

Kian

  • Newbie
  • *
  • Posts: 44
    • View Profile
inconsistency on fullscreen stretching
« Reply #8 on: June 14, 2011, 08:14:17 pm »
Fullscreen only works correctly if you pass a valid videomode. You can look it up in the documentation:

http://www.sfml-dev.org/documentation/2.0/classsf_1_1Window.php

Quote
An optional style can be passed to customize the look and behaviour of the window (borders, title bar, resizable, closable, ...). If style contains Style::Fullscreen, then mode must be a valid video mode.


You are telling the create function to make a fullscreen window with 800x600 resolution, which may not be a valid value. To be certain of what video modes your screen accepts, you can use GetFullscreenModes () (documentation for VideoMode class found here: http://www.sfml-dev.org/documentation/2.0/classsf_1_1VideoMode.php) which provides a vector with all the valid video modes.

If you just want to use the current resolution and bitdepth of the desktop, you can use GetDesktopMode().

The question I have to ask is, what is it that you want? Do you want to stretch a low resolution over the full screen (things will look pixelated and large) or get the full screen at the native resolution of the monitor (1920x1080)?

If it's the former, you need to make sure the resolution you are requesting is valid (use GetFullscreenModes() ). If it's the latter, DON'T specify a lower resolution and use GetDesktopMode().

To answer the last question: The default behavior is to provide you with the resolution you asked for. The documentation doesn't say what happens when the value is not valid, which means you should be making sure the value is valid before creating a full screen window.

shiroaisu

  • Newbie
  • *
  • Posts: 28
    • View Profile
inconsistency on fullscreen stretching
« Reply #9 on: June 29, 2011, 06:05:49 pm »
Sory about the responces delay,

for future reference u were right, i was using an invalid resolution. silly me.

Sory bout the false alarm laurent

 

anything