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

Author Topic: Disable resizing window in SFML.NET  (Read 4172 times)

0 Members and 1 Guest are viewing this topic.

stadoblech

  • Newbie
  • *
  • Posts: 4
    • View Profile
Disable resizing window in SFML.NET
« on: June 03, 2014, 11:58:55 am »
Hello

im wondering how can i disable resizing window in SFML.NET . I have tried many websites but i didnt find suitable answer.

im working with basic class Game, which is almost in all tutorials on web

class Game
    {
        RenderWindow window;

        public void start()
        {
            window = new RenderWindow(new VideoMode(800,600),"title");
            window.SetVisible(true);
            window.Closed += new EventHandler(onClose);

            while (window.IsOpen())
            {
                window.DispatchEvents();
                window.Clear();
                window.Display();
            }
        }

        void onClose(object sender, EventArgs e)
        {
            window.Close();
        }
    }
I think resizing window is pretty undesirable in game development, so im trying to solve this on very beginning of develop my first game :)
Im begginer with SFML, but i made few games in  XNA and I know C# very well.
can anyone help me ?
Thanks for answers
« Last Edit: June 03, 2014, 12:01:21 pm by stadoblech »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Disable resizing window in SFML.NET
« Reply #1 on: June 03, 2014, 12:56:46 pm »
This is explained in the documentation and tutorials. Have you read them first?
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Disable resizing window in SFML.NET
« Reply #2 on: June 03, 2014, 12:57:29 pm »
im wondering how can i disable resizing window in SFML.NET . I have tried many websites but i didnt find suitable answer.
Next time, try the official documentation instead of arbitrary websites :P
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

stadoblech

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Disable resizing window in SFML.NET
« Reply #3 on: June 03, 2014, 05:24:01 pm »
obviously i didnt found solution for my problem. If i did, i wouldnt be writing this post for sure :) Okay okay ... unless you didnt helped me with my problem, i presume that you love riddles and dont love straight answers :) so at least please point me to the right direction . Thanks ! :)
edit : look, i read tutorials. I tried this with C++ and it works lovely. But with C#, well ... here i am on forums
« Last Edit: June 03, 2014, 05:26:26 pm by stadoblech »

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Disable resizing window in SFML.NET
« Reply #4 on: June 03, 2014, 05:45:49 pm »
Well if you tried with C# where is your code that uses the overloaded constructor?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

stadoblech

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Disable resizing window in SFML.NET
« Reply #5 on: June 05, 2014, 10:36:49 am »
okay i dont have solution for this. If you want, lock this thread. I didnt figure it out, i dont have time for deep studying SFML, im doing this only for fun.I wanted straight answer and i didnt get it. So thanks for nothing i guess. I will try unity, it looks like that community about unity is much opened against community about SFML. Nothing personal

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Disable resizing window in SFML.NET
« Reply #6 on: June 05, 2014, 10:46:40 am »
Sorry if we sound rude. That was not the purpose. Here we try to help people learn how to solve their problems, rather than just thowing direct answers and waiting until they come back for their next problem.

But since you're only interested in the line of code to paste in your project, here it is:

window = new RenderWindow(new VideoMode(800,600),"title", Window.Styles.Titlebar | Window.Styles.Close);
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Disable resizing window in SFML.NET
« Reply #7 on: June 05, 2014, 10:47:52 am »
The riddles as you call them are not meant to annoy you. They should help you lookup the documentation and find the solution by yourself, so that next time you have a similar problem, you can immediately solve it and don't need to wait for an answer on the forum.

zsbzsb gave you a clear hint what to do: use the overloaded constructor where you can specify the window style. With a minimal effort on your side, you would have solved the problem in a minute. Maybe as a general advice, you can't learn programming and game development without reading the appropriate books, tutorials or documentations -- that's in no way different in Unity ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

stadoblech

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Disable resizing window in SFML.NET
« Reply #8 on: June 11, 2014, 10:00:24 am »
well ... my problem was somewhere else. I knew that i can overload RenderWindow constructor, i knew that there are Window.Styles but i didnt know that i can use more that one style. I was trying to use styles dont worry. I didnt want to be defending or something, i was jus little annoyed.
« Last Edit: June 11, 2014, 08:18:38 pm by stadoblech »

 

anything