Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HelloWorld and HelloWorldOOP raise an exception on the Surface device vertically oriented. #4

Open
DJMaster opened this issue Jun 28, 2015 · 0 comments

Comments

@DJMaster
Copy link

HelloWorld and HelloWorldOOP raise an exception on the Surface device vertically oriented.

According to SFML Documentation (SFML-2.3\classsf_1_1VideoMode.html): Video modes are used to setup windows (sf::Window) at creation time. The main usage of video modes is for fullscreen mode: indeed you must use one of the valid video modes allowed by the OS (which are defined by what the monitor and the graphics card support), otherwise your window creation will just fail.

Testing if Video Mode is valid for a windowed Window is not appropriate.

Please review the following patches:

diff --git a/Examples/Hello World/HelloWorld.dpr b/Examples/Hello World/HelloWorld.dpr
index 03999c2..1ae70bc 100644
--- a/Examples/Hello World/HelloWorld.dpr   
+++ b/Examples/Hello World/HelloWorld.dpr   
@@ -22,8 +22,6 @@ begin
   Mode.Width := 800;
   Mode.Height := 600;
   Mode.BitsPerPixel := 32;
-  if not SfmlVideoModeIsValid(Mode) then
-    raise Exception.Create('Invalid video mode');

   Window := SfmlRenderWindowCreate(Mode, 'SFML Window', [sfResize, sfClose], nil);
   if not Assigned(Window) then 
diff --git a/Examples/Hello World (OOP)/HelloWorld.dpr b/Examples/Hello World (OOP)/HelloWorld.dpr
index 618703a..86b7bca 100644
--- a/Examples/Hello World (OOP)/HelloWorld.dpr 
+++ b/Examples/Hello World (OOP)/HelloWorld.dpr 
@@ -22,8 +22,6 @@ begin
   Mode.Width := 800;
   Mode.Height := 600;
   Mode.BitsPerPixel := 32;
-  if not SfmlVideoModeIsValid(Mode) then
-    raise Exception.Create('Invalid video mode');

   Window := TSfmlRenderWindow.Create(Mode, AnsiString('SFML Window'),
     [sfResize, sfClose], nil); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant