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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - flashrocket

Pages: [1] 2
1
General / Re: Supporting multiple resolutions
« on: April 19, 2015, 04:36:26 pm »
After tinkering around I found that setting view to (something)x768 using similar code as below to be useful in resolutions varying from 800x600 to 1366x768
(click to show/hide)

Please do suggest a better solution than this.

2
General / Re: Supporting multiple resolutions
« on: April 19, 2015, 04:14:44 pm »
Quote
You can scale things.
Can you please be more specific. Upscaling? Downscaling? Scale What?(Views or textures)

Quote
You can use vector graphics that are effectively resolution independent.
I'm trying to use fonts(truetype) I think they are vector(https://msdn.microsoft.com/en-us/library/windows/desktop/dd162893(v=vs.85).aspx) Is there some other way?
I thought SVG wasn't supported in SFML?

Quote
You can keep your images at one resolution and letterbox when resolution goes up.
What's a letterbox?

3
General / Re: Supporting multiple resolutions
« on: April 19, 2015, 03:37:02 pm »
Quote
(click to show/hide)
Do you mean to say
  • create a large view and downscale it
  • change the character size on each change in resolution while using a native sized view
Is there any alternate method of supporting multi-resolution.

4
General / Supporting multiple resolutions
« on: April 19, 2015, 02:35:03 pm »
Hello, I'm tying to write a game and I found problem.Supporting multiple resolutions.
  • What is the best way to do this?
I created an implementation but it had a problem.
I created a small sized sf::View(800x600) and scaled it into a large screen(1366x768)
But during the up scaling I noticed that drawable objects such as sf::CircleShape were crisp while sf::Text was pixelated.
(click to show/hide)
If this is a good implementation then
  • Why does this happen?
  • How do I fix it?

5
General / Re: Eclipse IDE Linux setup help
« on: April 18, 2015, 02:20:24 pm »
I use ubuntu but this should work on mint too.(I think)
make sure you have eclipse CDT(eclipse for c/c++ developers)
Install the following packages
g++ libsfml-dev
(click to show/hide)
Open eclipse and goto File > Project > C/C++ > C++ Project
click next.
Type the name and select Linux GCC as the toolchain and you can select hello world as project type.
Press Finish.
Click build(Hammer button) and then press run(Play button).
It should say hello world!!.

now right click on the project name and select properties.
Goto C/C++ build > Settings > Tool Settings
Select Configuration as [all configurations]
Goto GCC C++ Linker > Libraries
On the right hand side use add button and rearrange libraries so you see the following in correct order
(click to show/hide)
press OK
Now select everything and paste the following code.
(click to show/hide)
Now save and build then run.
Hope this was useful.


Edit:
Here is some info
(click to show/hide)

6
SFML website / Possible Typo in Website(SFML Changelog)
« on: April 18, 2015, 09:15:44 am »
In http://www.sfml-dev.org/changelog.php there seems to be a typo in Changelog > SFML 2.2 > Window > Features > 3rd point.
I do not believe FreeBDS exists and it should have been FreeBSD.https://www.freebsd.org/
Correct me if I'm wrong.
(click to show/hide)

7
Graphics / Re: Question in sf::Text
« on: April 16, 2015, 03:09:38 pm »
Thank You. 8) 8)

8
Graphics / Question in sf::Text
« on: April 16, 2015, 02:56:45 pm »
I created sf::Text and used setPosition(50,50);.
but when i give getGlobalBounds(); I interestingly get the following
If you notice the attachment you see that top is showing 58 rather than 50.
  • Where is this extra 8 pixels coming from?
  • How to remove them?

9
Thank you for the quick answer. :) :)

10
Im learning c++ 11 and i found this error
#include<SFML/Graphics.hpp>

int main()
{
        sf::VertexArray a;
        for(auto& b:a)
        {
       
        }
}
 
error when compiled with GCC
Code: [Select]
g++ test.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system -std=c++11
test.cpp: In function ‘int main()’:
test.cpp:6:14: error: ‘begin’ was not declared in this scope
  for(auto& b:a)
              ^
test.cpp:6:14: note: suggested alternative:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.9/string:52,
                 from /usr/include/c++/4.9/bits/locale_classes.h:40,
                 from /usr/include/c++/4.9/bits/ios_base.h:41,
                 from /usr/include/c++/4.9/ios:42,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/SFML/System/Err.hpp:32,
                 from /usr/include/SFML/System.hpp:34,
                 from /usr/include/SFML/Window.hpp:32,
                 from /usr/include/SFML/Graphics.hpp:32,
                 from test.cpp:1:
/usr/include/c++/4.9/initializer_list:89:5: note:   ‘std::begin’
     begin(initializer_list<_Tp> __ils) noexcept
     ^
test.cpp:6:14: error: ‘end’ was not declared in this scope
  for(auto& b:a)
              ^
test.cpp:6:14: note: suggested alternative:
In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.9/string:52,
                 from /usr/include/c++/4.9/bits/locale_classes.h:40,
                 from /usr/include/c++/4.9/bits/ios_base.h:41,
                 from /usr/include/c++/4.9/ios:42,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/SFML/System/Err.hpp:32,
                 from /usr/include/SFML/System.hpp:34,
                 from /usr/include/SFML/Window.hpp:32,
                 from /usr/include/SFML/Graphics.hpp:32,
                 from test.cpp:1:
/usr/include/c++/4.9/initializer_list:99:5: note:   ‘std::end’
     end(initializer_list<_Tp> __ils) noexcept
     ^

error when compiled with clang
Code: [Select]
clang++ test.cpp -o test -lsfml-graphics -lsfml-window -lsfml-system -std=c++11
test.cpp:6:13: error: invalid range expression of type 'sf::VertexArray'; no
      viable 'begin' function available
        for(auto& b:a)
                   ^~
1 error generated.

11
Window / Re: Alt tab not working in fullscreen
« on: April 04, 2015, 08:43:34 am »
Thank You :) :). Now its working. ;D

12
Window / Re: Alt tab not working in fullscreen
« on: April 03, 2015, 04:41:27 pm »
https://github.com/SFML/SFML/pull/825

I tried the git version but now it no longer goes to fullscreen.
The title and launcher are still visible during application.

My code.

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::RenderWindow window{sf::VideoMode::getDesktopMode(),"Hello",sf::Style::Fullscreen};
    while(window.isOpen()){
        sf::Event event;
        while(window.pollEvent(event))
            switch (event.type) {
            case sf::Event::Closed:
                window.close();
                break;
            case sf::Event::KeyPressed:
                switch(event.key.code){
                case sf::Keyboard::Escape:
                    window.close();
                    break;
                default:
                    break;
                }

            default:
                break;
            }
        window.clear(sf::Color::Blue);
        window.display();
    }
    return 0;
}

 

13
Window / Alt tab not working in fullscreen
« on: April 03, 2015, 01:37:49 pm »
In linux(Ubuntu 14.10) some keys dont work in full screen such as alt+tab, volume keys, brightness keys. How to enable them?? :-\

14
General / Re: Differenciating mouse click and mouse drag
« on: May 04, 2014, 03:20:18 pm »
@Jesper Juhl
Thanks that was exactly what i wanted.

15
General / Differenciating mouse click and mouse drag
« on: May 04, 2014, 02:02:02 pm »
I want to perform different actions for mouse clicked and mouse dragged.
mouse drag means click and move mouse.

Pages: [1] 2